typedef _VOID_PTR jmp_buf[5];

_PROTOTYPE(extern _VOID longjmp(jmp_buf buf, unsigned int ret));
_PROTOTYPE(extern int setjmp(jmp_buf buf));

#define SIGHUP	1
#define SIGINT	2
#define SIGQUIT	3
#define SIGILL	4
#define SIGABRT	6
#define SIGFPE	8
#define SIGKILL	9
#define SIGUSR1	10
#define SIGSEGV	11
#define SIGUSR2	12
#define SIGPIPE	13
#define SIGALRM	14
#define SIGTERM	15
#define SIGCHLD	17
#define SIGCONT	18
#define SIGTSTP	20

#define SIG_DFL ((_VOID_PTR)0)
#define SIG_IGN ((_VOID_PTR)1)

union sigval {
	int sival_int;
	_VOID_PTR sival_ptr;
};

struct sigset {
	unsigned int val[16];
};

struct sigaction {
	/* Pointer to a signal-catching function or one of the macros SIG_IGN or SIG_DFL. */
	_VOID (*sa_handler), (unsigned int));

	/* Set of signals to be blocked during execution of the signal handling function. */
	struct sigset sa_mask;

	/* Special flags. */
	unsigned int sa_flags;

	/* Pointer to a signal-catching function. */
	_VOID (*sa_restorer), (_VOID));
};

_PROTOTYPE(extern int kill, (unsigned int fd, unsigned int sig));
_PROTOTYPE(extern int rt_sigaction, (unsigned int sig, _CONST struct sigaction *act, struct sigaction *oldact));
_PROTOTYPE(extern int signal, (unsigned int sig, _VOID (*handler), (unsigned int)));
_PROTOTYPE(extern int raise, (unsigned int sig));

#define ISIG	0000001
#define ICANON	0000002
#define ECHO	0000010

#define TCSANOW 0
#define TCSADRAIN 1
#define TCSAFLUSH 2

struct termios {
	unsigned int c_iflag;
	unsigned int c_oflag;
	unsigned int c_cflag;
	unsigned int c_lflag;
	unsigned int c_line;
	unsigned int c_cc[32];
	unsigned int __c_ispeed;
	unsigned int __c_ospeed;
};

#define CLOCK_REALTIME 0
#define CLOCK_MONOTONIC 1
#define CLOCK_TAI 11

_PROTOTYPE(extern int nanosleep(struct timespec *duration, struct timespec *rem));
_PROTOTYPE(extern int clock_gettime, (unsigned int clockid, struct timespec *tp));
_PROTOTYPE(extern int clock_settime, (unsigned int clockid, _CONST struct timespec *tp));

#define SEEK_SET 0
#define SEEK_CUR 1
#define SEEK_END 2

_PROTOTYPE(extern _VOID halt, (unsigned int status));
_PROTOTYPE(extern int setsid, (_VOID));
_PROTOTYPE(extern int dup3, (unsigned int oldfd, unsigned int newfd, unsigned int flags));

#endif
