authorgravatar for cryptocode@zolo.iocryptocode <cryptocode@zolo.io> 2024-06-28 17:56:35+02:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2024-07-03 05:27:21-04:00
logcb182432b08d13a343d1db5f4ee06c9c90430779
treee9757c39bf32da7a23684c40c0410c8ccde05d81
parenta31fe8aa3ed4868fb10000c1e3eeaa094488fc94

[std.c] Add eventfd and dup3 functions to FreeBSD

The eventfd system call and dup3 library call have been available since FreeBSD 13 and 10 respectively, and are thus available in all [FreeBSD releases not deemed EOL](<https://endoflife.date/freebsd>) The lack of these were discovered when porting a terminal emulator to FreeBSD. It would be nice to have them included in Zig's stdlib.

1 files changed, 2 insertions(+), 0 deletions(-)

lib/std/c/freebsd.zig+2
......@@ -1870,3 +1870,5 @@ pub const MFD = struct {
18701870
18711871pub extern "c" fn memfd_create(name: [*:0]const u8, flags: c_uint) c_int;
18721872pub extern "c" fn copy_file_range(fd_in: fd_t, off_in: ?*off_t, fd_out: fd_t, off_out: ?*off_t, len: usize, flags: u32) usize;
1873pub extern "c" fn eventfd(initval: c_uint, flags: c_uint) c_int;
1874pub extern "c" fn dup3(old: c_int, new: c_int, flags: c_uint) c_int;