Tenok
A Linux-like Real-Time Operating System for Robotics and Internet of Things
Data Structures | Macros | Typedefs | Functions
signal.h File Reference
#include <sys/types.h>
Include dependency graph for signal.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

union  sigval
 
struct  siginfo_t
 
struct  sigaction
 
struct  sigevent
 

Macros

#define SIGUSR1   10
 
#define SIGUSR2   12
 
#define SIGPOLL   29
 
#define SIGSTOP   19
 
#define SIGCONT   18
 
#define SIGKILL   9
 
#define SIGNAL_CNT   6
 
#define SA_SIGINFO   0x2
 
#define SIGEV_NONE   1
 
#define SIGEV_SIGNAL   2
 

Typedefs

typedef uint32_t sigset_t
 
typedef void(* sa_handler_t) (int)
 
typedef void(* sa_sigaction_t) (int, siginfo_t *, void *)
 

Functions

int sigemptyset (sigset_t *set)
 Initialize the signal set given by set to empty, with all signals excluded from the set. More...
 
int sigfillset (sigset_t *set)
 Initialize the signal set to full, including all signals. More...
 
int sigaddset (sigset_t *set, int signum)
 Add a signal into the set. More...
 
int sigdelset (sigset_t *set, int signum)
 Delete a signal from the set. More...
 
int sigismember (const sigset_t *set, int signum)
 Test whether sugnum is a member of the set. More...
 
int sigaction (int signum, const struct sigaction *act, struct sigaction *oldact)
 Set up a signal for the task to catch. More...
 
int sigwait (const sigset_t *set, int *sig)
 Suspend execution of the calling task until one of the signals specified in the signal set becomes pending. More...
 
int pause (void)
 To cause the calling task (or thread) to sleep until a signal is delivered that either terminate the task or cause the invocation of a signal-catching function. More...
 
int kill (pid_t pid, int sig)
 Send a signal to a task. More...
 
int raise (int sig)
 Send a signal to the calling task. More...
 

Function Documentation

◆ kill()

int kill ( pid_t  pid,
int  sig 
)

Send a signal to a task.

Parameters
pidThe task ID to provide.
sigThe signal number to provide.
Return values
int0 on success and nonzero error number on error.

◆ pause()

int pause ( void  )

To cause the calling task (or thread) to sleep until a signal is delivered that either terminate the task or cause the invocation of a signal-catching function.

Return values
int0 on success and nonzero error number on error.

◆ raise()

int raise ( int  sig)

Send a signal to the calling task.

Parameters
sigThe signal number to provide.
Return values
int0 on success and nonzero error number on error.

◆ sigaction()

int sigaction ( int  signum,
const struct sigaction act,
struct sigaction oldact 
)

Set up a signal for the task to catch.

Parameters
signumThe number of the signal to attach.
actPointer of the new action setting.
oldactFor preserving old action.
Return values
int0 on success and nonzero error number on error.

◆ sigaddset()

int sigaddset ( sigset_t *  set,
int  signum 
)

Add a signal into the set.

Parameters
setPointer to the signal set.
signumThe number of the signal to add into the set.
Return values
int0 on success and nonzero error number on error.

◆ sigdelset()

int sigdelset ( sigset_t *  set,
int  signum 
)

Delete a signal from the set.

Parameters
setPointer to the signal set
signumThe number of the signal to delete from the set
Return values
int0 on success and nonzero error number on error.

◆ sigemptyset()

int sigemptyset ( sigset_t *  set)

Initialize the signal set given by set to empty, with all signals excluded from the set.

Parameters
setPointer to the signal set.
Return values
int0 on success and nonzero error number on error.

◆ sigfillset()

int sigfillset ( sigset_t *  set)

Initialize the signal set to full, including all signals.

Parameters
setPointer to the signal set.
Return values
int0 on success and nonzero error number on error.

◆ sigismember()

int sigismember ( const sigset_t *  set,
int  signum 
)

Test whether sugnum is a member of the set.

Parameters
setPointer to the signal set.
signumThe number of the signal to check.
Return values
int0 on success and nonzero error number on error.

◆ sigwait()

int sigwait ( const sigset_t *  set,
int *  sig 
)

Suspend execution of the calling task until one of the signals specified in the signal set becomes pending.

Parameters
setPointer to the signal set.
sigFor returning the caught signal.
Return values
int0 on success and nonzero error number on error.