mirror of
https://github.com/fluencelabs/musl
synced 2025-05-29 07:31:53 +00:00
header cleanup, conformance fixes - signals
This commit is contained in:
parent
c316b28445
commit
1322cb82a3
@ -1,3 +1,6 @@
|
|||||||
|
#if defined(_POSIX_SOURCE) || defined(_POSIX_C_SOURCE) \
|
||||||
|
|| defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE)
|
||||||
|
|
||||||
struct __siginfo
|
struct __siginfo
|
||||||
{
|
{
|
||||||
int si_signo;
|
int si_signo;
|
||||||
@ -57,12 +60,17 @@ struct __siginfo
|
|||||||
#define SIG_UNBLOCK 1
|
#define SIG_UNBLOCK 1
|
||||||
#define SIG_SETMASK 2
|
#define SIG_SETMASK 2
|
||||||
|
|
||||||
|
#define SIG_HOLD ((void (*)(int)) 2)
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef _GNU_SOURCE
|
||||||
|
#define NSIG 64
|
||||||
|
#endif
|
||||||
|
|
||||||
#define SIG_ERR ((void (*)(int))-1)
|
#define SIG_ERR ((void (*)(int))-1)
|
||||||
#define SIG_DFL ((void (*)(int)) 0)
|
#define SIG_DFL ((void (*)(int)) 0)
|
||||||
#define SIG_IGN ((void (*)(int)) 1)
|
#define SIG_IGN ((void (*)(int)) 1)
|
||||||
#define SIG_HOLD ((void (*)(int)) 2)
|
|
||||||
|
|
||||||
#define NSIG 64
|
|
||||||
|
|
||||||
#define SIGHUP 1
|
#define SIGHUP 1
|
||||||
#define SIGINT 2
|
#define SIGINT 2
|
||||||
|
@ -5,6 +5,9 @@
|
|||||||
extern "C" {
|
extern "C" {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if defined(_POSIX_SOURCE) || defined(_POSIX_C_SOURCE) \
|
||||||
|
|| defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE)
|
||||||
|
|
||||||
#define __NEED_size_t
|
#define __NEED_size_t
|
||||||
#define __NEED_pid_t
|
#define __NEED_pid_t
|
||||||
#define __NEED_uid_t
|
#define __NEED_uid_t
|
||||||
@ -17,8 +20,6 @@ extern "C" {
|
|||||||
|
|
||||||
#include <bits/alltypes.h>
|
#include <bits/alltypes.h>
|
||||||
|
|
||||||
typedef int sig_atomic_t;
|
|
||||||
|
|
||||||
struct sigaction
|
struct sigaction
|
||||||
{
|
{
|
||||||
union {
|
union {
|
||||||
@ -53,12 +54,7 @@ int __libc_current_sigrtmax(void);
|
|||||||
#define SIGRTMIN (__libc_current_sigrtmin())
|
#define SIGRTMIN (__libc_current_sigrtmin())
|
||||||
#define SIGRTMAX (__libc_current_sigrtmax())
|
#define SIGRTMAX (__libc_current_sigrtmax())
|
||||||
|
|
||||||
void (*signal(int, void (*)(int)))(int);
|
|
||||||
void (*bsd_signal(int, void (*)(int)))(int);
|
|
||||||
int kill(pid_t, int);
|
int kill(pid_t, int);
|
||||||
int killpg(pid_t, int);
|
|
||||||
int raise(int);
|
|
||||||
int sigpause(int);
|
|
||||||
|
|
||||||
int sigemptyset(sigset_t *);
|
int sigemptyset(sigset_t *);
|
||||||
int sigfillset(sigset_t *);
|
int sigfillset(sigset_t *);
|
||||||
@ -75,22 +71,32 @@ int sigwaitinfo(const sigset_t *, siginfo_t *);
|
|||||||
int sigtimedwait(const sigset_t *, siginfo_t *, const struct timespec *);
|
int sigtimedwait(const sigset_t *, siginfo_t *, const struct timespec *);
|
||||||
int sigqueue(pid_t, int, const union sigval);
|
int sigqueue(pid_t, int, const union sigval);
|
||||||
|
|
||||||
int siginterrupt(int, int);
|
|
||||||
|
|
||||||
int sigaltstack(const stack_t *, stack_t *);
|
|
||||||
|
|
||||||
int sighold(int);
|
|
||||||
int sigrelse(int);
|
|
||||||
int sigignore(int);
|
|
||||||
void (*sigset(int, void (*)(int)))(int);
|
|
||||||
|
|
||||||
int pthread_sigmask(int, const sigset_t *, sigset_t *);
|
int pthread_sigmask(int, const sigset_t *, sigset_t *);
|
||||||
int pthread_kill(pthread_t, int);
|
int pthread_kill(pthread_t, int);
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE)
|
||||||
|
int killpg(pid_t, int);
|
||||||
|
int sigaltstack(const stack_t *, stack_t *);
|
||||||
|
int sighold(int);
|
||||||
|
int sigignore(int);
|
||||||
|
int siginterrupt(int, int);
|
||||||
|
int sigpause(int);
|
||||||
|
int sigrelse(int);
|
||||||
|
void (*sigset(int, void (*)(int)))(int);
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef _GNU_SOURCE
|
#ifdef _GNU_SOURCE
|
||||||
typedef int (*sighandler_t)(int);
|
typedef int (*sighandler_t)(int);
|
||||||
|
void (*bsd_signal(int, void (*)(int)))(int);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
typedef int sig_atomic_t;
|
||||||
|
|
||||||
|
void (*signal(int, void (*)(int)))(int);
|
||||||
|
int raise(int);
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
@ -1,6 +0,0 @@
|
|||||||
#include <signal.h>
|
|
||||||
|
|
||||||
void (*bsd_signal(int sig, void (*func)(int)))(int)
|
|
||||||
{
|
|
||||||
return signal(sig, func);
|
|
||||||
}
|
|
@ -1,6 +1,7 @@
|
|||||||
#include <signal.h>
|
#include <signal.h>
|
||||||
#include <stddef.h>
|
#include <stddef.h>
|
||||||
#include "syscall.h"
|
#include "syscall.h"
|
||||||
|
#include "libc.h"
|
||||||
|
|
||||||
int __sigaction(int, const struct sigaction *, struct sigaction *);
|
int __sigaction(int, const struct sigaction *, struct sigaction *);
|
||||||
|
|
||||||
@ -11,3 +12,5 @@ void (*signal(int sig, void (*func)(int)))(int)
|
|||||||
return SIG_ERR;
|
return SIG_ERR;
|
||||||
return sa.sa_handler;
|
return sa.sa_handler;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
weak_alias(signal, bsd_signal);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user