Libc: sigprocmask reports all signals blocked

Fixes #1756
This commit is contained in:
Emery Hemingway 2015-10-30 15:46:41 +01:00 committed by Christian Helmuth
parent 7186c45de6
commit b9c234a341
3 changed files with 45 additions and 4 deletions

View File

@ -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

View File

@ -30,7 +30,6 @@ extern "C" {
#include <db.h>
#include <netdb.h>
#include <signal.h>
#include <unistd.h>
#include <pthread.h>
#include <pwd.h>
@ -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 *))

View File

@ -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 <signal.h>
#include <stdlib.h>
#include <errno.h>
}
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);
}