diff options
author | Jakub Jelinek <jakub@redhat.com> | 2006-01-30 09:30:09 +0000 |
---|---|---|
committer | Jakub Jelinek <jakub@redhat.com> | 2006-01-30 09:30:09 +0000 |
commit | 3e543bc56346540cbf73fd48d0172fc6a588efd5 (patch) | |
tree | b2c3502b6596d238ac861cc82cafdc6f8b84e143 /nptl/tst-cancel4.c | |
parent | 06f313e361a523605ba6d4c9cdc67a7353cd367c (diff) | |
download | glibc-3e543bc56346540cbf73fd48d0172fc6a588efd5.tar.gz glibc-3e543bc56346540cbf73fd48d0172fc6a588efd5.tar.xz glibc-3e543bc56346540cbf73fd48d0172fc6a588efd5.zip |
Updated to fedora-glibc-20060130T0922
Diffstat (limited to 'nptl/tst-cancel4.c')
-rw-r--r-- | nptl/tst-cancel4.c | 50 |
1 files changed, 49 insertions, 1 deletions
diff --git a/nptl/tst-cancel4.c b/nptl/tst-cancel4.c index cb7619688e..73cfa44614 100644 --- a/nptl/tst-cancel4.c +++ b/nptl/tst-cancel4.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2002, 2003, 2004 Free Software Foundation, Inc. +/* Copyright (C) 2002, 2003, 2004, 2006 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@redhat.com>, 2002. @@ -524,6 +524,53 @@ tf_poll (void *arg) static void * +tf_ppoll (void *arg) +{ + int fd; + int r; + + if (arg == NULL) + fd = fds[0]; + else + { + char fname[] = "/tmp/tst-cancel4-fd-XXXXXX"; + tempfd = fd = mkstemp (fname); + if (fd == -1) + printf ("%s: mkstemp failed\n", __FUNCTION__); + unlink (fname); + + r = pthread_barrier_wait (&b2); + if (r != 0 && r != PTHREAD_BARRIER_SERIAL_THREAD) + { + printf ("%s: barrier_wait failed\n", __FUNCTION__); + exit (1); + } + } + + r = pthread_barrier_wait (&b2); + if (r != 0 && r != PTHREAD_BARRIER_SERIAL_THREAD) + { + printf ("%s: barrier_wait failed\n", __FUNCTION__); + exit (1); + } + + struct pollfd rfs[1] = { [0] = { .fd = fd, .events = POLLIN } }; + + int s; + pthread_cleanup_push (cl, NULL); + + s = ppoll (rfs, 1, NULL, NULL); + + pthread_cleanup_pop (0); + + printf ("%s: ppoll returns with %d (%s)\n", __FUNCTION__, s, + strerror (errno)); + + exit (1); +} + + +static void * tf_wait (void *arg) { pid_t pid = fork (); @@ -2006,6 +2053,7 @@ static struct ADD_TEST (select, 2, 0), ADD_TEST (pselect, 2, 0), ADD_TEST (poll, 2, 0), + ADD_TEST (ppoll, 2, 0), ADD_TEST (write, 2, 0), ADD_TEST (writev, 2, 0), ADD_TEST (sleep, 2, 0), |