]> granicus.if.org Git - strace/commitdiff
tests: add tests for getpid and getppid syscalls
authorSandhya Bankar <bankarsandhya512@gmail.com>
Sun, 2 Apr 2017 21:22:35 +0000 (02:52 +0530)
committerDmitry V. Levin <ldv@altlinux.org>
Fri, 7 Apr 2017 01:21:36 +0000 (01:21 +0000)
Signed-off-by: Sandhya Bankar <bankarsandhya512@gmail.com>
[ldv: rewritten everything]

* tests/getpid.c: New file.
* tests/getppid.c: Likewise.
* tests/.gitignore: Add getpid and getppid.
* tests/pure_executables.list: Likewise.
* tests/Makefile.am (check_PROGRAMS): Likewise.
* tests/gen_tests.in (getpid, getppid): New entries.

tests/.gitignore
tests/Makefile.am
tests/gen_tests.in
tests/getpid.c [new file with mode: 0644]
tests/getppid.c [new file with mode: 0644]
tests/pure_executables.list

index bbb4b04edc5141e7f899abdbed08beb3daa61f28..15e8c45cc1f6eaea9739436c245622cbcd35e767 100644 (file)
@@ -94,6 +94,8 @@ getgroups
 getgroups32
 getpeername
 getpgrp
+getpid
+getppid
 getrandom
 getresgid
 getresgid32
index 96dcb6eea5a36df996ca09345c7df3f8a117be58..f355e3caf6549cfb84828ddc3b3bcd0f92374fcb 100644 (file)
@@ -158,6 +158,8 @@ check_PROGRAMS = \
        getgroups32 \
        getpeername \
        getpgrp \
+       getpid  \
+       getppid \
        getrandom \
        getresgid \
        getresgid32 \
index 417668925740a28ca6b56635c86432247b2a60f9..0cc0e6c7e0dae2e2d780298fc16e443ad341433e 100644 (file)
@@ -99,6 +99,8 @@ getgroups     -a17
 getgroups32    -a19
 getpeername    -a27
 getpgrp        -a10
+getpid -a9
+getppid        -a10
 getrandom      -a32 -s3
 getresgid      -a25
 getresgid32    -a27
diff --git a/tests/getpid.c b/tests/getpid.c
new file mode 100644 (file)
index 0000000..e550042
--- /dev/null
@@ -0,0 +1,12 @@
+#include "tests.h"
+#include <stdio.h>
+#include <unistd.h>
+#include <asm/unistd.h>
+
+int
+main(void)
+{
+       printf("getpid() = %ld\n", syscall(__NR_getpid));
+       puts("+++ exited with 0 +++");
+       return 0;
+}
diff --git a/tests/getppid.c b/tests/getppid.c
new file mode 100644 (file)
index 0000000..e0f6c7b
--- /dev/null
@@ -0,0 +1,12 @@
+#include "tests.h"
+#include <stdio.h>
+#include <unistd.h>
+#include <asm/unistd.h>
+
+int
+main(void)
+{
+       printf("getppid() = %ld\n", syscall(__NR_getppid));
+       puts("+++ exited with 0 +++");
+       return 0;
+}
index ee9bbab2eac19c3890e3be67dbd8f9b2e2c31b57..f0340f5e3de649d710d2a17a4db75036b2c2a773 100755 (executable)
@@ -78,6 +78,8 @@ getgroups
 getgroups32
 getpeername
 getpgrp
+getpid
+getppid
 getrandom
 getresgid
 getresgid32