tests: add getsid.test

* tests/getsid.c: New file.
* tests/getsid.test: New test.
* tests/.gitignore: Add getsid.
* tests/Makefile.am (check_PROGRAMS): Likewise.
(DECODER_TESTS): Add getsid.test.
This commit is contained in:
Fei Jie 2016-04-21 09:40:01 +08:00 committed by Dmitry V. Levin
parent 2b69fd4c43
commit 8bfe0d5e22
4 changed files with 22 additions and 0 deletions

1
tests/.gitignore vendored
View File

@ -73,6 +73,7 @@ getresgid32
getresuid
getresuid32
getrusage
getsid
getuid
getuid32
getxxid

View File

@ -126,6 +126,7 @@ check_PROGRAMS = \
getresuid \
getresuid32 \
getrusage \
getsid \
getuid \
getuid32 \
getxxid \
@ -371,6 +372,7 @@ DECODER_TESTS = \
getresuid.test \
getresuid32.test \
getrusage.test \
getsid.test \
getuid.test \
getuid32.test \
getxxid.test \

13
tests/getsid.c Normal file
View File

@ -0,0 +1,13 @@
#include "tests.h"
#include <stdio.h>
#include <unistd.h>
int
main(void)
{
pid_t pid = getpid();
printf("getsid(%d) = %d\n", pid, getsid(pid));
puts("+++ exited with 0 +++");
return 0;
}

6
tests/getsid.test Executable file
View File

@ -0,0 +1,6 @@
#!/bin/sh
# Check getsid syscall decoding.
. "${srcdir=.}/init.sh"
run_strace_match_diff -a10