--- a/sys/kern/kern_fork.c +++ b/sys/kern/kern_fork.c @@ -476,7 +476,10 @@ sigacts_copy(newsigacts, p1->p_sigacts); p2->p_sigacts = newsigacts; } - if (flags & RFLINUXTHPN) + + if (flags & RFTSIGZMB) + p2->p_sigparent = RFTSIGNUM(flags); + else if (flags & RFLINUXTHPN) p2->p_sigparent = SIGUSR1; else p2->p_sigparent = SIGCHLD; @@ -723,6 +726,9 @@ if ((flags & (RFFDG|RFCFDG)) == (RFFDG|RFCFDG)) return (EINVAL); + if ((flags & RFTSIGZMB) && (RFTSIGNUM(flags) > _SIG_MAXSIG)) + return (EINVAL); + p1 = td->td_proc; /* --- a/sys/sys/unistd.h +++ b/sys/sys/unistd.h @@ -180,6 +180,11 @@ #define RFLINUXTHPN (1<<16) /* do linux clone exit parent notification */ #define RFSTOPPED (1<<17) /* leave child in a stopped state */ #define RFHIGHPID (1<<18) /* use a pid higher than 10 (idleproc) */ +#define RFTSIGZMB (1<<19) /* select signal for exit parent notification */ +#define RFTSIGSHIFT 20 /* selected signal number is in bits 20-27 */ +#define RFTSIGMASK 0xFF +#define RFTSIGNUM(flags) (((flags) >> RFTSIGSHIFT) & RFTSIGMASK) +#define RFTSIGFLAGS(signum) ((signum) << RFTSIGSHIFT) #define RFPPWAIT (1<<31) /* parent sleeps until child exits (vfork) */ #define RFKERNELONLY (RFSTOPPED | RFHIGHPID | RFPPWAIT)