diff options
author | Ulrich Drepper <drepper@gmail.com> | 2012-01-08 11:55:32 -0500 |
---|---|---|
committer | Ulrich Drepper <drepper@gmail.com> | 2012-01-08 11:55:32 -0500 |
commit | d9a216c037590c414e4069afde01fde84794e0d6 (patch) | |
tree | 0c4cbf65be6c1a788741977cbd383def08406a78 /debug/tst-chk1.c | |
parent | 15cfed3f93f60e79508043047065f189754f8e35 (diff) | |
download | glibc-d9a216c037590c414e4069afde01fde84794e0d6.tar glibc-d9a216c037590c414e4069afde01fde84794e0d6.tar.gz glibc-d9a216c037590c414e4069afde01fde84794e0d6.tar.bz2 glibc-d9a216c037590c414e4069afde01fde84794e0d6.zip |
Add checking versions of poll and ppoll
Diffstat (limited to 'debug/tst-chk1.c')
-rw-r--r-- | debug/tst-chk1.c | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/debug/tst-chk1.c b/debug/tst-chk1.c index 7f0186e706..2593ab9f18 100644 --- a/debug/tst-chk1.c +++ b/debug/tst-chk1.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2004,2005,2006,2007,2008,2011 Free Software Foundation, Inc. +/* Copyright (C) 2004-2008,2011,2012 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Jakub Jelinek <jakub@redhat.com>, 2004. @@ -29,6 +29,7 @@ #include <string.h> #include <unistd.h> #include <wchar.h> +#include <sys/poll.h> #include <sys/select.h> #include <sys/socket.h> #include <sys/un.h> @@ -1476,5 +1477,21 @@ do_test (void) CHK_FAIL_END #endif + struct pollfd fds[1]; + fds[0].fd = STDOUT_FILENO; + fds[0].events = POLLOUT; + poll (fds, 1, 0); +#if __USE_FORTIFY_LEVEL >= 1 + CHK_FAIL_START + poll (fds, 2, 0); + CHK_FAIL_END +#endif + ppoll (fds, 1, NULL, NULL); +#if __USE_FORTIFY_LEVEL >= 1 + CHK_FAIL_START + ppoll (fds, 2, NULL, NULL); + CHK_FAIL_END +#endif + return ret; } |