about summary refs log tree commit diff
path: root/sysdeps/unix/sysv/linux/signalfd.c
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2008-07-25 04:51:56 +0000
committerUlrich Drepper <drepper@redhat.com>2008-07-25 04:51:56 +0000
commitbdcebfc4c7cc4f08efaf84af19465893f69fd5ed (patch)
tree2335c641a0fe139b353e3ae89c8b13385c34ac2e /sysdeps/unix/sysv/linux/signalfd.c
parent0e077a7eea286a8efd63460d0ea5d99e44a86b71 (diff)
downloadglibc-bdcebfc4c7cc4f08efaf84af19465893f69fd5ed.tar.gz
glibc-bdcebfc4c7cc4f08efaf84af19465893f69fd5ed.tar.xz
glibc-bdcebfc4c7cc4f08efaf84af19465893f69fd5ed.zip
* Versions.def (glibc): Add GLIBC_2.9.
	* io/Makefile (routines): Add dup3 and pipe2.
	* io/Versions [glibc] (GLIBC_2.9): Add dup3 and pipe2.
	* io/dup3.c: New file.
	* io/pipe2.c: New file.
	* posix/unistd.h: Declare dup3 and pipe2.
	* socket/Makefile (routines): Add paccept.
	* socket/Versions [glibc] (GLIBC_2.9): Add paccept.
	* socket/paccept.c: New file.
	* socket/sys/socket.h: Declare paccept.
	* sysdeps/unix/syscalls.list: Add entry for dup3.
	* sysdeps/unix/sysv/linux/Versions [glibc] (GLIBC_2.9): Add
	epoll_create2 and inotify_init1.
	* sysdeps/unix/sysv/linux/eventfd.c: Use eventfd1 syscall if possible.
	* sysdeps/unix/sysv/linux/paccept.c: New file.
	* sysdeps/unix/sysv/linux/signalfd.c: Use signalfd4 syscall if
	possible.
	* sysdeps/unix/sysv/linux/socketcall.h: Add SOCKOP_paccept.
	* sysdeps/unix/sysv/linux/syscalls.list: Add epoll_create2,
	inotify_init1, and pipe2 entries.
	* sysdeps/unix/sysv/linux/alpha/sys/epoll.h: New file.
	* sysdeps/unix/sysv/linux/alpha/sys/eventfd.h: New file.
	* sysdeps/unix/sysv/linux/alpha/sys/inotify.h: New file.
	* sysdeps/unix/sysv/linux/alpha/sys/signalfd.h: New file.
	* sysdeps/unix/sysv/linux/alpha/sys/timerfd.h: New file.
	* sysdeps/unix/sysv/linux/bits/socket.h: Define SOCK_CLOEXEC and
	SOCK_NONBLOCK.
	* sysdeps/unix/sysv/linux/i386/paccept.S: New file.
	* sysdeps/unix/sysv/linux/sparc/sys/epoll.h: New file.
	* sysdeps/unix/sysv/linux/sparc/sys/eventfd.h: New file.
	* sysdeps/unix/sysv/linux/sparc/sys/inotify.h: New file.
	* sysdeps/unix/sysv/linux/sparc/sys/signalfd.h: New file.
	* sysdeps/unix/sysv/linux/sparc/sys/timerfd.h: New file.
	* sysdeps/unix/sysv/linux/sparc/bits/socket.h: New file.
	* sysdeps/unix/sysv/linux/sys/epoll.h: Define EPOLL_CLOEXEC and
	EPOLL_NONBLOCK.  Declare epoll_create2.
	* sysdeps/unix/sysv/linux/sys/eventfd.h: Define EFD_CLOEXEC and
	EFD_NONBLOCK.
	* sysdeps/unix/sysv/linux/sys/inotify.h: Define IN_CLOEXEC and
	IN_NONBLOCK.  Declare inotify_init1.
	* sysdeps/unix/sysv/linux/sys/signalfd.h: Define SFD_CLOEXEC and
	SFD_NONBLOCK.
	* sysdeps/unix/sysv/linux/sys/timerfd.h: Define TFD_CLOEXEC and
	TFD_NONBLOCK.
Diffstat (limited to 'sysdeps/unix/sysv/linux/signalfd.c')
-rw-r--r--sysdeps/unix/sysv/linux/signalfd.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/sysdeps/unix/sysv/linux/signalfd.c b/sysdeps/unix/sysv/linux/signalfd.c
index 09355ecd1d..9898f29231 100644
--- a/sysdeps/unix/sysv/linux/signalfd.c
+++ b/sysdeps/unix/sysv/linux/signalfd.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2007 Free Software Foundation, Inc.
+/* Copyright (C) 2007, 2008 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
@@ -25,7 +25,10 @@
 int
 signalfd (int fd, const sigset_t *mask, int flags)
 {
-  /* The system call has no flag parameter which is bad.  So we have
+#ifdef __NR_signalfd4
+  return INLINE_SYSCALL (signalfd4, 4, fd, mask, _NSIG / 8, flags);
+#else
+  /* The old system call has no flag parameter which is bad.  So we have
      to wait until we have to support to pass additional values to the
      kernel (sys_indirect) before implementing setting flags like
      O_NONBLOCK etc.  */
@@ -35,10 +38,11 @@ signalfd (int fd, const sigset_t *mask, int flags)
       return -1;
     }
 
-#ifdef __NR_signalfd
+# ifdef __NR_signalfd
   return INLINE_SYSCALL (signalfd, 3, fd, mask, _NSIG / 8);
-#else
+# else
   __set_errno (ENOSYS);
   return -1;
+# endif
 #endif
 }