mescc: Support GNU make with POSIX.

* include/linux/x86/syscall.h (SYS_sigprocmask): New macro.
* include/linux/x86_64/syscall.h (SYS_rt_sigprocmask): New macro.
* include/signal.h (SIG_BLOCK, SIG_UNBLOCK, SIG_SETMASK): New macro.
(sigprocmask): Declare.
* lib/linux/gnu.c (sigprocmask): New function.
This commit is contained in:
Jan Nieuwenhuizen 2018-11-10 08:32:42 +01:00
parent 9ecc11ee52
commit 68441476e0
No known key found for this signature in database
GPG key ID: F3C1A0D9C1D65273
5 changed files with 25 additions and 0 deletions

View file

@ -79,4 +79,7 @@
#define SYS_getegid 0x32 #define SYS_getegid 0x32
#define SYS_setgid 0x3e #define SYS_setgid 0x3e
// make+POSIX
#define SYS_sigprocmask 0x7e
#endif // __MES_LINUX_X86_SYSCALL_H #endif // __MES_LINUX_X86_SYSCALL_H

View file

@ -75,4 +75,7 @@
#define SYS_geteuid 0x6b #define SYS_geteuid 0x6b
#define SYS_getegid 0x6c #define SYS_getegid 0x6c
// make+POSIX
#define SYS_rt_sigprocmask 0x0e
#endif // __MES_LINUX_X86_64_SYSCALL_H #endif // __MES_LINUX_X86_64_SYSCALL_H

View file

@ -228,6 +228,12 @@ void* signal (int signum, void * action);
sighandler_t signal (int signum, sighandler_t action); sighandler_t signal (int signum, sighandler_t action);
#endif #endif
int sigemptyset (sigset_t *set); int sigemptyset (sigset_t *set);
#ifndef SIG_BLOCK
#define SIG_BLOCK 0
#define SIG_UNBLOCK 1
#define SIG_SETMASK 2
#endif
int sigprocmask (int how, sigset_t const *set, sigset_t *oldset);
#endif //! WITH_GLIBC #endif //! WITH_GLIBC

View file

@ -29,7 +29,9 @@
#else // ! WITH_GLIBC #else // ! WITH_GLIBC
#if defined (BOOTSTRAP_WITH_POSIX)
#define _POSIX_VERSION 199009L #define _POSIX_VERSION 199009L
#endif
#include <sys/types.h> #include <sys/types.h>
#ifndef NULL #ifndef NULL

View file

@ -198,3 +198,14 @@ setgid (gid_t newgid)
{ {
return _sys_call1 (SYS_setgid, (long)newgid); return _sys_call1 (SYS_setgid, (long)newgid);
} }
// make+POSIX
int
sigprocmask (int how, sigset_t const *set, sigset_t *oldset)
{
#if __i386__
return _sys_call3 (SYS_sigprocmask, (long)how, (long)set, (long)oldset);
#else
return _sys_call3 (SYS_rt_sigprocmask, (long)how, (long)set, (long)oldset);
#endif
}