commit 2952fb97588fa2eb711bf84b479e959b60542192 (tree)
parent 2ce9122a009efa0a5d2857a0d29ad3d77a81dff1
Author: David CARLIER <devnexen@gmail.com>
Date: Sun, 14 May 2023 17:40:27 +0100
std.c: add rfork for freebsd
Diffstat:
1 file changed, 38 insertions(+), 0 deletions(-)
diff --git a/lib/std/c/freebsd.zig b/lib/std/c/freebsd.zig
@@ -2666,3 +2666,41 @@ pub fn IOW(op: u8, nr: u8, comptime IT: type) u32 {
pub fn IOWR(op: u8, nr: u8, comptime IT: type) u32 {
return ioImpl(ioctl_cmd.INOUT, op, nr, @sizeOf(IT));
}
+
+pub const RF = struct {
+ pub const NAMEG = 1 << 0;
+ pub const ENVG = 1 << 1;
+ /// copy file descriptors table
+ pub const FDG = 1 << 2;
+ pub const NOTEG = 1 << 3;
+ /// creates a new process
+ pub const PROC = 1 << 4;
+ /// shares address space
+ pub const MEM = 1 << 5;
+ /// detaches the child
+ pub const NOWAIT = 1 << 6;
+ pub const CNAMEG = 1 << 10;
+ pub const CENVG = 1 << 11;
+ /// distinct file descriptor table
+ pub const CFDG = 1 << 12;
+ /// thread support
+ pub const THREAD = 1 << 13;
+ /// shares signal handlers
+ pub const SIGSHARE = 1 << 14;
+ /// emits SIGUSR1 on exit
+ pub const LINUXTHPN = 1 << 16;
+ /// child in stopped state
+ pub const STOPPED = 1 << 17;
+ /// use high pid id
+ pub const HIGHPID = 1 << 18;
+ /// selects signal flag for parent notification
+ pub const SIGSZMB = 1 << 19;
+ pub fn SIGNUM(f: u32) u32 {
+ return f >> 20;
+ }
+ pub fn SIGFLAGS(f: u32) u32 {
+ return f << 20;
+ }
+};
+
+pub extern "c" fn rfork(flags: c_int) c_int;