tools/nolibc/sys: add syscall definition for getppid()
authorWilly Tarreau <w@1wt.eu>
Mon, 21 Mar 2022 17:33:11 +0000 (18:33 +0100)
committerPaul E. McKenney <paulmck@kernel.org>
Thu, 21 Apr 2022 00:05:45 +0000 (17:05 -0700)
This is essentially for completeness as it's not the most often used
in regtests.

Signed-off-by: Willy Tarreau <w@1wt.eu>
Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
tools/include/nolibc/sys.h

index 28437863c63ff267a2d766d2a1df1462bc742e54..4d4308d5d11167808fe51b717d8f05d105178eb5 100644 (file)
@@ -464,6 +464,23 @@ pid_t getpid(void)
 }
 
 
+/*
+ * pid_t getppid(void);
+ */
+
+static __attribute__((unused))
+pid_t sys_getppid(void)
+{
+       return my_syscall0(__NR_getppid);
+}
+
+static __attribute__((unused))
+pid_t getppid(void)
+{
+       return sys_getppid();
+}
+
+
 /*
  * pid_t gettid(void);
  */