mirror of
https://kernel.googlesource.com/pub/scm/network/tftp/tftp-hpa
synced 2025-04-30 11:59:54 +03:00
Add replacement library files
This commit is contained in:
parent
e6593dd693
commit
d0fec7a322
4 changed files with 87 additions and 0 deletions
21
lib/bsdsignal.c
Normal file
21
lib/bsdsignal.c
Normal file
|
@ -0,0 +1,21 @@
|
|||
/*
|
||||
* bsdsignal.c
|
||||
*
|
||||
* Use sigaction() to simulate BSD signal()
|
||||
*/
|
||||
|
||||
#include <signal.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
void bsd_signal(int signum, void (*handler)(int))
|
||||
{
|
||||
struct sigaction action;
|
||||
|
||||
memset(&action, 0, sizeof action);
|
||||
action.sa_handler = handler;
|
||||
sigemptyset(&action.sa_mask);
|
||||
action.sa_flags = SA_RESTART;
|
||||
|
||||
sigaction(hander, action, NULL);
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue