| ... | @@ -65,18 +65,15 @@ pub fn dup3(old: i32, new: i32, flags: u32) usize { | ... | @@ -65,18 +65,15 @@ pub fn dup3(old: i32, new: i32, flags: u32) usize { |
| 65 | return syscall3(SYS_dup3, @bitCast(usize, @as(isize, old)), @bitCast(usize, @as(isize, new)), flags); | 65 | return syscall3(SYS_dup3, @bitCast(usize, @as(isize, old)), @bitCast(usize, @as(isize, new)), flags); |
| 66 | } | 66 | } |
| 67 | | 67 | |
| 68 | // TODO https://github.com/ziglang/zig/issues/265 | 68 | pub fn chdir(path: [*:0]const u8) usize { |
| 69 | pub fn chdir(path: [*]const u8) usize { | | |
| 70 | return syscall1(SYS_chdir, @ptrToInt(path)); | 69 | return syscall1(SYS_chdir, @ptrToInt(path)); |
| 71 | } | 70 | } |
| 72 | | 71 | |
| 73 | // TODO https://github.com/ziglang/zig/issues/265 | 72 | pub fn chroot(path: [*:0]const u8) usize { |
| 74 | pub fn chroot(path: [*]const u8) usize { | | |
| 75 | return syscall1(SYS_chroot, @ptrToInt(path)); | 73 | return syscall1(SYS_chroot, @ptrToInt(path)); |
| 76 | } | 74 | } |
| 77 | | 75 | |
| 78 | // TODO https://github.com/ziglang/zig/issues/265 | 76 | pub fn execve(path: [*:0]const u8, argv: [*:null]const ?[*:0]const u8, envp: [*:null]const ?[*:0]const u8) usize { |
| 79 | pub fn execve(path: [*]const u8, argv: [*]const ?[*]const u8, envp: [*]const ?[*]const u8) usize { | | |
| 80 | return syscall3(SYS_execve, @ptrToInt(path), @ptrToInt(argv), @ptrToInt(envp)); | 77 | return syscall3(SYS_execve, @ptrToInt(path), @ptrToInt(argv), @ptrToInt(envp)); |
| 81 | } | 78 | } |
| 82 | | 79 | |
| ... | @@ -101,8 +98,7 @@ pub fn futimens(fd: i32, times: *const [2]timespec) usize { | ... | @@ -101,8 +98,7 @@ pub fn futimens(fd: i32, times: *const [2]timespec) usize { |
| 101 | return utimensat(fd, null, times, 0); | 98 | return utimensat(fd, null, times, 0); |
| 102 | } | 99 | } |
| 103 | | 100 | |
| 104 | // TODO https://github.com/ziglang/zig/issues/265 | 101 | pub fn utimensat(dirfd: i32, path: ?[*:0]const u8, times: *const [2]timespec, flags: u32) usize { |
| 105 | pub fn utimensat(dirfd: i32, path: ?[*]const u8, times: *const [2]timespec, flags: u32) usize { | | |
| 106 | return syscall4(SYS_utimensat, @bitCast(usize, @as(isize, dirfd)), @ptrToInt(path), @ptrToInt(times), flags); | 102 | return syscall4(SYS_utimensat, @bitCast(usize, @as(isize, dirfd)), @ptrToInt(path), @ptrToInt(times), flags); |
| 107 | } | 103 | } |
| 108 | | 104 | |
| ... | @@ -140,7 +136,7 @@ pub fn inotify_init1(flags: u32) usize { | ... | @@ -140,7 +136,7 @@ pub fn inotify_init1(flags: u32) usize { |
| 140 | return syscall1(SYS_inotify_init1, flags); | 136 | return syscall1(SYS_inotify_init1, flags); |
| 141 | } | 137 | } |
| 142 | | 138 | |
| 143 | pub fn inotify_add_watch(fd: i32, pathname: [*]const u8, mask: u32) usize { | 139 | pub fn inotify_add_watch(fd: i32, pathname: [*:0]const u8, mask: u32) usize { |
| 144 | return syscall3(SYS_inotify_add_watch, @bitCast(usize, @as(isize, fd)), @ptrToInt(pathname), mask); | 140 | return syscall3(SYS_inotify_add_watch, @bitCast(usize, @as(isize, fd)), @ptrToInt(pathname), mask); |
| 145 | } | 141 | } |
| 146 | | 142 | |
| ... | @@ -148,8 +144,7 @@ pub fn inotify_rm_watch(fd: i32, wd: i32) usize { | ... | @@ -148,8 +144,7 @@ pub fn inotify_rm_watch(fd: i32, wd: i32) usize { |
| 148 | return syscall2(SYS_inotify_rm_watch, @bitCast(usize, @as(isize, fd)), @bitCast(usize, @as(isize, wd))); | 144 | return syscall2(SYS_inotify_rm_watch, @bitCast(usize, @as(isize, fd)), @bitCast(usize, @as(isize, wd))); |
| 149 | } | 145 | } |
| 150 | | 146 | |
| 151 | // TODO https://github.com/ziglang/zig/issues/265 | 147 | pub fn readlink(noalias path: [*:0]const u8, noalias buf_ptr: [*]u8, buf_len: usize) usize { |
| 152 | pub fn readlink(noalias path: [*]const u8, noalias buf_ptr: [*]u8, buf_len: usize) usize { | | |
| 153 | if (@hasDecl(@This(), "SYS_readlink")) { | 148 | if (@hasDecl(@This(), "SYS_readlink")) { |
| 154 | return syscall3(SYS_readlink, @ptrToInt(path), @ptrToInt(buf_ptr), buf_len); | 149 | return syscall3(SYS_readlink, @ptrToInt(path), @ptrToInt(buf_ptr), buf_len); |
| 155 | } else { | 150 | } else { |
| ... | @@ -157,13 +152,11 @@ pub fn readlink(noalias path: [*]const u8, noalias buf_ptr: [*]u8, buf_len: usiz | ... | @@ -157,13 +152,11 @@ pub fn readlink(noalias path: [*]const u8, noalias buf_ptr: [*]u8, buf_len: usiz |
| 157 | } | 152 | } |
| 158 | } | 153 | } |
| 159 | | 154 | |
| 160 | // TODO https://github.com/ziglang/zig/issues/265 | 155 | pub fn readlinkat(dirfd: i32, noalias path: [*:0]const u8, noalias buf_ptr: [*]u8, buf_len: usize) usize { |
| 161 | pub fn readlinkat(dirfd: i32, noalias path: [*]const u8, noalias buf_ptr: [*]u8, buf_len: usize) usize { | | |
| 162 | return syscall4(SYS_readlinkat, @bitCast(usize, @as(isize, dirfd)), @ptrToInt(path), @ptrToInt(buf_ptr), buf_len); | 156 | return syscall4(SYS_readlinkat, @bitCast(usize, @as(isize, dirfd)), @ptrToInt(path), @ptrToInt(buf_ptr), buf_len); |
| 163 | } | 157 | } |
| 164 | | 158 | |
| 165 | // TODO https://github.com/ziglang/zig/issues/265 | 159 | pub fn mkdir(path: [*:0]const u8, mode: u32) usize { |
| 166 | pub fn mkdir(path: [*]const u8, mode: u32) usize { | | |
| 167 | if (@hasDecl(@This(), "SYS_mkdir")) { | 160 | if (@hasDecl(@This(), "SYS_mkdir")) { |
| 168 | return syscall2(SYS_mkdir, @ptrToInt(path), mode); | 161 | return syscall2(SYS_mkdir, @ptrToInt(path), mode); |
| 169 | } else { | 162 | } else { |
| ... | @@ -171,23 +164,19 @@ pub fn mkdir(path: [*]const u8, mode: u32) usize { | ... | @@ -171,23 +164,19 @@ pub fn mkdir(path: [*]const u8, mode: u32) usize { |
| 171 | } | 164 | } |
| 172 | } | 165 | } |
| 173 | | 166 | |
| 174 | // TODO https://github.com/ziglang/zig/issues/265 | 167 | pub fn mkdirat(dirfd: i32, path: [*:0]const u8, mode: u32) usize { |
| 175 | pub fn mkdirat(dirfd: i32, path: [*]const u8, mode: u32) usize { | | |
| 176 | return syscall3(SYS_mkdirat, @bitCast(usize, @as(isize, dirfd)), @ptrToInt(path), mode); | 168 | return syscall3(SYS_mkdirat, @bitCast(usize, @as(isize, dirfd)), @ptrToInt(path), mode); |
| 177 | } | 169 | } |
| 178 | | 170 | |
| 179 | // TODO https://github.com/ziglang/zig/issues/265 | 171 | pub fn mount(special: [*:0]const u8, dir: [*:0]const u8, fstype: [*:0]const u8, flags: u32, data: usize) usize { |
| 180 | pub fn mount(special: [*]const u8, dir: [*]const u8, fstype: [*]const u8, flags: u32, data: usize) usize { | | |
| 181 | return syscall5(SYS_mount, @ptrToInt(special), @ptrToInt(dir), @ptrToInt(fstype), flags, data); | 172 | return syscall5(SYS_mount, @ptrToInt(special), @ptrToInt(dir), @ptrToInt(fstype), flags, data); |
| 182 | } | 173 | } |
| 183 | | 174 | |
| 184 | // TODO https://github.com/ziglang/zig/issues/265 | 175 | pub fn umount(special: [*:0]const u8) usize { |
| 185 | pub fn umount(special: [*]const u8) usize { | | |
| 186 | return syscall2(SYS_umount2, @ptrToInt(special), 0); | 176 | return syscall2(SYS_umount2, @ptrToInt(special), 0); |
| 187 | } | 177 | } |
| 188 | | 178 | |
| 189 | // TODO https://github.com/ziglang/zig/issues/265 | 179 | pub fn umount2(special: [*:0]const u8, flags: u32) usize { |
| 190 | pub fn umount2(special: [*]const u8, flags: u32) usize { | | |
| 191 | return syscall2(SYS_umount2, @ptrToInt(special), flags); | 180 | return syscall2(SYS_umount2, @ptrToInt(special), flags); |
| 192 | } | 181 | } |
| 193 | | 182 | |
| ... | @@ -307,8 +296,7 @@ pub fn pwritev2(fd: i32, iov: [*]const iovec_const, count: usize, offset: u64, f | ... | @@ -307,8 +296,7 @@ pub fn pwritev2(fd: i32, iov: [*]const iovec_const, count: usize, offset: u64, f |
| 307 | ); | 296 | ); |
| 308 | } | 297 | } |
| 309 | | 298 | |
| 310 | // TODO https://github.com/ziglang/zig/issues/265 | 299 | pub fn rmdir(path: [*:0]const u8) usize { |
| 311 | pub fn rmdir(path: [*]const u8) usize { | | |
| 312 | if (@hasDecl(@This(), "SYS_rmdir")) { | 300 | if (@hasDecl(@This(), "SYS_rmdir")) { |
| 313 | return syscall1(SYS_rmdir, @ptrToInt(path)); | 301 | return syscall1(SYS_rmdir, @ptrToInt(path)); |
| 314 | } else { | 302 | } else { |
| ... | @@ -316,8 +304,7 @@ pub fn rmdir(path: [*]const u8) usize { | ... | @@ -316,8 +304,7 @@ pub fn rmdir(path: [*]const u8) usize { |
| 316 | } | 304 | } |
| 317 | } | 305 | } |
| 318 | | 306 | |
| 319 | // TODO https://github.com/ziglang/zig/issues/265 | 307 | pub fn symlink(existing: [*:0]const u8, new: [*:0]const u8) usize { |
| 320 | pub fn symlink(existing: [*]const u8, new: [*]const u8) usize { | | |
| 321 | if (@hasDecl(@This(), "SYS_symlink")) { | 308 | if (@hasDecl(@This(), "SYS_symlink")) { |
| 322 | return syscall2(SYS_symlink, @ptrToInt(existing), @ptrToInt(new)); | 309 | return syscall2(SYS_symlink, @ptrToInt(existing), @ptrToInt(new)); |
| 323 | } else { | 310 | } else { |
| ... | @@ -325,18 +312,15 @@ pub fn symlink(existing: [*]const u8, new: [*]const u8) usize { | ... | @@ -325,18 +312,15 @@ pub fn symlink(existing: [*]const u8, new: [*]const u8) usize { |
| 325 | } | 312 | } |
| 326 | } | 313 | } |
| 327 | | 314 | |
| 328 | // TODO https://github.com/ziglang/zig/issues/265 | 315 | pub fn symlinkat(existing: [*:0]const u8, newfd: i32, newpath: [*:0]const u8) usize { |
| 329 | pub fn symlinkat(existing: [*]const u8, newfd: i32, newpath: [*]const u8) usize { | | |
| 330 | return syscall3(SYS_symlinkat, @ptrToInt(existing), @bitCast(usize, @as(isize, newfd)), @ptrToInt(newpath)); | 316 | return syscall3(SYS_symlinkat, @ptrToInt(existing), @bitCast(usize, @as(isize, newfd)), @ptrToInt(newpath)); |
| 331 | } | 317 | } |
| 332 | | 318 | |
| 333 | // TODO https://github.com/ziglang/zig/issues/265 | | |
| 334 | pub fn pread(fd: i32, buf: [*]u8, count: usize, offset: usize) usize { | 319 | pub fn pread(fd: i32, buf: [*]u8, count: usize, offset: usize) usize { |
| 335 | return syscall4(SYS_pread, @bitCast(usize, @as(isize, fd)), @ptrToInt(buf), count, offset); | 320 | return syscall4(SYS_pread, @bitCast(usize, @as(isize, fd)), @ptrToInt(buf), count, offset); |
| 336 | } | 321 | } |
| 337 | | 322 | |
| 338 | // TODO https://github.com/ziglang/zig/issues/265 | 323 | pub fn access(path: [*:0]const u8, mode: u32) usize { |
| 339 | pub fn access(path: [*]const u8, mode: u32) usize { | | |
| 340 | if (@hasDecl(@This(), "SYS_access")) { | 324 | if (@hasDecl(@This(), "SYS_access")) { |
| 341 | return syscall2(SYS_access, @ptrToInt(path), mode); | 325 | return syscall2(SYS_access, @ptrToInt(path), mode); |
| 342 | } else { | 326 | } else { |
| ... | @@ -344,8 +328,7 @@ pub fn access(path: [*]const u8, mode: u32) usize { | ... | @@ -344,8 +328,7 @@ pub fn access(path: [*]const u8, mode: u32) usize { |
| 344 | } | 328 | } |
| 345 | } | 329 | } |
| 346 | | 330 | |
| 347 | // TODO https://github.com/ziglang/zig/issues/265 | 331 | pub fn faccessat(dirfd: i32, path: [*:0]const u8, mode: u32, flags: u32) usize { |
| 348 | pub fn faccessat(dirfd: i32, path: [*]const u8, mode: u32, flags: u32) usize { | | |
| 349 | return syscall4(SYS_faccessat, @bitCast(usize, @as(isize, dirfd)), @ptrToInt(path), mode, flags); | 332 | return syscall4(SYS_faccessat, @bitCast(usize, @as(isize, dirfd)), @ptrToInt(path), mode, flags); |
| 350 | } | 333 | } |
| 351 | | 334 | |
| ... | @@ -371,8 +354,7 @@ pub fn pwrite(fd: i32, buf: [*]const u8, count: usize, offset: usize) usize { | ... | @@ -371,8 +354,7 @@ pub fn pwrite(fd: i32, buf: [*]const u8, count: usize, offset: usize) usize { |
| 371 | return syscall4(SYS_pwrite, @bitCast(usize, @as(isize, fd)), @ptrToInt(buf), count, offset); | 354 | return syscall4(SYS_pwrite, @bitCast(usize, @as(isize, fd)), @ptrToInt(buf), count, offset); |
| 372 | } | 355 | } |
| 373 | | 356 | |
| 374 | // TODO https://github.com/ziglang/zig/issues/265 | 357 | pub fn rename(old: [*:0]const u8, new: [*:0]const u8) usize { |
| 375 | pub fn rename(old: [*]const u8, new: [*]const u8) usize { | | |
| 376 | if (@hasDecl(@This(), "SYS_rename")) { | 358 | if (@hasDecl(@This(), "SYS_rename")) { |
| 377 | return syscall2(SYS_rename, @ptrToInt(old), @ptrToInt(new)); | 359 | return syscall2(SYS_rename, @ptrToInt(old), @ptrToInt(new)); |
| 378 | } else if (@hasDecl(@This(), "SYS_renameat")) { | 360 | } else if (@hasDecl(@This(), "SYS_renameat")) { |
| ... | @@ -403,8 +385,7 @@ pub fn renameat(oldfd: i32, oldpath: [*]const u8, newfd: i32, newpath: [*]const | ... | @@ -403,8 +385,7 @@ pub fn renameat(oldfd: i32, oldpath: [*]const u8, newfd: i32, newpath: [*]const |
| 403 | } | 385 | } |
| 404 | } | 386 | } |
| 405 | | 387 | |
| 406 | // TODO https://github.com/ziglang/zig/issues/265 | 388 | pub fn renameat2(oldfd: i32, oldpath: [*:0]const u8, newfd: i32, newpath: [*:0]const u8, flags: u32) usize { |
| 407 | pub fn renameat2(oldfd: i32, oldpath: [*]const u8, newfd: i32, newpath: [*]const u8, flags: u32) usize { | | |
| 408 | return syscall5( | 389 | return syscall5( |
| 409 | SYS_renameat2, | 390 | SYS_renameat2, |
| 410 | @bitCast(usize, @as(isize, oldfd)), | 391 | @bitCast(usize, @as(isize, oldfd)), |
| ... | @@ -415,8 +396,7 @@ pub fn renameat2(oldfd: i32, oldpath: [*]const u8, newfd: i32, newpath: [*]const | ... | @@ -415,8 +396,7 @@ pub fn renameat2(oldfd: i32, oldpath: [*]const u8, newfd: i32, newpath: [*]const |
| 415 | ); | 396 | ); |
| 416 | } | 397 | } |
| 417 | | 398 | |
| 418 | // TODO https://github.com/ziglang/zig/issues/265 | 399 | pub fn open(path: [*:0]const u8, flags: u32, perm: usize) usize { |
| 419 | pub fn open(path: [*]const u8, flags: u32, perm: usize) usize { | | |
| 420 | if (@hasDecl(@This(), "SYS_open")) { | 400 | if (@hasDecl(@This(), "SYS_open")) { |
| 421 | return syscall3(SYS_open, @ptrToInt(path), flags, perm); | 401 | return syscall3(SYS_open, @ptrToInt(path), flags, perm); |
| 422 | } else { | 402 | } else { |
| ... | @@ -430,13 +410,11 @@ pub fn open(path: [*]const u8, flags: u32, perm: usize) usize { | ... | @@ -430,13 +410,11 @@ pub fn open(path: [*]const u8, flags: u32, perm: usize) usize { |
| 430 | } | 410 | } |
| 431 | } | 411 | } |
| 432 | | 412 | |
| 433 | // TODO https://github.com/ziglang/zig/issues/265 | 413 | pub fn create(path: [*:0]const u8, perm: usize) usize { |
| 434 | pub fn create(path: [*]const u8, perm: usize) usize { | | |
| 435 | return syscall2(SYS_creat, @ptrToInt(path), perm); | 414 | return syscall2(SYS_creat, @ptrToInt(path), perm); |
| 436 | } | 415 | } |
| 437 | | 416 | |
| 438 | // TODO https://github.com/ziglang/zig/issues/265 | 417 | pub fn openat(dirfd: i32, path: [*:0]const u8, flags: u32, mode: usize) usize { |
| 439 | pub fn openat(dirfd: i32, path: [*]const u8, flags: u32, mode: usize) usize { | | |
| 440 | // dirfd could be negative, for example AT_FDCWD is -100 | 418 | // dirfd could be negative, for example AT_FDCWD is -100 |
| 441 | return syscall4(SYS_openat, @bitCast(usize, @as(isize, dirfd)), @ptrToInt(path), flags, mode); | 419 | return syscall4(SYS_openat, @bitCast(usize, @as(isize, dirfd)), @ptrToInt(path), flags, mode); |
| 442 | } | 420 | } |
| ... | @@ -490,8 +468,7 @@ pub fn kill(pid: i32, sig: i32) usize { | ... | @@ -490,8 +468,7 @@ pub fn kill(pid: i32, sig: i32) usize { |
| 490 | return syscall2(SYS_kill, @bitCast(usize, @as(isize, pid)), @bitCast(usize, @as(isize, sig))); | 468 | return syscall2(SYS_kill, @bitCast(usize, @as(isize, pid)), @bitCast(usize, @as(isize, sig))); |
| 491 | } | 469 | } |
| 492 | | 470 | |
| 493 | // TODO https://github.com/ziglang/zig/issues/265 | 471 | pub fn unlink(path: [*:0]const u8) usize { |
| 494 | pub fn unlink(path: [*]const u8) usize { | | |
| 495 | if (@hasDecl(@This(), "SYS_unlink")) { | 472 | if (@hasDecl(@This(), "SYS_unlink")) { |
| 496 | return syscall1(SYS_unlink, @ptrToInt(path)); | 473 | return syscall1(SYS_unlink, @ptrToInt(path)); |
| 497 | } else { | 474 | } else { |
| ... | @@ -499,8 +476,7 @@ pub fn unlink(path: [*]const u8) usize { | ... | @@ -499,8 +476,7 @@ pub fn unlink(path: [*]const u8) usize { |
| 499 | } | 476 | } |
| 500 | } | 477 | } |
| 501 | | 478 | |
| 502 | // TODO https://github.com/ziglang/zig/issues/265 | 479 | pub fn unlinkat(dirfd: i32, path: [*:0]const u8, flags: u32) usize { |
| 503 | pub fn unlinkat(dirfd: i32, path: [*]const u8, flags: u32) usize { | | |
| 504 | return syscall3(SYS_unlinkat, @bitCast(usize, @as(isize, dirfd)), @ptrToInt(path), flags); | 480 | return syscall3(SYS_unlinkat, @bitCast(usize, @as(isize, dirfd)), @ptrToInt(path), flags); |
| 505 | } | 481 | } |
| 506 | | 482 | |
| ... | @@ -903,8 +879,7 @@ pub fn fstat(fd: i32, stat_buf: *Stat) usize { | ... | @@ -903,8 +879,7 @@ pub fn fstat(fd: i32, stat_buf: *Stat) usize { |
| 903 | } | 879 | } |
| 904 | } | 880 | } |
| 905 | | 881 | |
| 906 | // TODO https://github.com/ziglang/zig/issues/265 | 882 | pub fn stat(pathname: [*:0]const u8, statbuf: *Stat) usize { |
| 907 | pub fn stat(pathname: [*]const u8, statbuf: *Stat) usize { | | |
| 908 | if (@hasDecl(@This(), "SYS_stat64")) { | 883 | if (@hasDecl(@This(), "SYS_stat64")) { |
| 909 | return syscall2(SYS_stat64, @ptrToInt(pathname), @ptrToInt(statbuf)); | 884 | return syscall2(SYS_stat64, @ptrToInt(pathname), @ptrToInt(statbuf)); |
| 910 | } else { | 885 | } else { |
| ... | @@ -912,8 +887,7 @@ pub fn stat(pathname: [*]const u8, statbuf: *Stat) usize { | ... | @@ -912,8 +887,7 @@ pub fn stat(pathname: [*]const u8, statbuf: *Stat) usize { |
| 912 | } | 887 | } |
| 913 | } | 888 | } |
| 914 | | 889 | |
| 915 | // TODO https://github.com/ziglang/zig/issues/265 | 890 | pub fn lstat(pathname: [*:0]const u8, statbuf: *Stat) usize { |
| 916 | pub fn lstat(pathname: [*]const u8, statbuf: *Stat) usize { | | |
| 917 | if (@hasDecl(@This(), "SYS_lstat64")) { | 891 | if (@hasDecl(@This(), "SYS_lstat64")) { |
| 918 | return syscall2(SYS_lstat64, @ptrToInt(pathname), @ptrToInt(statbuf)); | 892 | return syscall2(SYS_lstat64, @ptrToInt(pathname), @ptrToInt(statbuf)); |
| 919 | } else { | 893 | } else { |
| ... | @@ -921,8 +895,7 @@ pub fn lstat(pathname: [*]const u8, statbuf: *Stat) usize { | ... | @@ -921,8 +895,7 @@ pub fn lstat(pathname: [*]const u8, statbuf: *Stat) usize { |
| 921 | } | 895 | } |
| 922 | } | 896 | } |
| 923 | | 897 | |
| 924 | // TODO https://github.com/ziglang/zig/issues/265 | 898 | pub fn fstatat(dirfd: i32, path: [*:0]const u8, stat_buf: *Stat, flags: u32) usize { |
| 925 | pub fn fstatat(dirfd: i32, path: [*]const u8, stat_buf: *Stat, flags: u32) usize { | | |
| 926 | if (@hasDecl(@This(), "SYS_fstatat64")) { | 899 | if (@hasDecl(@This(), "SYS_fstatat64")) { |
| 927 | return syscall4(SYS_fstatat64, @bitCast(usize, @as(isize, dirfd)), @ptrToInt(path), @ptrToInt(stat_buf), flags); | 900 | return syscall4(SYS_fstatat64, @bitCast(usize, @as(isize, dirfd)), @ptrToInt(path), @ptrToInt(stat_buf), flags); |
| 928 | } else { | 901 | } else { |
| ... | @@ -944,13 +917,11 @@ pub fn statx(dirfd: i32, path: [*]const u8, flags: u32, mask: u32, statx_buf: *S | ... | @@ -944,13 +917,11 @@ pub fn statx(dirfd: i32, path: [*]const u8, flags: u32, mask: u32, statx_buf: *S |
| 944 | return @bitCast(usize, @as(isize, -ENOSYS)); | 917 | return @bitCast(usize, @as(isize, -ENOSYS)); |
| 945 | } | 918 | } |
| 946 | | 919 | |
| 947 | // TODO https://github.com/ziglang/zig/issues/265 | 920 | pub fn listxattr(path: [*:0]const u8, list: [*]u8, size: usize) usize { |
| 948 | pub fn listxattr(path: [*]const u8, list: [*]u8, size: usize) usize { | | |
| 949 | return syscall3(SYS_listxattr, @ptrToInt(path), @ptrToInt(list), size); | 921 | return syscall3(SYS_listxattr, @ptrToInt(path), @ptrToInt(list), size); |
| 950 | } | 922 | } |
| 951 | | 923 | |
| 952 | // TODO https://github.com/ziglang/zig/issues/265 | 924 | pub fn llistxattr(path: [*:0]const u8, list: [*]u8, size: usize) usize { |
| 953 | pub fn llistxattr(path: [*]const u8, list: [*]u8, size: usize) usize { | | |
| 954 | return syscall3(SYS_llistxattr, @ptrToInt(path), @ptrToInt(list), size); | 925 | return syscall3(SYS_llistxattr, @ptrToInt(path), @ptrToInt(list), size); |
| 955 | } | 926 | } |
| 956 | | 927 | |
| ... | @@ -958,48 +929,39 @@ pub fn flistxattr(fd: usize, list: [*]u8, size: usize) usize { | ... | @@ -958,48 +929,39 @@ pub fn flistxattr(fd: usize, list: [*]u8, size: usize) usize { |
| 958 | return syscall3(SYS_flistxattr, fd, @ptrToInt(list), size); | 929 | return syscall3(SYS_flistxattr, fd, @ptrToInt(list), size); |
| 959 | } | 930 | } |
| 960 | | 931 | |
| 961 | // TODO https://github.com/ziglang/zig/issues/265 | 932 | pub fn getxattr(path: [*:0]const u8, name: [*:0]const u8, value: [*]u8, size: usize) usize { |
| 962 | pub fn getxattr(path: [*]const u8, name: [*]const u8, value: [*]u8, size: usize) usize { | | |
| 963 | return syscall4(SYS_getxattr, @ptrToInt(path), @ptrToInt(name), @ptrToInt(value), size); | 933 | return syscall4(SYS_getxattr, @ptrToInt(path), @ptrToInt(name), @ptrToInt(value), size); |
| 964 | } | 934 | } |
| 965 | | 935 | |
| 966 | // TODO https://github.com/ziglang/zig/issues/265 | 936 | pub fn lgetxattr(path: [*:0]const u8, name: [*:0]const u8, value: [*]u8, size: usize) usize { |
| 967 | pub fn lgetxattr(path: [*]const u8, name: [*]const u8, value: [*]u8, size: usize) usize { | | |
| 968 | return syscall4(SYS_lgetxattr, @ptrToInt(path), @ptrToInt(name), @ptrToInt(value), size); | 937 | return syscall4(SYS_lgetxattr, @ptrToInt(path), @ptrToInt(name), @ptrToInt(value), size); |
| 969 | } | 938 | } |
| 970 | | 939 | |
| 971 | // TODO https://github.com/ziglang/zig/issues/265 | 940 | pub fn fgetxattr(fd: usize, name: [*:0]const u8, value: [*]u8, size: usize) usize { |
| 972 | pub fn fgetxattr(fd: usize, name: [*]const u8, value: [*]u8, size: usize) usize { | | |
| 973 | return syscall4(SYS_lgetxattr, fd, @ptrToInt(name), @ptrToInt(value), size); | 941 | return syscall4(SYS_lgetxattr, fd, @ptrToInt(name), @ptrToInt(value), size); |
| 974 | } | 942 | } |
| 975 | | 943 | |
| 976 | // TODO https://github.com/ziglang/zig/issues/265 | 944 | pub fn setxattr(path: [*:0]const u8, name: [*:0]const u8, value: *const void, size: usize, flags: usize) usize { |
| 977 | pub fn setxattr(path: [*]const u8, name: [*]const u8, value: *const void, size: usize, flags: usize) usize { | | |
| 978 | return syscall5(SYS_setxattr, @ptrToInt(path), @ptrToInt(name), @ptrToInt(value), size, flags); | 945 | return syscall5(SYS_setxattr, @ptrToInt(path), @ptrToInt(name), @ptrToInt(value), size, flags); |
| 979 | } | 946 | } |
| 980 | | 947 | |
| 981 | // TODO https://github.com/ziglang/zig/issues/265 | 948 | pub fn lsetxattr(path: [*:0]const u8, name: [*:0]const u8, value: *const void, size: usize, flags: usize) usize { |
| 982 | pub fn lsetxattr(path: [*]const u8, name: [*]const u8, value: *const void, size: usize, flags: usize) usize { | | |
| 983 | return syscall5(SYS_lsetxattr, @ptrToInt(path), @ptrToInt(name), @ptrToInt(value), size, flags); | 949 | return syscall5(SYS_lsetxattr, @ptrToInt(path), @ptrToInt(name), @ptrToInt(value), size, flags); |
| 984 | } | 950 | } |
| 985 | | 951 | |
| 986 | // TODO https://github.com/ziglang/zig/issues/265 | 952 | pub fn fsetxattr(fd: usize, name: [*:0]const u8, value: *const void, size: usize, flags: usize) usize { |
| 987 | pub fn fsetxattr(fd: usize, name: [*]const u8, value: *const void, size: usize, flags: usize) usize { | | |
| 988 | return syscall5(SYS_fsetxattr, fd, @ptrToInt(name), @ptrToInt(value), size, flags); | 953 | return syscall5(SYS_fsetxattr, fd, @ptrToInt(name), @ptrToInt(value), size, flags); |
| 989 | } | 954 | } |
| 990 | | 955 | |
| 991 | // TODO https://github.com/ziglang/zig/issues/265 | 956 | pub fn removexattr(path: [*:0]const u8, name: [*:0]const u8) usize { |
| 992 | pub fn removexattr(path: [*]const u8, name: [*]const u8) usize { | | |
| 993 | return syscall2(SYS_removexattr, @ptrToInt(path), @ptrToInt(name)); | 957 | return syscall2(SYS_removexattr, @ptrToInt(path), @ptrToInt(name)); |
| 994 | } | 958 | } |
| 995 | | 959 | |
| 996 | // TODO https://github.com/ziglang/zig/issues/265 | 960 | pub fn lremovexattr(path: [*:0]const u8, name: [*:0]const u8) usize { |
| 997 | pub fn lremovexattr(path: [*]const u8, name: [*]const u8) usize { | | |
| 998 | return syscall2(SYS_lremovexattr, @ptrToInt(path), @ptrToInt(name)); | 961 | return syscall2(SYS_lremovexattr, @ptrToInt(path), @ptrToInt(name)); |
| 999 | } | 962 | } |
| 1000 | | 963 | |
| 1001 | // TODO https://github.com/ziglang/zig/issues/265 | 964 | pub fn fremovexattr(fd: usize, name: [*:0]const u8) usize { |
| 1002 | pub fn fremovexattr(fd: usize, name: [*]const u8) usize { | | |
| 1003 | return syscall2(SYS_fremovexattr, fd, @ptrToInt(name)); | 965 | return syscall2(SYS_fremovexattr, fd, @ptrToInt(name)); |
| 1004 | } | 966 | } |
| 1005 | | 967 | |