rpm 4.15.1

Macros | Typedefs | Functions
Signal Queue API.

Signal Queue API. More...

## Macros
#define | RPMSQ_DFL ((rpmsqAction_t)0)

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

## Functions
int | rpmsqIsCaught (int signum)
int | rpmsqActivate (int state)
rpmsqAction_t | rpmsqSetAction (int signum, rpmsqAction_t handler)
int | rpmsqBlock (int op)
int | rpmsqPoll (void)

## 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

  signum | signal number
  info | (siginfo_t) signal info
  context | signal context

Definition at line 22 of file rpmsq.h.

## Function Documentation

## ◆ rpmsqActivate()

int rpmsqActivate | ( | int | state | ) |

Activate (or disable) the signal queue.

Parameters

  state | 1 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

  op | SIG_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

  signum | signal 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

  signum | signal number
  handler | signal handler or NULL to delete

Returns
  previous handler, RPMSQ_ERR on error