From: Sandhya Bankar Date: Sun, 2 Apr 2017 21:22:35 +0000 (+0530) Subject: tests: add tests for getpid and getppid syscalls X-Git-Tag: v4.17~123 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=fd1041f6aca442492830979a41922ea34c57e8cd;p=strace tests: add tests for getpid and getppid syscalls Signed-off-by: Sandhya Bankar [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. --- diff --git a/tests/.gitignore b/tests/.gitignore index bbb4b04e..15e8c45c 100644 --- a/tests/.gitignore +++ b/tests/.gitignore @@ -94,6 +94,8 @@ getgroups getgroups32 getpeername getpgrp +getpid +getppid getrandom getresgid getresgid32 diff --git a/tests/Makefile.am b/tests/Makefile.am index 96dcb6ee..f355e3ca 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -158,6 +158,8 @@ check_PROGRAMS = \ getgroups32 \ getpeername \ getpgrp \ + getpid \ + getppid \ getrandom \ getresgid \ getresgid32 \ diff --git a/tests/gen_tests.in b/tests/gen_tests.in index 41766892..0cc0e6c7 100644 --- a/tests/gen_tests.in +++ b/tests/gen_tests.in @@ -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 index 00000000..e5500424 --- /dev/null +++ b/tests/getpid.c @@ -0,0 +1,12 @@ +#include "tests.h" +#include +#include +#include + +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 index 00000000..e0f6c7b5 --- /dev/null +++ b/tests/getppid.c @@ -0,0 +1,12 @@ +#include "tests.h" +#include +#include +#include + +int +main(void) +{ + printf("getppid() = %ld\n", syscall(__NR_getppid)); + puts("+++ exited with 0 +++"); + return 0; +} diff --git a/tests/pure_executables.list b/tests/pure_executables.list index ee9bbab2..f0340f5e 100755 --- a/tests/pure_executables.list +++ b/tests/pure_executables.list @@ -78,6 +78,8 @@ getgroups getgroups32 getpeername getpgrp +getpid +getppid getrandom getresgid getresgid32