[PATCH] Improve LinuxThreads compatibility in rfork()

Kostik Belousov kostikbel at gmail.com
Mon Jul 11 17:24:18 UTC 2011


On Mon, Jul 11, 2011 at 06:12:15PM +0200, Petr Salinger wrote:
> >I would instead use a new flag to specify a signal sent on the child
> >death. Like RFTSIGZMB. If flag is not set, SIGCHLD is used. If it is
> >set, the bit slice is used as signal number, 0 means do not send any
> >signal.
> >
> >Please note that the signal should be checked for validity, it must be
> ><= _SIG_MAXSIG).
> 
> We used this:
> 
> #define RFTHPNSHIFT    24      /* reserve bits 24-30 */
> #define RFTHPNMASK     0x7F    /* for compatibility with 
> linuxthreads/clone()   */
>                                /* allow to specify  "clone exit parent 
>                                notification" signal */
> #define RFTHPNSIGNUM(flags)    (((flags) >> RFTHPNSHIFT) & RFTHPNMASK)
> 
> Therefore signal #128 (_SIG_MAXSIG) cannot be selected.
> 
> Should the bit slice be 7 or 8 bits ?

I propose to go 8 bits, and add the check to be future-proof.

It seems that we already parse GNU/kFreeBSD brandnote. I think this
could be used to distinguish between old behaviour, that is currently
used by your libc, and proposed new interface, if __FreeBSD_version
is bumped and honored by glibc. You might need to store the brandinfo
somewhere in struct proc or use the separate struct sysentvec.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 196 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/freebsd-hackers/attachments/20110711/c0707f8b/attachment.pgp


More information about the freebsd-hackers mailing list