From ef6b4262bb2f287fe103f54ddee13e8cb0adcf37 Mon Sep 17 00:00:00 2001 From: Fei Jie Date: Thu, 21 Apr 2016 15:53:52 +0800 Subject: [PATCH] tests: add getpgrp.test * tests/getpgrp.c: New file. * tests/getpgrp.test: New test. * tests/.gitignore: Add getpgrp. * tests/Makefile.am (check_PROGRAMS): Likewise. (DECODER_TESTS): Add getpgrp.test. --- tests/.gitignore | 1 + tests/Makefile.am | 2 ++ tests/getpgrp.c | 22 ++++++++++++++++++++++ tests/getpgrp.test | 6 ++++++ 4 files changed, 31 insertions(+) create mode 100644 tests/getpgrp.c create mode 100755 tests/getpgrp.test diff --git a/tests/.gitignore b/tests/.gitignore index 248110cc..02e0bcd2 100644 --- a/tests/.gitignore +++ b/tests/.gitignore @@ -69,6 +69,7 @@ getgid getgid32 getgroups getgroups32 +getpgrp getrandom getresgid getresgid32 diff --git a/tests/Makefile.am b/tests/Makefile.am index 11139723..8d83225f 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -122,6 +122,7 @@ check_PROGRAMS = \ getgid32 \ getgroups \ getgroups32 \ + getpgrp \ getrandom \ getresgid \ getresgid32 \ @@ -371,6 +372,7 @@ DECODER_TESTS = \ getgid32.test \ getgroups.test \ getgroups32.test \ + getpgrp.test \ getrandom.test \ getresgid.test \ getresgid32.test \ diff --git a/tests/getpgrp.c b/tests/getpgrp.c new file mode 100644 index 00000000..fd3139b5 --- /dev/null +++ b/tests/getpgrp.c @@ -0,0 +1,22 @@ +#include "tests.h" +#include + +#ifdef __NR_getpgrp + +# include +# include + +int +main(void) +{ + printf("getpgrp() = %ld\n", syscall(__NR_getpgrp)); + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_getpgrp") + +#endif diff --git a/tests/getpgrp.test b/tests/getpgrp.test new file mode 100755 index 00000000..e116bb51 --- /dev/null +++ b/tests/getpgrp.test @@ -0,0 +1,6 @@ +#!/bin/sh + +# Check getpgrp syscall decoding. + +. "${srcdir=.}/init.sh" +run_strace_match_diff -a10 -- 2.40.0