ack/lang/cem/libcc.ansi/core/setjmp/sigmisc.c

41 lines
719 B
C
Raw Permalink Normal View History

1990-01-22 12:53:21 +00:00
/*
* sigmisc.c - used to get a signal mask
*/
1994-06-24 14:02:31 +00:00
/* $Id$ */
1990-01-22 12:53:21 +00:00
2018-06-21 20:33:47 +00:00
#if defined(_POSIX_SOURCE)
1990-01-22 12:53:21 +00:00
/* This can't be done in setjmp.e, since SIG_SETMASK is defined in
* <signal.h>. This is a C-file, which can't be included.
*/
2018-06-21 20:33:47 +00:00
#include <sys/types.h>
#include <signal.h>
#include <stddef.h>
1990-01-22 12:53:21 +00:00
2018-06-21 20:33:47 +00:00
int _sigprocmask(int, sigset_t*, sigset_t*);
1990-01-22 12:53:21 +00:00
static void
2018-06-21 20:33:47 +00:00
__testsigset(void)
{
1990-01-22 12:53:21 +00:00
/* This switch compiles when a sigset_t has the right size. */
2018-06-21 20:33:47 +00:00
switch (0)
{
case 0:
case sizeof(sigset_t) <= sizeof(long):
break;
1990-01-22 12:53:21 +00:00
}
}
2018-06-21 20:33:47 +00:00
void __newsigset(sigset_t* p)
1990-01-22 12:53:21 +00:00
{
/* The SIG_SETMASK is not significant */
_sigprocmask(SIG_SETMASK, NULL, p);
}
2018-06-21 20:33:47 +00:00
void __oldsigset(sigset_t* p)
1990-01-22 12:53:21 +00:00
{
_sigprocmask(SIG_SETMASK, p, NULL);
}
2018-06-21 20:33:47 +00:00
#endif /* _POSIX_SOURCE */