authorgravatar for devnexen@gmail.comDavid Carlier <devnexen@gmail.com> 2023-05-14 17:40:27+01:00
committergravatar for git@vexu.euVeikka Tuominen <git@vexu.eu> 2023-05-15 03:10:34+03:00
log2952fb97588fa2eb711bf84b479e959b60542192
tree0e3ec28fff566cd947b6f39b58bf7e365d0a85ac
parent2ce9122a009efa0a5d2857a0d29ad3d77a81dff1

std.c: add rfork for freebsd


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

lib/std/c/freebsd.zig+38
......@@ -2666,3 +2666,41 @@ pub fn IOW(op: u8, nr: u8, comptime IT: type) u32 {
26662666pub fn IOWR(op: u8, nr: u8, comptime IT: type) u32 {
26672667 return ioImpl(ioctl_cmd.INOUT, op, nr, @sizeOf(IT));
26682668}
2669
2670pub const RF = struct {
2671 pub const NAMEG = 1 << 0;
2672 pub const ENVG = 1 << 1;
2673 /// copy file descriptors table
2674 pub const FDG = 1 << 2;
2675 pub const NOTEG = 1 << 3;
2676 /// creates a new process
2677 pub const PROC = 1 << 4;
2678 /// shares address space
2679 pub const MEM = 1 << 5;
2680 /// detaches the child
2681 pub const NOWAIT = 1 << 6;
2682 pub const CNAMEG = 1 << 10;
2683 pub const CENVG = 1 << 11;
2684 /// distinct file descriptor table
2685 pub const CFDG = 1 << 12;
2686 /// thread support
2687 pub const THREAD = 1 << 13;
2688 /// shares signal handlers
2689 pub const SIGSHARE = 1 << 14;
2690 /// emits SIGUSR1 on exit
2691 pub const LINUXTHPN = 1 << 16;
2692 /// child in stopped state
2693 pub const STOPPED = 1 << 17;
2694 /// use high pid id
2695 pub const HIGHPID = 1 << 18;
2696 /// selects signal flag for parent notification
2697 pub const SIGSZMB = 1 << 19;
2698 pub fn SIGNUM(f: u32) u32 {
2699 return f >> 20;
2700 }
2701 pub fn SIGFLAGS(f: u32) u32 {
2702 return f << 20;
2703 }
2704};
2705
2706pub extern "c" fn rfork(flags: c_int) c_int;