diff --git a/repos/libports/lib/mk/libc.mk b/repos/libports/lib/mk/libc.mk index 26ed6881a..4aa7a1205 100644 --- a/repos/libports/lib/mk/libc.mk +++ b/repos/libports/lib/mk/libc.mk @@ -14,7 +14,8 @@ SRC_CC = atexit.cc dummies.cc rlimit.cc sysctl.cc \ gettimeofday.cc malloc.cc progname.cc fd_alloc.cc file_operations.cc \ plugin.cc plugin_registry.cc select.cc exit.cc environ.cc nanosleep.cc \ libc_mem_alloc.cc pread_pwrite.cc readv_writev.cc poll.cc \ - libc_pdbg.cc vfs_plugin.cc rtc.cc dynamic_linker.cc socket_operations.cc + libc_pdbg.cc vfs_plugin.cc rtc.cc dynamic_linker.cc signal.cc \ + socket_operations.cc INC_DIR += $(REP_DIR)/src/lib/libc diff --git a/repos/libports/src/lib/libc/dummies.cc b/repos/libports/src/lib/libc/dummies.cc index 3e96ed2f5..4c6e0c229 100644 --- a/repos/libports/src/lib/libc/dummies.cc +++ b/repos/libports/src/lib/libc/dummies.cc @@ -30,7 +30,6 @@ extern "C" { #include #include -#include #include #include #include @@ -118,8 +117,6 @@ DUMMY(int , -1, _sigaction, (int, const struct sigaction *, struct sigaction * DUMMY(int , -1, sigaction, (int, const struct sigaction *, struct sigaction *)) DUMMY(int , -1, sigblock, (int)) DUMMY(int , -1, sigpause, (int)) -DUMMY(int , -1, _sigprocmask, (int, const sigset_t *, sigset_t *)) -DUMMY(int , -1, sigprocmask, (int, const sigset_t *, sigset_t *)) DUMMY(int , -1, _sigsuspend, (const sigset_t *)) DUMMY(int , -1, sigsuspend, (const sigset_t *)) DUMMY(int , -1, socketpair, (int, int, int, int *)) diff --git a/repos/libports/src/lib/libc/signal.cc b/repos/libports/src/lib/libc/signal.cc new file mode 100644 index 000000000..5017863f0 --- /dev/null +++ b/repos/libports/src/lib/libc/signal.cc @@ -0,0 +1,43 @@ +/* + * \brief POSIX signals + * \author Emery Hemingway + * \date 2015-10-30 + */ + +/* + * Copyright (C) 2006-2015 Genode Labs GmbH + * + * This file is part of the Genode OS framework, which is distributed + * under the terms of the GNU General Public License version 2. + */ + +/* libc includes */ +extern "C" { +#include +#include +#include +} + + +extern "C" int __attribute__((weak)) sigprocmask(int how, const sigset_t *set, sigset_t *old_set) +{ + /* no signals should be expected, so report all signals blocked */ + if (old_set != NULL) + sigfillset(old_set); + + if (set == NULL) + return 0; + + switch (how) { + case SIG_BLOCK: return 0; + case SIG_SETMASK: return 0; + case SIG_UNBLOCK: return 0; + } + errno = EINVAL; + return -1; +} + +extern "C" int __attribute__((weak)) _sigprocmask(int how, const sigset_t *set, sigset_t *old_set) +{ + return sigprocmask(how, set, old_set); +}