[Glibc-bsd-commits] r3584 - trunk/kfreebsd-9/debian/patches
Robert Millan
rmh at alioth.debian.org
Wed Jul 13 17:38:12 UTC 2011
Author: rmh
Date: 2011-07-13 17:38:11 +0000 (Wed, 13 Jul 2011)
New Revision: 3584
Modified:
trunk/kfreebsd-9/debian/patches/007_clone_signals.diff
Log:
Fix 007_clone_signals.diff following indications by Petr
Modified: trunk/kfreebsd-9/debian/patches/007_clone_signals.diff
===================================================================
--- trunk/kfreebsd-9/debian/patches/007_clone_signals.diff 2011-07-13 17:07:06 UTC (rev 3583)
+++ trunk/kfreebsd-9/debian/patches/007_clone_signals.diff 2011-07-13 17:38:11 UTC (rev 3584)
@@ -13,7 +13,7 @@
- p2->p_sigparent = SIGUSR1;
+ {
+ int sig;
-+ sig = (flags >> 24) & 0x7F;
++ sig = RFTHPNSIGNUM(flags);
+ if (sig == 0) sig = SIGUSR1;
+ if (sig == SIGCHLD) sig = 0;
+ p2->p_sigparent = sig;
@@ -21,3 +21,38 @@
else
p2->p_sigparent = SIGCHLD;
+@@ -723,12 +729,16 @@
+ static struct timeval lastfail;
+
+ /* Check for the undefined or unimplemented flags. */
+- if ((flags & ~(RFFLAGS | RFTSIGFLAGS(RFTSIGMASK))) != 0)
++ if ((flags & ~(RFFLAGS | RFTSIGFLAGS(RFTSIGMASK) | (RFTHPNMASK << RFTHPNSHIFT))) != 0)
+ return (EINVAL);
+
+- /* Signal value requires RFTSIGZMB. */
+- if ((flags & RFTSIGFLAGS(RFTSIGMASK)) != 0 && (flags & RFTSIGZMB) == 0)
+- return (EINVAL);
++ /* Signal value requires either RFTSIGZMB or RFLINUXTHPN. */
++ if ((flags & RFTSIGZMB) == 0 && (flags & RFLINUXTHPN) == 0) {
++ if ((flags & RFTSIGFLAGS(RFTSIGMASK)) != 0)
++ return (EINVAL);
++ if ((flags & (RFTHPNMASK << RFTHPNSHIFT)) != 0)
++ return (EINVAL);
++ }
+
+ /* Can't copy and clear. */
+ if ((flags & (RFFDG|RFCFDG)) == (RFFDG|RFCFDG))
+--- a/sys/sys/unistd.h
++++ b/sys/sys/unistd.h
+@@ -191,6 +191,11 @@
+ RFTHREAD | RFSIGSHARE | RFLINUXTHPN | RFSTOPPED | RFHIGHPID | RFTSIGZMB | \
+ RFPPWAIT)
+
++#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)
++
+ #endif /* __BSD_VISIBLE */
+
+ #endif /* !_SYS_UNISTD_H_ */
More information about the Glibc-bsd-commits
mailing list