From cb182432b08d13a343d1db5f4ee06c9c90430779 Mon Sep 17 00:00:00 2001 From: cryptocode Date: Fri, 28 Jun 2024 17:56:35 +0200 Subject: [PATCH] [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]() 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. --- lib/std/c/freebsd.zig | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/std/c/freebsd.zig b/lib/std/c/freebsd.zig index a60f5de525ee6946176ba48d1027fad73c879954..ef4758030745c7b4c339d97808096fcae72ea731 100644 --- a/lib/std/c/freebsd.zig +++ b/lib/std/c/freebsd.zig @@ -1870,3 +1870,5 @@ pub const MFD = struct { pub extern "c" fn memfd_create(name: [*:0]const u8, flags: c_uint) c_int; pub 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; +pub extern "c" fn eventfd(initval: c_uint, flags: c_uint) c_int; +pub extern "c" fn dup3(old: c_int, new: c_int, flags: c_uint) c_int; -- 2.54.0