mirror of
https://github.com/fluencelabs/musl
synced 2025-06-11 14:01:34 +00:00
optimize compound-literal sigset_t's not to contain useless hurd bits
This commit is contained in:
@ -79,8 +79,10 @@ struct __timer {
|
|||||||
#define SIGCANCEL 33
|
#define SIGCANCEL 33
|
||||||
#define SIGSYSCALL 34
|
#define SIGSYSCALL 34
|
||||||
|
|
||||||
#define SIGPT_SET ((sigset_t){{[sizeof(long)==4] = 3<<(32*(sizeof(long)>4))}})
|
#define SIGPT_SET ((sigset_t *)(unsigned long [1+(sizeof(long)==4)]){ \
|
||||||
#define SIGTIMER_SET ((sigset_t){{ 0x80000000 }})
|
[sizeof(long)==4] = 3<<(32*(sizeof(long)>4)) })
|
||||||
|
#define SIGTIMER_SET ((sigset_t *)(unsigned long [1+(sizeof(long)==4)]){ \
|
||||||
|
0x80000000 })
|
||||||
|
|
||||||
int __set_thread_area(void *);
|
int __set_thread_area(void *);
|
||||||
int __libc_sigaction(int, const struct sigaction *, struct sigaction *);
|
int __libc_sigaction(int, const struct sigaction *, struct sigaction *);
|
||||||
|
@ -45,7 +45,7 @@ static int start(void *p)
|
|||||||
{
|
{
|
||||||
struct pthread *self = p;
|
struct pthread *self = p;
|
||||||
if (self->unblock_cancel)
|
if (self->unblock_cancel)
|
||||||
__syscall(SYS_rt_sigprocmask, SIG_UNBLOCK, &SIGPT_SET, 0, 8);
|
__syscall(SYS_rt_sigprocmask, SIG_UNBLOCK, SIGPT_SET, 0, 8);
|
||||||
pthread_exit(self->start(self->start_arg));
|
pthread_exit(self->start(self->start_arg));
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@ -68,7 +68,7 @@ int pthread_create(pthread_t *res, const pthread_attr_t *attr, void *(*entry)(vo
|
|||||||
|
|
||||||
if (!self) return ENOSYS;
|
if (!self) return ENOSYS;
|
||||||
if (!libc.threaded) {
|
if (!libc.threaded) {
|
||||||
__syscall(SYS_rt_sigprocmask, SIG_UNBLOCK, &SIGPT_SET, 0, 8);
|
__syscall(SYS_rt_sigprocmask, SIG_UNBLOCK, SIGPT_SET, 0, 8);
|
||||||
libc.threaded = 1;
|
libc.threaded = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -51,7 +51,7 @@ static void install_handler()
|
|||||||
.sa_flags = SA_SIGINFO | SA_RESTART
|
.sa_flags = SA_SIGINFO | SA_RESTART
|
||||||
};
|
};
|
||||||
__libc_sigaction(SIGTIMER, &sa, 0);
|
__libc_sigaction(SIGTIMER, &sa, 0);
|
||||||
__syscall(SYS_rt_sigprocmask, SIG_UNBLOCK, &SIGTIMER_SET, 0, 8);
|
__syscall(SYS_rt_sigprocmask, SIG_UNBLOCK, SIGTIMER_SET, 0, 8);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void *start(void *arg)
|
static void *start(void *arg)
|
||||||
|
Reference in New Issue
Block a user