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:
parent
3288b4fe77
commit
fd1041f6ac
2
tests/.gitignore
vendored
2
tests/.gitignore
vendored
@ -94,6 +94,8 @@ getgroups
|
||||
getgroups32
|
||||
getpeername
|
||||
getpgrp
|
||||
getpid
|
||||
getppid
|
||||
getrandom
|
||||
getresgid
|
||||
getresgid32
|
||||
|
@ -158,6 +158,8 @@ check_PROGRAMS = \
|
||||
getgroups32 \
|
||||
getpeername \
|
||||
getpgrp \
|
||||
getpid \
|
||||
getppid \
|
||||
getrandom \
|
||||
getresgid \
|
||||
getresgid32 \
|
||||
|
@ -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
12
tests/getpid.c
Normal 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
12
tests/getppid.c
Normal 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;
|
||||
}
|
@ -78,6 +78,8 @@ getgroups
|
||||
getgroups32
|
||||
getpeername
|
||||
getpgrp
|
||||
getpid
|
||||
getppid
|
||||
getrandom
|
||||
getresgid
|
||||
getresgid32
|
||||
|
Loading…
Reference in New Issue
Block a user