summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter S. Mazinger <ps.m@gmx.net>2011-04-22 00:52:22 +0200
committerBernhard Reutner-Fischer <rep.dot.nop@gmail.com>2012-06-15 14:00:41 +0200
commit050f753172991d891c523b742fcab5ecc602cc92 (patch)
tree7059e78bdef6c81ebc587c90d16021623f597e57
parent145ad1d976abff15f32e129e25f47c04807d24ac (diff)
make NPTL's getpid behave similar to the common one
make __getpid static provide getppid alias if needed remove unneeded libc_hidden_proto Signed-off-by: Peter S. Mazinger <ps.m@gmx.net> Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
-rw-r--r--libpthread/nptl/sysdeps/unix/sysv/linux/getpid.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/libpthread/nptl/sysdeps/unix/sysv/linux/getpid.c b/libpthread/nptl/sysdeps/unix/sysv/linux/getpid.c
index d4de3cd9e..d2b33849a 100644
--- a/libpthread/nptl/sysdeps/unix/sysv/linux/getpid.c
+++ b/libpthread/nptl/sysdeps/unix/sysv/linux/getpid.c
@@ -21,6 +21,10 @@
#include <tls.h>
#include <sysdep.h>
+#ifdef __NR_getxpid
+# undef __NR_getpid
+# define __NR_getpid __NR_getxpid
+#endif
#ifndef NOT_IN_libc
static inline __attribute__((always_inline)) pid_t really_getpid (pid_t oldval);
@@ -46,8 +50,7 @@ really_getpid (pid_t oldval)
}
#endif
-extern __typeof(getpid) __getpid;
-pid_t
+static pid_t
__getpid (void)
{
#ifdef NOT_IN_libc
@@ -60,6 +63,8 @@ __getpid (void)
#endif
return result;
}
-libc_hidden_proto(getpid)
weak_alias(__getpid, getpid)
libc_hidden_weak(getpid)
+#if !defined NOT_IN_libc && !defined __NR_getppid
+strong_alias(getpid,getppid)
+#endif