home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
GEMini Atari
/
GEMini_Atari_CD-ROM_Walnut_Creek_December_1993.iso
/
zip
/
mint
/
mntlib16.lzh
/
MNTLIB16
/
SIGBLOCK.C
< prev
next >
Wrap
C/C++ Source or Header
|
1993-08-03
|
849b
|
56 lines
/* signal blocking stuff for MiNT */
#include <signal.h>
#include <errno.h>
#include <mintbind.h>
#include <unistd.h>
extern int __mint;
extern long _sigpending, _sigmask;
/* checksigs: for TOS: this checks to see if we just unmasked any
* pending signals
*/
static void
checksigs()
{
register int sig;
register long send;
if (send = (_sigpending & ~_sigmask)) {
for (sig = 0; sig < NSIG; sig++) {
if (send & (1L << sig))
kill(0, sig);
}
}
}
long
sigsetmask(mask)
long mask;
{
register long omask;
if (__mint)
return Psigsetmask(mask);
omask = _sigmask;
_sigmask = mask;
checksigs(_sigmask);
return omask;
}
long
sigblock(mask)
long mask;
{
register long omask;
if (__mint)
return Psigblock(mask);
omask = _sigmask;
_sigmask |= mask;
return omask;
}