tests: add tests for getpid and getppid syscalls

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.
This commit is contained in:
Sandhya Bankar 2017-04-03 02:52:35 +05:30 committed by Dmitry V. Levin
parent 3288b4fe77
commit fd1041f6ac
6 changed files with 32 additions and 0 deletions

2
tests/.gitignore vendored
View File

@ -94,6 +94,8 @@ getgroups
getgroups32
getpeername
getpgrp
getpid
getppid
getrandom
getresgid
getresgid32

View File

@ -158,6 +158,8 @@ check_PROGRAMS = \
getgroups32 \
getpeername \
getpgrp \
getpid \
getppid \
getrandom \
getresgid \
getresgid32 \

View File

@ -99,6 +99,8 @@ getgroups -a17
getgroups32 -a19
getpeername -a27
getpgrp -a10
getpid -a9
getppid -a10
getrandom -a32 -s3
getresgid -a25
getresgid32 -a27

12
tests/getpid.c Normal file
View File

@ -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;
}

12
tests/getppid.c Normal file
View File

@ -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;
}

View File

@ -78,6 +78,8 @@ getgroups
getgroups32
getpeername
getpgrp
getpid
getppid
getrandom
getresgid
getresgid32