summaryrefslogtreecommitdiff
path: root/sys-apps/systemd/files/224-0002-Use-getxpid-syscall-on-alpha-for-raw_getpid.patch
blob: 40e2d1c15e1212a9c9800b6b8f1c4d5fb05dd984 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
From a242a99d42276b6b764f80bd0de70c26e5c5f1d4 Mon Sep 17 00:00:00 2001
From: Matt Turner <mattst88@gmail.com>
Date: Tue, 4 Aug 2015 14:47:01 -0700
Subject: [PATCH] Use getxpid syscall on alpha for raw_getpid()

Alpha does not have a getpid syscall, but rather has getxpid to match
OSF/1.
---
 src/basic/missing.h | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/src/basic/missing.h b/src/basic/missing.h
index ed6cd80..34ab025 100644
--- a/src/basic/missing.h
+++ b/src/basic/missing.h
@@ -977,7 +977,11 @@ static inline int raw_clone(unsigned long flags, void *child_stack) {
 }
 
 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_DECL_RENAMEAT2
-- 
2.5.0