PinCRT
Classes | Functions
Signals

Classes

struct  SIGACTION
 

Functions

OS_RETURN_CODE OS_SendSignalToProcess (NATIVE_PID pid, INT signal)
 
OS_RETURN_CODE OS_SigProcMask (INT how, const SIGSET_T *set, SIGSET_T *oldset)
 
OS_RETURN_CODE OS_SigAction (INT signum, const struct SIGACTION *act, struct SIGACTION *oldact)
 
OS_RETURN_CODE OS_SigSuspend (const SIGSET_T *mask)
 
OS_RETURN_CODE OS_SigPending (const SIGSET_T *set)
 
OS_RETURN_CODE OS_SendSignalToThread (NATIVE_PID pid, NATIVE_TID tid, UINT32 signal)
 

Detailed Description

Function Documentation

◆ OS_SendSignalToProcess()

OS_RETURN_CODE OS_SendSignalToProcess ( NATIVE_PID  pid,
INT  signal 
)

Send signal to a process. This function is compatible with POSIX kill().

Parameters
[in]pidThe process to send signal to.
[in]signalThe signal to send.
Returns
Operation status code.
Availability:
O/S: Linux & macOS*
CPU: All

◆ OS_SendSignalToThread()

OS_RETURN_CODE OS_SendSignalToThread ( NATIVE_PID  pid,
NATIVE_TID  tid,
UINT32  signal 
)

Send signal to a particular thread inside a process.

Parameters
[in]pidThe process ID where the thread is running.if it's INVALID_NATIVE_PID then we ignore the pid.
[in]tidThe thread ID to send the signal to.
[in]signalThe signal to send.
Returns
Operation status code.
Availability:
O/S: Linux & macOS*
CPU: All

◆ OS_SigAction()

OS_RETURN_CODE OS_SigAction ( INT  signum,
const struct SIGACTION act,
struct SIGACTION oldact 
)

Change the action taken by a process on receipt of a specific signal. This function is compatible with POSIX sigaction().

Parameters
[in]signumThe signal to alter its behavior.
[in]actThe action to be taken upon signal reception.
[in]oldactThe previous action that was taken upon signal reception.
Returns
Operation status code.
Availability:
O/S: Linux & macOS*
CPU: All

◆ OS_SigPending()

OS_RETURN_CODE OS_SigPending ( const SIGSET_T *  set)

Returns the set of signals that are pending for delivery to the calling thread (i.e., the signals which have been raised while blocked). The mask of pending signals is returned in set.

Parameters
[out]setWhere to store the signal set.
Returns
Operation status code.
Availability:
O/S: Linux & macOS*
CPU: All

◆ OS_SigProcMask()

OS_RETURN_CODE OS_SigProcMask ( INT  how,
const SIGSET_T *  set,
SIGSET_T *  oldset 
)

Change the signal mask, the set of currently blocked signals for the current thread. This function is compatible with POSIX sigprocmask().

Parameters
[in]howSpecifies how to alter the blocked signals mask: SIG_BLOCK: The set of blocked signals is the union of the current set and the set argument. SIG_UNBLOCK: The signals in set are removed from the current set of blocked signals. It is legal to attempt to unblock a signal which is not blocked. SIG_SETMASK: The set of blocked signals is set to the argument set.
[in]setThe signal set to alter.
[in]oldsetThe previous blocked signals set.
Returns
Operation status code.
Availability:
O/S: Linux & macOS*
CPU: All

◆ OS_SigSuspend()

OS_RETURN_CODE OS_SigSuspend ( const SIGSET_T *  mask)

Temporarily replaces the signal mask of the calling process with the mask given by mask and then suspends the process until delivery of a signal whose action is to invoke a signal handler or to terminate a process.

Parameters
[in]maskThe mask to use for the signals
Returns
Operation status code.
Availability:
O/S: Linux & macOS*
CPU: All