From 7c65e9001b93d5d20046bc4d50fd10fff5f4adc2 Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Fri, 20 Jan 2006 07:08:05 +0000 Subject: * include/fcntl.h: Declare __have_atfcts. * sysdeps/unix/sysv/linux/faccessat.c: Use syscall if available. * sysdeps/unix/sysv/linux/fchmodat.c: Likewise. * sysdeps/unix/sysv/linux/fchownat.c: Likewise. * sysdeps/unix/sysv/linux/futimesat.c: Likewise. * sysdeps/unix/sysv/linux/linkat.c: Likewise. * sysdeps/unix/sysv/linux/mkdirat.c: Likewise. * sysdeps/unix/sysv/linux/openat.c: Likewise. * sysdeps/unix/sysv/linux/readlinkat.c: Likewise. * sysdeps/unix/sysv/linux/renameat.c: Likewise. * sysdeps/unix/sysv/linux/symlinkat.c: Likewise. * sysdeps/unix/sysv/linux/unlinkat.c: Likewise. * sysdeps/unix/sysv/linux/xmknodat.c: Likewise. * sysdeps/unix/sysv/linux/wordsize-64/fxstatat.c: Likewise. * sysdeps/unix/sysv/linux/kernel-features.h: Define __ASSUME_PSELECT, __ASSUME_PPOLL, and __ASSUME_ATFCTS if possible. * io/ppoll.c: New file. * io/Makefile (routines): Add ppoll. (CFLAGS-ppoll.c): Define. * io/Versions: Export ppoll for GLIBC_2.4. * io/sys/poll.h: Declare ppoll. * sysdeps/unix/sysv/linux/ppoll.c: New file. * misc/pselect.c: Make it possible to include this file to define the generic code as a static function. * sysdeps/unix/sysv/linux/pselect.c: New file. --- nptl/ChangeLog | 4 ++++ nptl/tst-cancel4.c | 50 +++++++++++++++++++++++++++++++++++++++++++++++++- 2 files changed, 53 insertions(+), 1 deletion(-) (limited to 'nptl') diff --git a/nptl/ChangeLog b/nptl/ChangeLog index a902ceb62f..dd87226d6e 100644 --- a/nptl/ChangeLog +++ b/nptl/ChangeLog @@ -1,3 +1,7 @@ +2006-01-19 Ulrich Drepper + + * tst-cancel4.c: Test ppoll. + 2006-01-18 Andreas Jaeger [BZ #2167] 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 , 2002. @@ -523,6 +523,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) { @@ -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), -- cgit v1.2.1