[Glibc-bsd-commits] r4775 - trunk/glibc-ports

Petr Salinger ps-guest at alioth.debian.org
Fri Jul 19 20:16:50 UTC 2013


Author: ps-guest
Date: 2013-07-19 20:16:50 +0000 (Fri, 19 Jul 2013)
New Revision: 4775

Added:
   trunk/glibc-ports/218_waitid.c
   trunk/glibc-ports/218_waitid_common.diff
   trunk/glibc-ports/218_waitid_kbsd.diff
Log:
bits for 2.19


Added: trunk/glibc-ports/218_waitid.c
===================================================================
--- trunk/glibc-ports/218_waitid.c	                        (rev 0)
+++ trunk/glibc-ports/218_waitid.c	2013-07-19 20:16:50 UTC (rev 4775)
@@ -0,0 +1,64 @@
+/* 
+   Copyright (C) 2004-2012 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, see
+   <http://www.gnu.org/licenses/>.  */
+
+#include <shlib-compat.h>
+#include <stddef.h>
+#include <errno.h>
+#include <sys/wait.h>
+#include <sysdep.h>
+
+/* for now only the wrapper implementation */
+/* later on we will try to use wait6 when available */
+
+#define waitid __unused_waitid_alias
+#include <sysdeps/posix/waitid.c>
+#undef waitid
+
+versioned_symbol (libc, __waitid, waitid, GLIBC_2_18);
+
+#if SHLIB_COMPAT (libc, GLIBC_2_1, GLIBC_2_18)
+
+/* it used to be: */
+
+#define OLD_P_ALL	0
+#define OLD_P_PID	1
+#define OLD_P_PGID	2
+
+int
+__waitid_old (idtype_t oldtype, id_t id, siginfo_t *infop, int options)
+{
+  idtype_t newtype;
+
+  switch (oldtype)
+  {
+      case OLD_P_ALL:
+          newtype = P_ALL;
+      break;
+      case OLD_P_PID:
+          newtype = P_PID;
+      break;
+      case OLD_P_PGID:
+          newtype = P_PGID;
+      break;
+      default:
+          newtype = oldtype;
+   }
+  return __waitid(newtype, id, infop, options);
+}
+compat_symbol (libc, __waitid_old, waitid, GLIBC_2_1);
+#endif

Added: trunk/glibc-ports/218_waitid_common.diff
===================================================================
--- trunk/glibc-ports/218_waitid_common.diff	                        (rev 0)
+++ trunk/glibc-ports/218_waitid_common.diff	2013-07-19 20:16:50 UTC (rev 4775)
@@ -0,0 +1,70 @@
+
+
+http://sourceware.org/bugzilla/show_bug.cgi?id=15544
+
+
+
+diff --git a/bits/waitflags.h b/bits/waitflags.h
+index 59215f6..73fd714 100644
+--- a/bits/waitflags.h
++++ b/bits/waitflags.h
+@@ -24,3 +24,16 @@
+ /* Bits in the third argument to `waitpid'.  */
+ #define	WNOHANG		1	/* Don't block waiting.  */
+ #define	WUNTRACED	2	/* Report status of stopped children.  */
++
++/* The following values are used by the `waitid' function.  */
++#if defined __USE_SVID || defined __USE_XOPEN || defined __USE_XOPEN2K8
++# ifndef __ENUM_IDTYPE_T
++# define __ENUM_IDTYPE_T 1
++typedef enum
++{
++  P_ALL,		/* Wait for any child.  */
++  P_PID,		/* Wait for specified process.  */
++  P_PGID		/* Wait for members of process group.  */
++} idtype_t;
++# endif
++#endif
+diff --git a/posix/sys/wait.h b/posix/sys/wait.h
+index 3ecc493..5692b07 100644
+--- a/posix/sys/wait.h
++++ b/posix/sys/wait.h
+@@ -94,17 +94,6 @@ typedef union
+ # define W_STOPCODE(sig)	__W_STOPCODE (sig)
+ #endif
+ 
+-/* The following values are used by the `waitid' function.  */
+-#if defined __USE_SVID || defined __USE_XOPEN || defined __USE_XOPEN2K8
+-typedef enum
+-{
+-  P_ALL,		/* Wait for any child.  */
+-  P_PID,		/* Wait for specified process.  */
+-  P_PGID		/* Wait for members of process group.  */
+-} idtype_t;
+-#endif
+-
+-
+ /* Wait for a child to die.  When one does, put its status in *STAT_LOC
+    and return its process ID.  For errors, return (pid_t) -1.
+ 
+diff --git a/sysdeps/unix/sysv/linux/bits/waitflags.h b/sysdeps/unix/sysv/linux/bits/waitflags.h
+index 2be017d..2ede21b 100644
+--- a/sysdeps/unix/sysv/linux/bits/waitflags.h
++++ b/sysdeps/unix/sysv/linux/bits/waitflags.h
+@@ -35,3 +35,16 @@
+ 				      in this group */
+ #define __WALL		0x40000000 /* Wait for any child.  */
+ #define __WCLONE	0x80000000 /* Wait for cloned process.  */
++
++/* The following values are used by the `waitid' function.  */
++#if defined __USE_SVID || defined __USE_XOPEN || defined __USE_XOPEN2K8
++# ifndef __ENUM_IDTYPE_T
++# define __ENUM_IDTYPE_T 1
++typedef enum
++{
++  P_ALL,		/* Wait for any child.  */
++  P_PID,		/* Wait for specified process.  */
++  P_PGID		/* Wait for members of process group.  */
++} idtype_t;
++# endif
++#endif

Added: trunk/glibc-ports/218_waitid_kbsd.diff
===================================================================
--- trunk/glibc-ports/218_waitid_kbsd.diff	                        (rev 0)
+++ trunk/glibc-ports/218_waitid_kbsd.diff	2013-07-19 20:16:50 UTC (rev 4775)
@@ -0,0 +1,75 @@
+Index: bits/waitflags.h
+===================================================================
+--- bits/waitflags.h	(revision 4764)
++++ bits/waitflags.h	(working copy)
+@@ -30,8 +30,54 @@
+ #define	WSTOPPED	2	/* Report stopped child (same as WUNTRACED). */
+ #define	WCONTINUED	4	/* Report continued child.  */
+ #define	WNOWAIT		8	/* Poll only. Don't delete the proc entry. */
+-
++#define WEXITED         16      /* Wait for exited processes. */
++#define WTRAPPED        32      /* Wait for a process to hit a trap or
++                                   a breakpoint. */
++                                   
+ #define __WCLONE	0x80000000	/* Wait for cloned process.  */
+ #ifdef __USE_BSD
+ # define WLINUXCLONE	__WCLONE	/* FreeBSD name for __WCLONE.  */
+ #endif
++
++
++/* The following values are used by the `waitid' function.  */
++#if defined __USE_SVID || defined __USE_XOPEN || defined __USE_XOPEN2K8
++# ifndef __ENUM_IDTYPE_T
++# define __ENUM_IDTYPE_T 1
++
++typedef enum
++{
++        /*
++         * These names were mostly lifted from Solaris source code and
++         * still use Solaris style naming to avoid breaking any
++         * OpenSolaris code which has been ported to FreeBSD.  There
++         * is no clear FreeBSD counterpart for all of the names, but
++         * some have a clear correspondence to FreeBSD entities.
++         *
++         * The numerical values are kept synchronized with the Solaris
++         * values.
++         */
++        P_PID,                  /* A process identifier. */
++        P_PPID,                 /* A parent process identifier. */
++        P_PGID,                 /* A process group identifier. */
++        P_SID,                  /* A session identifier. */
++        P_CID,                  /* A scheduling class identifier. */
++        P_UID,                  /* A user identifier. */
++        P_GID,                  /* A group identifier. */
++        P_ALL,                  /* All processes. */
++        P_LWPID,                /* An LWP identifier. */
++        P_TASKID,               /* A task identifier. */
++        P_PROJID,               /* A project identifier. */
++        P_POOLID,               /* A pool identifier. */
++        P_JAILID,               /* A zone identifier. */
++        P_CTID,                 /* A (process) contract identifier. */
++        P_CPUID,                /* CPU identifier. */
++        P_PSETID                /* Processor set identifier. */
++} idtype_t;                     /* The type of id_t we are using. */
++
++#  if defined __USE_BSD
++#  define P_ZONEID        P_JAILID
++#  endif
++# endif
++#endif
++                                                                                                                                                                                                                                                 
+\ No newline at end of file
+Index: Versions
+===================================================================
+--- Versions	(revision 4764)
++++ Versions	(working copy)
+@@ -98,6 +98,9 @@
+     jail_get;
+     jail_set;
+   }
++  GLIBC_2.18 {
++    waitid;
++  }
+   GLIBC_PRIVATE {
+     # needed by libpthread.
+     __clone; __libc_fork; __libc_sigaction; __kernel_getosreldate;




More information about the Glibc-bsd-commits mailing list