1 /*****************************************************************************
2 * sigwait.c: POSIX sigwait() replacement
3 *****************************************************************************
4 * Copyright © 2017 VLC authors and VideoLAN
6 * Author: Julian Scheel <julian@jusst.de>
8 * This program is free software; you can redistribute it and/or modify it
9 * under the terms of the GNU Lesser General Public License as published by
10 * the Free Software Foundation; either version 2.1 of the License, or
11 * (at your option) any later version.
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU Lesser General Public License for more details.
18 * You should have received a copy of the GNU Lesser General Public License
19 * along with this program; if not, write to the Free Software Foundation,
20 * Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
21 *****************************************************************************/
27 #ifdef __native_client__
28 /* NaCl has no working sigwait, but SIGPIPE, for which vlc uses sigwait
29 * currently, is never generated in NaCl. So for SIGPIPE it's safe to instantly
30 * return, for all others run into an assertion. */
35 int sigwait(const sigset_t
*set
, int *sig
)
40 assert(sigismember(&s
, SIGPIPE
));
41 sigdelset(&s
, SIGPIPE
);
42 assert(sigemptyset(&s
));
48 # error sigwait not implemented on your platform!