Add signalfd call to bionic

Add signalfd() call to bionic.

Adding the signalfd call was done in 3 steps:
- add signalfd4 system call (function name and syscall
  number) to libc/SYSCALLS.TXT
- generate all necessary headers by calling
  libc/tools/gensyscalls.py. This patch is adding
  the generated files since the build system
  does not call gensyscalls.py.
- create the signalfd wrapper in signalfd.cpp and add
  the function prototype to sys/signalfd.h

Change-Id: I7ee1d3e60d5d3e1c73d9820e07d23b9ce6e1a5ab
This commit is contained in:
Rom Lemarchand
2013-01-09 15:46:06 -08:00
parent 5043c376c9
commit 0c11611c11
12 changed files with 227 additions and 0 deletions

View File

@@ -173,6 +173,7 @@
#define __NR_rt_sigaction (__NR_SYSCALL_BASE + 174)
#define __NR_rt_sigprocmask (__NR_SYSCALL_BASE + 175)
#define __NR_rt_sigtimedwait (__NR_SYSCALL_BASE + 177)
#define __NR_signalfd4 (__NR_SYSCALL_BASE + 355)
#define __NR_socket (__NR_SYSCALL_BASE + 281)
#define __NR_socketpair (__NR_SYSCALL_BASE + 288)
#define __NR_bind (__NR_SYSCALL_BASE + 282)
@@ -329,6 +330,7 @@
#define __NR_unshare (__NR_SYSCALL_BASE + 310)
#define __NR_getcpu (__NR_SYSCALL_BASE + 318)
#define __NR_utimensat (__NR_SYSCALL_BASE + 320)
#define __NR_signalfd4 (__NR_SYSCALL_BASE + 327)
#define __NR_eventfd2 (__NR_SYSCALL_BASE + 328)
#define __NR_pipe2 (__NR_SYSCALL_BASE + 331)
#define __NR_perf_event_open (__NR_SYSCALL_BASE + 336)
@@ -463,6 +465,7 @@
#define __NR_ioprio_set (__NR_SYSCALL_BASE + 314)
#define __NR_ioprio_get (__NR_SYSCALL_BASE + 315)
#define __NR_utimensat (__NR_SYSCALL_BASE + 316)
#define __NR_signalfd4 (__NR_SYSCALL_BASE + 324)
#define __NR_eventfd2 (__NR_SYSCALL_BASE + 325)
#define __NR_pipe2 (__NR_SYSCALL_BASE + 328)
#define __NR_perf_event_open (__NR_SYSCALL_BASE + 333)

View File

@@ -0,0 +1,42 @@
/*
* Copyright (C) 2013 The Android Open Source Project
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
#ifndef _SYS_SIGNALFD_H_
#define _SYS_SIGNALFD_H_
#include <linux/signalfd.h>
#include <sys/cdefs.h>
#include <signal.h>
__BEGIN_DECLS
/* Compatibility with GLibc */
extern int signalfd(int fd, const sigset_t *mask, int flags);
__END_DECLS
#endif /* _SYS_SIGNALFD_H */