From: Bart Van Assche Date: Tue, 27 Oct 2009 14:20:23 +0000 (+0000) Subject: Added a modified version of the rt_sigqueue test program provided by Konstantin Sereb... X-Git-Tag: svn/VALGRIND_3_6_0~499 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=20f6ef58968f9dde62f19a0a823001088f4d6358;p=thirdparty%2Fvalgrind.git Added a modified version of the rt_sigqueue test program provided by Konstantin Serebryany. git-svn-id: svn://svn.valgrind.org/valgrind/trunk@10910 --- diff --git a/memcheck/tests/linux/Makefile.am b/memcheck/tests/linux/Makefile.am index a7a2d0201d..4bd7751302 100644 --- a/memcheck/tests/linux/Makefile.am +++ b/memcheck/tests/linux/Makefile.am @@ -8,6 +8,7 @@ EXTRA_DIST = \ capget capget.stderr.exp \ lsframe1.vgtest lsframe1.stdout.exp lsframe1.stderr.exp \ lsframe2.vgtest lsframe2.stdout.exp lsframe2.stderr.exp \ + sigqueue.vgtest sigqueue.stderr.exp \ stack_changes.stderr.exp stack_changes.stdout.exp \ stack_changes.stdout.exp2 stack_changes.vgtest \ stack_switch.stderr.exp stack_switch.vgtest \ @@ -19,6 +20,7 @@ check_PROGRAMS = \ capget \ lsframe1 \ lsframe2 \ + sigqueue \ stack_changes \ stack_switch \ timerfd-syscall diff --git a/memcheck/tests/linux/sigqueue.c b/memcheck/tests/linux/sigqueue.c new file mode 100644 index 0000000000..138a27602e --- /dev/null +++ b/memcheck/tests/linux/sigqueue.c @@ -0,0 +1,30 @@ +#include +#include +#include +#include +#include +#include +#include + +int main() +{ + siginfo_t *si; + const size_t sz = sizeof(*si); + + fprintf(stderr, "sizeof(*si) = %zu\n", sz); + fprintf(stderr, "%zd %zd %zd %zd\n", + offsetof(siginfo_t, si_signo), + offsetof(siginfo_t, si_errno), + offsetof(siginfo_t, si_code), + offsetof(siginfo_t, _sifields) + ); + si = calloc(1, sz); + si->si_signo = SIGWINCH; + si->si_code = SI_QUEUE; + si->si_pid = getpid(); + si->si_uid = getuid(); + syscall(__NR_rt_sigqueueinfo, getpid(), SIGWINCH, si); + free(si); + fprintf(stderr, "Done.\n"); + return 0; +} diff --git a/memcheck/tests/linux/sigqueue.stderr.exp b/memcheck/tests/linux/sigqueue.stderr.exp new file mode 100644 index 0000000000..19a8d2faaf --- /dev/null +++ b/memcheck/tests/linux/sigqueue.stderr.exp @@ -0,0 +1,13 @@ + +sizeof(*si) = 128 +0 4 8 16 +Done. + +HEAP SUMMARY: + in use at exit: 0 bytes in 0 blocks + total heap usage: 1 allocs, 1 frees, 128 bytes allocated + +For a detailed leak analysis, rerun with: --leak-check=full + +For counts of detected and suppressed errors, rerun with: -v +ERROR SUMMARY: 1 errors from 1 contexts (suppressed: 0 from 0) diff --git a/memcheck/tests/linux/sigqueue.vgtest b/memcheck/tests/linux/sigqueue.vgtest new file mode 100644 index 0000000000..38ab7edceb --- /dev/null +++ b/memcheck/tests/linux/sigqueue.vgtest @@ -0,0 +1 @@ +prog: sigqueue