From 3b28c711f90607575a53479bd1211c2ba53be80c Mon Sep 17 00:00:00 2001 From: Giacomo Tesio Date: Fri, 22 Sep 2017 02:10:52 +0200 Subject: [PATCH] jehanne: fix sigwait; stub sigqueue --- newlib/libc/sys/jehanne/sigqueue.c | 28 ++++++++++++++++++++++++++++ newlib/libc/sys/jehanne/sigwait.c | 6 ++++-- 2 files changed, 32 insertions(+), 2 deletions(-) create mode 100644 newlib/libc/sys/jehanne/sigqueue.c diff --git a/newlib/libc/sys/jehanne/sigqueue.c b/newlib/libc/sys/jehanne/sigqueue.c new file mode 100644 index 000000000..7859552d4 --- /dev/null +++ b/newlib/libc/sys/jehanne/sigqueue.c @@ -0,0 +1,28 @@ +/* + * This file is part of Jehanne. + * + * Copyright (C) 2017 Giacomo Tesio + * + * This is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as + * published by the Free Software Foundation, version 3 of the License. + * + * Jehanne is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with Jehanne. If not, see . + */ +#include +#include +#include +#include + +int +sigqueue(pid_t pid, int signo, const union sigval value) +{ + int *errnop = &_REENT->_errno; + return POSIX_sigqueue(errnop, pid, signo, value); +} diff --git a/newlib/libc/sys/jehanne/sigwait.c b/newlib/libc/sys/jehanne/sigwait.c index da4c69c97..ead1e77e6 100644 --- a/newlib/libc/sys/jehanne/sigwait.c +++ b/newlib/libc/sys/jehanne/sigwait.c @@ -21,11 +21,13 @@ #include int -sigtimedwait(const PosixSignalMask *set, int *sig) +sigwait(const PosixSignalMask *set, int *sig) { int err; PosixSignalInfo info; - if(POSIX_sigtimedwait(&err, set, &info, nil) > 0) + if(POSIX_sigtimedwait(&err, set, &info, nil) > 0){ + *sig = info.si_signo; return 0; + } return err; }