mirror of
git://sourceware.org/git/newlib-cygwin.git
synced 2025-01-15 19:09:58 +08:00
fd450adfe7
* libc/unix/basename.c: Add !_NO_BASENAME flag check so code can be ignored if desired by a platform. * libc/unix/dirname.c: Ditto except replace BASENAME with file name. * libc/unix/getcwd.c: Ditto. * libc/unix/getlogin.c: Ditto. * libc/unix/getpass.c: Ditto. * libc/unix/getpwent.c: Ditto. * libc/unix/getut.c: Ditto. * libc/unix/pread.c: Ditto. * libc/unix/pwrite.c: Ditto. * libc/unix/sigset.c: Ditto.
68 lines
996 B
C
68 lines
996 B
C
#ifndef _NO_SIGSET
|
|
|
|
#include <signal.h>
|
|
#include <errno.h>
|
|
|
|
#if defined(SIG_SETMASK) && NSIG <= 32 /* easier than trying to remove from Makefile */
|
|
|
|
#undef sigemptyset
|
|
int
|
|
sigemptyset (sigset_t * set)
|
|
{
|
|
*set = (sigset_t) 0;
|
|
return 0;
|
|
}
|
|
|
|
#undef sigfillset
|
|
int
|
|
sigfillset (sigset_t * set)
|
|
{
|
|
*set = ~((sigset_t) 0);
|
|
return 0;
|
|
}
|
|
|
|
#undef sigaddset
|
|
int
|
|
sigaddset (sigset_t * set, int signo)
|
|
{
|
|
if (signo >= NSIG || signo <= 0)
|
|
{
|
|
errno = EINVAL;
|
|
return -1;
|
|
}
|
|
*set |= 1 << (signo - 1);
|
|
return 0;
|
|
}
|
|
|
|
#undef sigdelset
|
|
int
|
|
sigdelset (sigset_t * set, int signo)
|
|
{
|
|
if (signo >= NSIG || signo <= 0)
|
|
{
|
|
errno = EINVAL;
|
|
return -1;
|
|
}
|
|
*set &= ~(1 << (signo - 1));
|
|
return 0;
|
|
}
|
|
|
|
#undef sigismember
|
|
int
|
|
sigismember (const sigset_t * set, int signo)
|
|
{
|
|
if (signo >= NSIG || signo <= 0)
|
|
{
|
|
errno = EINVAL;
|
|
return -1;
|
|
}
|
|
|
|
if (*set & (1 << (signo - 1)))
|
|
return 1;
|
|
else
|
|
return 0;
|
|
}
|
|
|
|
#endif /* SIG_SETMASK */
|
|
#endif /* _NO_SIGSET */
|