| author | |
| committer | |
| log | ac1b2a3c7319b099211acdca91c644a8533d0970 |
| tree | b2e4f137b03592c11e7d3a81f351607d54b2ae80 |
| parent | e5b4748101ca40f5dc4082ce2cb46df0c8607417 |
| parent | 76efc462e7ea90be02fd28254f8c452ba994ea8a |
| signature | Signed by PGP key 4AEE18F83AFDEB23 |
Fix dirent/stat, add preadv2 files changed, 15 insertions(+), 8 deletions(-)
std/c/freebsd.zig+13-6| ... | @@ -15,6 +15,8 @@ pub extern "c" fn sysctlbyname(name: [*]const u8, oldp: ?*c_void, oldlenp: ?*usi | ... | @@ -15,6 +15,8 @@ pub extern "c" fn sysctlbyname(name: [*]const u8, oldp: ?*c_void, oldlenp: ?*usi |
| 15 | pub extern "c" fn sysctlnametomib(name: [*]const u8, mibp: ?*c_int, sizep: ?*usize) c_int; | 15 | pub extern "c" fn sysctlnametomib(name: [*]const u8, mibp: ?*c_int, sizep: ?*usize) c_int; |
| 16 | pub extern "c" fn getdirentries(fd: c_int, buf_ptr: [*]u8, nbytes: usize, basep: *i64) usize; | 16 | pub extern "c" fn getdirentries(fd: c_int, buf_ptr: [*]u8, nbytes: usize, basep: *i64) usize; |
| 17 | pub extern "c" fn pipe2(arg0: *[2]c_int, arg1: u32) c_int; | 17 | pub extern "c" fn pipe2(arg0: *[2]c_int, arg1: u32) c_int; |
| 18 | pub extern "c" fn preadv(fd: c_int, iov: *const c_void, iovcnt: c_int, offset: usize) isize; | ||
| 19 | pub extern "c" fn pwritev(fd: c_int, iov: *const c_void, iovcnt: c_int, offset: usize) isize; | ||
| 18 | 20 | ||
| 19 | /// Renamed from `kevent` to `Kevent` to avoid conflict with function name. | 21 | /// Renamed from `kevent` to `Kevent` to avoid conflict with function name. |
| 20 | pub const Kevent = extern struct { | 22 | pub const Kevent = extern struct { |
| ... | @@ -50,18 +52,23 @@ pub const Stat = extern struct { | ... | @@ -50,18 +52,23 @@ pub const Stat = extern struct { |
| 50 | nlink: usize, | 52 | nlink: usize, |
| 51 | 53 | ||
| 52 | mode: u32, | 54 | mode: u32, |
| 55 | __pad0: u16, | ||
| 53 | uid: u32, | 56 | uid: u32, |
| 54 | gid: u32, | 57 | gid: u32, |
| 55 | __pad0: u32, | 58 | __pad1: u32, |
| 56 | rdev: u64, | 59 | rdev: u64, |
| 57 | size: i64, | ||
| 58 | blksize: isize, | ||
| 59 | blocks: i64, | ||
| 60 | 60 | ||
| 61 | atim: timespec, | 61 | atim: timespec, |
| 62 | mtim: timespec, | 62 | mtim: timespec, |
| 63 | ctim: timespec, | 63 | ctim: timespec, |
| 64 | __unused: [3]isize, | 64 | birthtim: timespec, |
| 65 | |||
| 66 | size: i64, | ||
| 67 | blocks: i64, | ||
| 68 | blksize: isize, | ||
| 69 | flags: u32, | ||
| 70 | gen: u64, | ||
| 71 | __spare: [10]u64, | ||
| 65 | }; | 72 | }; |
| 66 | 73 | ||
| 67 | pub const timespec = extern struct { | 74 | pub const timespec = extern struct { |
| ... | @@ -72,7 +79,7 @@ pub const timespec = extern struct { | ... | @@ -72,7 +79,7 @@ pub const timespec = extern struct { |
| 72 | pub const dirent = extern struct { | 79 | pub const dirent = extern struct { |
| 73 | d_fileno: usize, | 80 | d_fileno: usize, |
| 74 | d_off: i64, | 81 | d_off: i64, |
| 75 | d_reclen: u64, | 82 | d_reclen: u16, |
| 76 | d_type: u8, | 83 | d_type: u8, |
| 77 | d_pad0: u8, | 84 | d_pad0: u8, |
| 78 | d_namlen: u16, | 85 | d_namlen: u16, |
std/os/freebsd/index.zig+2-2| ... | @@ -626,7 +626,7 @@ pub fn pread(fd: i32, buf: [*]u8, nbyte: usize, offset: u64) usize { | ... | @@ -626,7 +626,7 @@ pub fn pread(fd: i32, buf: [*]u8, nbyte: usize, offset: u64) usize { |
| 626 | } | 626 | } |
| 627 | 627 | ||
| 628 | pub fn preadv(fd: i32, iov: [*]const iovec, count: usize, offset: usize) usize { | 628 | pub fn preadv(fd: i32, iov: [*]const iovec, count: usize, offset: usize) usize { |
| 629 | return arch.syscall4(SYS_preadv, @bitCast(usize, isize(fd)), @ptrToInt(iov), count, offset); | 629 | return errnoWrap(c.preadv(fd, @ptrCast(*const c_void, iov), @intCast(c_int, count), offset)); |
| 630 | } | 630 | } |
| 631 | 631 | ||
| 632 | pub fn pipe(fd: *[2]i32) usize { | 632 | pub fn pipe(fd: *[2]i32) usize { |
| ... | @@ -647,7 +647,7 @@ pub fn pwrite(fd: i32, buf: [*]const u8, nbyte: usize, offset: u64) usize { | ... | @@ -647,7 +647,7 @@ pub fn pwrite(fd: i32, buf: [*]const u8, nbyte: usize, offset: u64) usize { |
| 647 | } | 647 | } |
| 648 | 648 | ||
| 649 | pub fn pwritev(fd: i32, iov: [*]const iovec_const, count: usize, offset: usize) usize { | 649 | pub fn pwritev(fd: i32, iov: [*]const iovec_const, count: usize, offset: usize) usize { |
| 650 | return arch.syscall4(SYS_pwritev, @bitCast(usize, isize(fd)), @ptrToInt(iov), count, offset); | 650 | return errnoWrap(c.pwritev(fd, @ptrCast(*const c_void, iov), @intCast(c_int, count), offset)); |
| 651 | } | 651 | } |
| 652 | 652 | ||
| 653 | pub fn rename(old: [*]const u8, new: [*]const u8) usize { | 653 | pub fn rename(old: [*]const u8, new: [*]const u8) usize { |