MentOS  0.8.0
The Mentoring Operating System
Functions
signal.c File Reference

Functions

 _syscall0 (_syscall3(int, sigreturn)
 Implement the sigreturn function. More...
 
sighandler_t signal (int signum, sighandler_t handler)
 Sets the disposition of the signal signum to handler. More...
 
int sigaction (int signum, const sigaction_t *act, sigaction_t *oldact)
 Examine and change a signal action. More...
 
const char * strsignal (int sig)
 Returns the string describing the given signal. More...
 
int sigemptyset (sigset_t *set)
 Prepare an empty set. More...
 
int sigfillset (sigset_t *set)
 Prepare a full set. More...
 
int sigaddset (sigset_t *set, int signum)
 Adds the given signal to the correct set. More...
 
int sigdelset (sigset_t *set, int signum)
 Removes the given signal to the correct set. More...
 
int sigismember (sigset_t *set, int signum)
 Checks if the given signal is part of the set. More...
 

Detailed Description

Function Documentation

◆ _syscall0()

_syscall0 ( _syscall3 int,
sigreturn   
)

Implement the sigreturn function.

List of signals names.

Parameters
intImplement the sigprocmask function.

◆ sigaction()

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

Examine and change a signal action.

Parameters
signumSpecifies the signal and can be any valid signal except SIGKILL and SIGSTOP.
actIf non-NULL, the new action for signal signum is installed from act.
oldactIf non-NULL, the previous action is saved in oldact.
Returns
returns 0 on success; on error, -1 is returned, and errno is set to indicate the error.

◆ sigaddset()

int sigaddset ( sigset_t set,
int  signum 
)

Adds the given signal to the correct set.

Parameters
setThe set to manipulate.
signumThe signalt to handle.
Returns
0 on success and -1 on error.

◆ sigdelset()

int sigdelset ( sigset_t set,
int  signum 
)

Removes the given signal to the correct set.

Parameters
setThe set to manipulate.
signumThe signalt to handle.
Returns
0 on success and -1 on error.

◆ sigemptyset()

int sigemptyset ( sigset_t set)

Prepare an empty set.

Parameters
setThe set to manipulate.
Returns
0 on success and -1 on error.

◆ sigfillset()

int sigfillset ( sigset_t set)

Prepare a full set.

Parameters
setThe set to manipulate.
Returns
0 on success and -1 on error.

◆ sigismember()

int sigismember ( sigset_t set,
int  signum 
)

Checks if the given signal is part of the set.

Parameters
setThe set to manipulate.
signumThe signalt to handle.
Returns
1 if signum is a member of set, 0 if signum is not a member, and -1 on error.

◆ signal()

sighandler_t signal ( int  signum,
sighandler_t  handler 
)

Sets the disposition of the signal signum to handler.

Parameters
signumThe signal number.
handlerThe handler for the signal.
Returns
The previous value of the signal handler, or SIG_ERR on error.

◆ strsignal()

const char* strsignal ( int  sig)

Returns the string describing the given signal.

Parameters
sigThe signal to inquire.
Returns
String representing the signal.