mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-07-21 01:50:30 +00:00
Introduce sigtimedwait() and sigwaitinfo()
This change also invents sigcountset() and strsignal_r() and improves the quality of siginfo_t handling.
This commit is contained in:
parent
7ae556463a
commit
467a332e38
41 changed files with 887 additions and 345 deletions
23
libc/calls/struct/siginfo-meta.internal.h
Normal file
23
libc/calls/struct/siginfo-meta.internal.h
Normal file
|
@ -0,0 +1,23 @@
|
|||
#ifndef COSMOPOLITAN_LIBC_CALLS_STRUCT_SIGINFO_META_INTERNAL_H_
|
||||
#define COSMOPOLITAN_LIBC_CALLS_STRUCT_SIGINFO_META_INTERNAL_H_
|
||||
#include "libc/calls/struct/siginfo-freebsd.internal.h"
|
||||
#include "libc/calls/struct/siginfo-netbsd.internal.h"
|
||||
#include "libc/calls/struct/siginfo-openbsd.internal.h"
|
||||
#include "libc/calls/struct/siginfo-xnu.internal.h"
|
||||
#include "libc/calls/struct/siginfo.h"
|
||||
#if !(__ASSEMBLER__ + __LINKER__ + 0)
|
||||
COSMOPOLITAN_C_START_
|
||||
|
||||
union siginfo_meta {
|
||||
struct siginfo linux;
|
||||
struct siginfo_xnu xnu;
|
||||
struct siginfo_freebsd freebsd;
|
||||
struct siginfo_openbsd openbsd;
|
||||
struct siginfo_netbsd netbsd;
|
||||
};
|
||||
|
||||
void __siginfo2cosmo(struct siginfo *, const union siginfo_meta *) hidden;
|
||||
|
||||
COSMOPOLITAN_C_END_
|
||||
#endif /* !(__ASSEMBLER__ + __LINKER__ + 0) */
|
||||
#endif /* COSMOPOLITAN_LIBC_CALLS_STRUCT_SIGINFO_META_INTERNAL_H_ */
|
|
@ -12,11 +12,13 @@ struct siginfo {
|
|||
struct {
|
||||
union {
|
||||
struct {
|
||||
/* signals sent by kill() and sigqueue() set these */
|
||||
int32_t si_pid;
|
||||
uint32_t si_uid;
|
||||
};
|
||||
struct {
|
||||
int32_t si_timerid; /* SIGALRM */
|
||||
/* SIGALRM sets these */
|
||||
int32_t si_timerid;
|
||||
int32_t si_overrun;
|
||||
};
|
||||
};
|
||||
|
|
|
@ -3,6 +3,7 @@
|
|||
#include "libc/calls/struct/sigaction-xnu.internal.h"
|
||||
#include "libc/calls/struct/siginfo-xnu.internal.h"
|
||||
#include "libc/calls/struct/siginfo.h"
|
||||
#include "libc/mem/alloca.h"
|
||||
#if !(__ASSEMBLER__ + __LINKER__ + 0)
|
||||
COSMOPOLITAN_C_START_
|
||||
|
||||
|
@ -10,6 +11,9 @@ int sys_sigqueueinfo(int, const siginfo_t *) hidden;
|
|||
void __sigenter_xnu(void *, int, int, struct siginfo_xnu *,
|
||||
struct __darwin_ucontext *) hidden;
|
||||
|
||||
const char *DescribeSiginfo(char[300], int, const siginfo_t *);
|
||||
#define DescribeSiginfo(x, y) DescribeSiginfo(alloca(300), x, y)
|
||||
|
||||
COSMOPOLITAN_C_END_
|
||||
#endif /* !(__ASSEMBLER__ + __LINKER__ + 0) */
|
||||
#endif /* COSMOPOLITAN_LIBC_CALLS_STRUCT_SIGINFO_INTERNAL_H_ */
|
||||
|
|
|
@ -13,11 +13,12 @@ int sigemptyset(sigset_t *) paramsnonnull();
|
|||
int sigfillset(sigset_t *) paramsnonnull();
|
||||
int sigandset(sigset_t *, const sigset_t *, const sigset_t *) paramsnonnull();
|
||||
int sigorset(sigset_t *, const sigset_t *, const sigset_t *) paramsnonnull();
|
||||
int sigisemptyset(const sigset_t *) paramsnonnull();
|
||||
int sigisemptyset(const sigset_t *) paramsnonnull() nosideeffect;
|
||||
int sigismember(const sigset_t *, int) paramsnonnull() nosideeffect;
|
||||
int sigcountset(const sigset_t *) paramsnonnull() nosideeffect;
|
||||
int sigprocmask(int, const sigset_t *, sigset_t *);
|
||||
int sigsuspend(const sigset_t *);
|
||||
int sigpending(sigset_t *) paramsnonnull() nosideeffect;
|
||||
int sigpending(sigset_t *);
|
||||
int pthread_sigmask(int, const sigset_t *, sigset_t *);
|
||||
|
||||
COSMOPOLITAN_C_END_
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue