#ifndef _SIGNAL_H
#define _SIGNAL_H

#include <_ansi.h>
#include <time.h>
#include <sys/types.h>
#include <sys/signal.h>


/* Atomic entity type */
typedef volatile int sig_atomic_t;


#ifdef __cplusplus
extern "C" {
#endif

/*
 *  signal handling
 */
int	    _EXFUN(sigaction,   (int signum, const struct sigaction *act, struct sigaction *oldact));
int		_EXFUN(sigprocmask, (int how, const sigset_t *set, sigset_t *oldset));
int		_EXFUN(sigpending,  (sigset_t *set));
int		_EXFUN(sigsuspend,  (const sigset_t *set));

/*
 *  sigset handling
 */
int		_EXFUN(sigemptyset, (sigset_t *set));
int		_EXFUN(sigfillset,  (sigset_t *set));
int		_EXFUN(sigaddset,   (sigset_t *set, int signo));
int		_EXFUN(sigdelset,   (sigset_t *set, int signo));
int		_EXFUN(sigismember, (const sigset_t *set, int signo));

/*
 *  kill
 */
int	    _EXFUN(kill,  (pid_t pid, int sig));
int	    _EXFUN(raise, (int sig));

/*
 *  legacy functions
 */
#define sigmask(x)      (1ul << ((x) - 1))

sighandler_t _EXFUN(signal, (int signum, sighandler_t handler));

int     _EXFUN(sigblock,   (int mask));
int     _EXFUN(siggetmask, (void));
int     _EXFUN(sigsetmask, (int mask));

#ifdef __cplusplus
}
#endif

#endif

