/* ======================================================================= */
-static inline pid_t raw_getpid(void) {
-#if defined(__alpha__)
- return (pid_t) syscall(__NR_getxpid);
-#else
- return (pid_t) syscall(__NR_getpid);
-#endif
-}
-
-/* ======================================================================= */
-
#if !HAVE_KCMP
static inline int missing_kcmp(pid_t pid1, pid_t pid2, int type, unsigned long idx1, unsigned long idx2) {
return syscall(__NR_kcmp, pid1, pid2, type, idx1, idx2);
case CACHED_PID_UNSET: { /* Not initialized yet, then do so now */
pid_t new_pid;
- new_pid = raw_getpid();
+ new_pid = getpid();
if (!installed) {
/* __register_atfork() either returns 0 or -ENOMEM, in its glibc implementation. Since it's
}
case CACHED_PID_BUSY: /* Somebody else is currently initializing */
- return raw_getpid();
+ return getpid();
default: /* Properly initialized */
return current_value;
/* To be called from a signal handler. Will raise the same signal again, in our process + in our threads.
*
- * Note that we use raw_getpid() instead of getpid_cached(). We might have forked with raw_clone()
+ * Note that we use getpid() instead of getpid_cached(). We might have forked with raw_clone()
* earlier (see PID 1), and hence let's go to the raw syscall here. In particular as this is not
* performance sensitive code.
*
* Note that we use kill() rather than raise() as fallback, for similar reasons. */
- p = raw_getpid();
+ p = getpid();
if (rt_tgsigqueueinfo(p, gettid(), sig, siginfo) < 0)
assert_se(kill(p, sig) >= 0);
siginfo_t si;
pid_t a, b, c, d, e, f, child;
- a = raw_getpid();
+ a = getpid();
b = getpid_cached();
c = getpid();
if (child == 0) {
/* In child */
- a = raw_getpid();
+ a = getpid();
b = getpid_cached();
c = getpid();
_exit(EXIT_SUCCESS);
}
- d = raw_getpid();
+ d = getpid();
e = getpid_cached();
f = getpid();
parent = getpid();
log_info("before clone: getpid()→"PID_FMT, parent);
- assert_se(raw_getpid() == parent);
+ assert_se(getpid() == parent);
pid = raw_clone(0);
assert_se(pid >= 0);
- pid2 = raw_getpid();
- log_info("raw_clone: "PID_FMT" getpid()→"PID_FMT" raw_getpid()→"PID_FMT,
+ pid2 = getpid();
+ log_info("raw_clone: "PID_FMT" getpid()→"PID_FMT" getpid()→"PID_FMT,
pid, getpid(), pid2);
if (pid == 0) {
assert_se(pid2 != parent);