diff options
author | Carmelo Amoroso <carmelo.amoroso@st.com> | 2008-11-27 18:21:33 +0000 |
---|---|---|
committer | Carmelo Amoroso <carmelo.amoroso@st.com> | 2008-11-27 18:21:33 +0000 |
commit | 28c8634afdc1fa236679b49ab0d5a019379c6db1 (patch) | |
tree | fda9d6e124a32799b07247f8d38d0cc8f963cd4e /libc/sysdeps/linux/common/signalfd.c | |
parent | eb38b2d34c32ed3089e2bf8935219a57f84ce7b3 (diff) | |
download | uClibc-alpine-28c8634afdc1fa236679b49ab0d5a019379c6db1.tar.bz2 uClibc-alpine-28c8634afdc1fa236679b49ab0d5a019379c6db1.tar.xz |
Synch with trunk @ 24165
Step 17: libc_hidden_proto removal (almost all).
and other minor changes (inline keyword, extra character)
Diffstat (limited to 'libc/sysdeps/linux/common/signalfd.c')
-rw-r--r-- | libc/sysdeps/linux/common/signalfd.c | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/libc/sysdeps/linux/common/signalfd.c b/libc/sysdeps/linux/common/signalfd.c new file mode 100644 index 000000000..3d76e04c4 --- /dev/null +++ b/libc/sysdeps/linux/common/signalfd.c @@ -0,0 +1,41 @@ +/* vi: set sw=4 ts=4: */ +/* + * signalfd() for uClibc + * + * Copyright (C) 2008 Bernhard Reutner-Fischer <uclibc@uclibc.org> + * + * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball. + */ + +#include <sys/syscall.h> +#include <signal.h> +#include <sys/signalfd.h> + +#if defined __NR_signalfd4 +#define __NR___syscall_signalfd4 __NR_signalfd4 +static __inline__ _syscall4(int, __syscall_signalfd4, int, fd, + const sigset_t *, mask, size_t, sizemask, int, flags) +#elif defined __NR_signalfd +#define __NR___syscall_signalfd __NR_signalfd +static __inline__ _syscall3(int, __syscall_signalfd, int, fd, + const sigset_t *, mask, size_t, sizemask) +#endif + +#if defined __NR_signalfd4 || defined __NR_signalfd \ + || defined __UCLIBC_HAS_STUBS__ +int signalfd (int fd, const sigset_t *mask, int flags) +{ +#if defined __NR___syscall_signalfd4 + return __syscall_signalfd4(fd, mask, _NSIG / 8, flags); +#elif defined __NR___syscall_signalfd + if (flags != 0) { + __set_errno(EINVAL); + return -1; + } + return __syscall_signalfd(fd, mask, _NSIG / 8); +#elif defined __UCLIBC_HAS_STUBS__ + __set_errno(ENOSYS); + return -1; +#endif +} +#endif |