authorgravatar for greg@unrelenting.technologyGreg V <greg@unrelenting.technology> 2018-12-20 23:55:44+03:00
committergravatar for greg@unrelenting.technologyGreg V <greg@unrelenting.technology> 2018-12-20 23:55:44+03:00
log76efc462e7ea90be02fd28254f8c452ba994ea8a
treeb2e4f137b03592c11e7d3a81f351607d54b2ae80
parent054c7ab18a8c9527414164bf68aa3564c29e8931

Add preadv/pwritev on FreeBSD


2 files changed, 4 insertions(+), 2 deletions(-)

std/c/freebsd.zig+2
...@@ -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
15pub extern "c" fn sysctlnametomib(name: [*]const u8, mibp: ?*c_int, sizep: ?*usize) c_int;15pub extern "c" fn sysctlnametomib(name: [*]const u8, mibp: ?*c_int, sizep: ?*usize) c_int;
16pub extern "c" fn getdirentries(fd: c_int, buf_ptr: [*]u8, nbytes: usize, basep: *i64) usize;16pub extern "c" fn getdirentries(fd: c_int, buf_ptr: [*]u8, nbytes: usize, basep: *i64) usize;
17pub extern "c" fn pipe2(arg0: *[2]c_int, arg1: u32) c_int;17pub extern "c" fn pipe2(arg0: *[2]c_int, arg1: u32) c_int;
18pub extern "c" fn preadv(fd: c_int, iov: *const c_void, iovcnt: c_int, offset: usize) isize;
19pub extern "c" fn pwritev(fd: c_int, iov: *const c_void, iovcnt: c_int, offset: usize) isize;
1820
19/// Renamed from `kevent` to `Kevent` to avoid conflict with function name.21/// Renamed from `kevent` to `Kevent` to avoid conflict with function name.
20pub const Kevent = extern struct {22pub const Kevent = extern struct {
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}
627627
628pub fn preadv(fd: i32, iov: [*]const iovec, count: usize, offset: usize) usize {628pub 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}
631631
632pub fn pipe(fd: *[2]i32) usize {632pub 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}
648648
649pub fn pwritev(fd: i32, iov: [*]const iovec_const, count: usize, offset: usize) usize {649pub 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}
652652
653pub fn rename(old: [*]const u8, new: [*]const u8) usize {653pub fn rename(old: [*]const u8, new: [*]const u8) usize {