mirror of
https://github.com/fluencelabs/musl
synced 2025-06-02 09:31:33 +00:00
14 lines
332 B
C
14 lines
332 B
C
|
#include <signal.h>
|
||
|
#include <stddef.h>
|
||
|
#include "syscall.h"
|
||
|
|
||
|
int __sigaction(int, const struct sigaction *, struct sigaction *);
|
||
|
|
||
|
void (*signal(int sig, void (*func)(int)))(int)
|
||
|
{
|
||
|
struct sigaction sa = { .sa_handler = func, .sa_flags = SA_RESTART };
|
||
|
if (__sigaction(sig, &sa, &sa) < 0)
|
||
|
return SIG_ERR;
|
||
|
return sa.sa_handler;
|
||
|
}
|