rpm  4.8.1
Typedefs | Functions | Variables
rpmsq.h File Reference
#include <rpm/rpmsw.h>
#include <signal.h>
Include dependency graph for rpmsq.h:

Go to the source code of this file.

Typedefs

typedef struct rpmsig_s * rpmsig
 
typedef struct rpmsqElem * rpmsq
 
typedef void(* rpmsqAction_t) (int signum)
 Default signal handler prototype. More...
 

Functions

int rpmsqIsCaught (int signum)
 Test if given signal has been caught (while signals blocked). More...
 
void rpmsqAction (int signum)
 Default signal handler. More...
 
int rpmsqEnable (int signum, rpmsqAction_t handler)
 Enable or disable a signal handler. More...
 
pid_t rpmsqFork (rpmsq sq)
 Fork a child process. More...
 
pid_t rpmsqWait (rpmsq sq)
 Wait for child process to be reaped. More...
 
void * rpmsqThread (void *(*start)(void *arg), void *arg)
 Call a function in a thread. More...
 
int rpmsqJoin (void *thread)
 Wait for thread to terminate. More...
 
int rpmsqThreadEqual (void *thread)
 Compare thread with current thread. More...
 
int rpmsqExecve (const char **argv)
 Execute a command, returning its status. More...
 

Variables

int _rpmsq_debug
 

Typedef Documentation

◆ rpmsig

typedef struct rpmsig_s* rpmsig

Definition at line 21 of file rpmsq.h.

◆ rpmsq

typedef struct rpmsqElem* rpmsq

Definition at line 25 of file rpmsq.h.

◆ rpmsqAction_t

typedef void(* rpmsqAction_t) (int signum)

Default signal handler prototype.

Parameters
signumsignal number
info(siginfo_t) signal info
contextsignal context

Definition at line 36 of file rpmsq.h.

Function Documentation

◆ rpmsqAction()

void rpmsqAction ( int  signum)

Default signal handler.

Parameters
signumsignal number
info(siginfo_t) signal info
contextsignal context

◆ rpmsqEnable()

int rpmsqEnable ( int  signum,
rpmsqAction_t  handler 
)

Enable or disable a signal handler.

Parameters
signumsignal to enable (or disable if negative)
handlersa_sigaction handler (or NULL to use rpmsqHandler())
Returns
no. of refs, -1 on error

◆ rpmsqExecve()

int rpmsqExecve ( const char **  argv)

Execute a command, returning its status.

◆ rpmsqFork()

pid_t rpmsqFork ( rpmsq  sq)

Fork a child process.

Parameters
sqscriptlet queue element
Returns
fork(2) pid

◆ 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

◆ rpmsqJoin()

int rpmsqJoin ( void *  thread)

Wait for thread to terminate.

Parameters
threadthread
Returns
0 on success

◆ rpmsqThread()

void* rpmsqThread ( void *(*)(void *arg)  start,
void *  arg 
)

Call a function in a thread.

Parameters
startfunction
argfunction argument
Returns
thread pointer (NULL on error)

◆ rpmsqThreadEqual()

int rpmsqThreadEqual ( void *  thread)

Compare thread with current thread.

Parameters
threadthread
Returns
0 if not equal

◆ rpmsqWait()

pid_t rpmsqWait ( rpmsq  sq)

Wait for child process to be reaped.

Parameters
sqscriptlet queue element
Returns
reaped child pid

Variable Documentation

◆ _rpmsq_debug

int _rpmsq_debug