rpm  4.16.1.2
Macros | Typedefs | Functions
Signal Queue API.

Signal Queue API. More...

Macros

#define RPMSQ_DFL   ((rpmsqAction_t)0)
 SIG_DFL, SIG_IGN and SIG_ERR counterparts. More...
 

Typedefs

typedef void(* rpmsqAction_t) (int signum, siginfo_t *info, void *context)
 Default signal handler prototype. More...
 

Functions

int rpmsqIsCaught (int signum)
 Test if given signal has been caught (while signals blocked). More...
 
int rpmsqActivate (int state)
 Activate (or disable) the signal queue. More...
 
rpmsqAction_t rpmsqSetAction (int signum, rpmsqAction_t handler)
 Set or delete a signal handler for a signal. More...
 
int rpmsqBlock (int op)
 Block or unblock (almost) all signals. More...
 
int rpmsqPoll (void)
 Poll for caught signals, executing their handlers. More...
 

Detailed Description

Signal Queue API.

Macro Definition Documentation

◆ RPMSQ_DFL

#define RPMSQ_DFL   ((rpmsqAction_t)0)

SIG_DFL, SIG_IGN and SIG_ERR counterparts.

Definition at line 27 of file rpmsq.h.

Typedef Documentation

◆ rpmsqAction_t

typedef void(* rpmsqAction_t) (int signum, siginfo_t *info, void *context)

Default signal handler prototype.

Parameters
signumsignal number
info(siginfo_t) signal info
contextsignal context

Definition at line 22 of file rpmsq.h.

Function Documentation

◆ rpmsqActivate()

int rpmsqActivate ( int  state)

Activate (or disable) the signal queue.

Parameters
state1 to enable, 0 to disable
Returns
0 on success, negative on error

◆ rpmsqBlock()

int rpmsqBlock ( int  op)

Block or unblock (almost) all signals.

The operation is "reference counted" so the calls can be nested, and signals are only unblocked when the reference count falls to zero.

Parameters
opSIG_BLOCK/SIG_UNBLOCK
Returns
0 on success, -1 on error

◆ rpmsqIsCaught()

int rpmsqIsCaught ( int  signum)

Test if given signal has been caught (while signals blocked).

Similar to sigismember() but operates on internal signal queue.

Parameters
signumsignal to test for
Returns
1 if caught, 0 if not and -1 on error

◆ rpmsqPoll()

int rpmsqPoll ( void  )

Poll for caught signals, executing their handlers.

Returns
no. active signals found

◆ rpmsqSetAction()

rpmsqAction_t rpmsqSetAction ( int  signum,
rpmsqAction_t  handler 
)

Set or delete a signal handler for a signal.

Parameters
signumsignal number
handlersignal handler or NULL to delete
Returns
previous handler, RPMSQ_ERR on error