rpm  5.4.14
rpmsq.h
Go to the documentation of this file.
1 #ifndef H_RPMSQ
2 #define H_RPMSQ
3 
9 #include <unistd.h>
10 #include <rpmsw.h>
11 
14 typedef struct rpmsig_s * rpmsig;
15 
18 typedef struct rpmsqElem * rpmsq;
19 
26 typedef void (*rpmsqAction_t) (int signum, void * info, void * context)
27  /*@*/;
28 
29 /*@-redecl@*/
30 /*@unchecked@*/
31 extern int _rpmsq_debug;
32 /*@=redecl@*/
33 
34 #if defined(_RPMSQ_INTERNAL)
35 
38 struct rpmsqElem {
39  struct rpmsqElem * q_forw;
40  struct rpmsqElem * q_back;
41  pid_t child;
42  volatile pid_t reaped;
43  volatile int status;
44  struct rpmop_s op;
45  rpmtime_t ms_scriptlets;
46  int reaper;
47  int pipes[2];
48 /*@shared@*/
49  void * id;
50 };
51 #endif
52 
53 /*@-exportlocal@*/
54 /*@unchecked@*/
55 extern rpmsq rpmsqQueue;
56 /*@=exportlocal@*/
57 
58 /*@unchecked@*/
59 extern sigset_t rpmsqCaught;
60 
61 #ifdef __cplusplus
62 extern "C" {
63 #endif
64 
71 /*@-exportlocal@*/
72 int rpmsqInsert(/*@null@*/ void * elem, /*@null@*/ void * prev)
73  /*@globals rpmsqQueue, systemState @*/
74  /*@modifies elem, prev, rpmsqQueue, systemState @*/;
75 /*@=exportlocal@*/
76 
82 /*@-exportlocal@*/
83 int rpmsqRemove(/*@null@*/ void * elem)
84  /*@globals fileSystem, internalState @*/
85  /*@modifies elem, fileSystem, internalState @*/;
86 /*@=exportlocal@*/
87 
94 /*@-exportlocal@*/
95 void rpmsqAction(int signum, void * info, void * context)
96  /*@globals rpmsqCaught, rpmsqQueue, errno, fileSystem, internalState @*/
97  /*@modifies rpmsqCaught, rpmsqQueue, errno,
98  fileSystem, internalState @*/;
99 /*@=exportlocal@*/
100 
107 int rpmsqEnable(int signum, /*@null@*/ rpmsqAction_t handler)
108  /*@globals rpmsqCaught, rpmsqQueue, fileSystem, internalState @*/
109  /*@modifies rpmsqCaught, rpmsqQueue, fileSystem, internalState @*/;
110 
116 pid_t rpmsqFork(rpmsq sq)
117  /*@globals fileSystem, internalState @*/
118  /*@modifies sq, fileSystem, internalState @*/;
119 
125 pid_t rpmsqWait(rpmsq sq)
126  /*@globals fileSystem, internalState @*/
127  /*@modifies sq, fileSystem, internalState @*/;
128 
135 void * rpmsqThread(void * (*start) (void * arg), void * arg)
136  /*@globals internalState @*/
137  /*@modifies internalState @*/;
138 
144 int rpmsqJoin(/*@null@*/ void * thread)
145  /*@globals internalState @*/
146  /*@modifies internalState @*/;
147 
153 int rpmsqThreadEqual(/*@null@*/ void * thread)
154  /*@globals internalState @*/
155  /*@modifies internalState @*/;
156 
160 int rpmsqExecve (const char ** argv)
161  /*@globals fileSystem, internalState @*/
162  /*@modifies fileSystem, internalState @*/;
163 
164 #ifdef __cplusplus
165 }
166 #endif
167 
168 #endif /* H_RPMSQ */
rpmsq rpmsqQueue
Definition: rpmsq.c:288
void(* rpmsqAction_t)(int signum, void *info, void *context)
Default signal handler prototype.
Definition: rpmsq.h:26
unsigned long int rpmtime_t
Definition: rpmsw.h:16
pid_t rpmsqWait(rpmsq sq)
Wait for child process to be reaped.
Definition: rpmsq.c:624
pid_t rpmsqFork(rpmsq sq)
Fork a child process.
Definition: rpmsq.c:495
struct rpmsqElem * rpmsq
Definition: rpmsq.h:18
void * rpmsqThread(void *(*start)(void *arg), void *arg)
Call a function in a thread.
Definition: rpmsq.c:656
argv
Definition: rpmmtree.c:3679
int _rpmsq_debug
Definition: rpmsq.c:278
int rpmsqJoin(void *thread)
Wait for thread to terminate.
Definition: rpmsq.c:671
void rpmsqAction(int signum, void *info, void *context)
Default signal handler.
Definition: rpmsq.c:390
Cumulative statistics for an operation.
Definition: rpmsw.h:39
sigset_t rpmsqCaught
Definition: rpmsq.c:352
int rpmsqRemove(void *elem)
Remove node from queue.
Definition: rpmsq.c:320
int rpmsqInsert(void *elem, void *prev)
Insert node into from queue.
Definition: rpmsq.c:291
int rpmsqExecve(const char **argv)
Execute a command, returning its status.
static void
Print copy of spec file, filling in Group/Description/Summary from specspo.
Definition: spec.c:737
status
Definition: rpmsq.c:792
struct rpmsig_s * rpmsig
Definition: rpmsq.h:14
int rpmsqThreadEqual(void *thread)
Compare thread with current thread.
Definition: rpmsq.c:684
int rpmsqEnable(int signum, rpmsqAction_t handler)
Enable or disable a signal handler.
Definition: rpmsq.c:439
rpmsq sq
Definition: rpmsq.c:739