rpm  5.2.1
rpmsq.h
Go to the documentation of this file.
1 #ifndef H_RPMSQ
2 #define H_RPMSQ
3 
9 #include <rpmsw.h>
10 
13 typedef struct rpmsig_s * rpmsig;
14 
17 typedef struct rpmsqElem * rpmsq;
18 
25 typedef void (*rpmsqAction_t) (int signum, void * info, void * context)
26  /*@*/;
27 
28 /*@-redecl@*/
29 /*@unchecked@*/
30 extern int _rpmsq_debug;
31 /*@=redecl@*/
32 
33 #if defined(_RPMSQ_INTERNAL)
34 
37 struct rpmsqElem {
38  struct rpmsqElem * q_forw;
39  struct rpmsqElem * q_back;
40  pid_t child;
41  volatile pid_t reaped;
42  volatile int status;
43  struct rpmop_s op;
44  rpmtime_t ms_scriptlets;
45  int reaper;
46  int pipes[2];
47 /*@shared@*/
48  void * id;
49 };
50 #endif
51 
52 /*@-exportlocal@*/
53 /*@unchecked@*/
54 extern rpmsq rpmsqQueue;
55 /*@=exportlocal@*/
56 
57 /*@unchecked@*/
58 extern sigset_t rpmsqCaught;
59 
60 #ifdef __cplusplus
61 extern "C" {
62 #endif
63 
70 /*@-exportlocal@*/
71 int rpmsqInsert(/*@null@*/ void * elem, /*@null@*/ void * prev)
72  /*@globals rpmsqQueue, systemState @*/
73  /*@modifies elem, prev, rpmsqQueue, systemState @*/;
74 /*@=exportlocal@*/
75 
81 /*@-exportlocal@*/
82 int rpmsqRemove(/*@null@*/ void * elem)
83  /*@globals fileSystem, internalState @*/
84  /*@modifies elem, fileSystem, internalState @*/;
85 /*@=exportlocal@*/
86 
93 /*@-exportlocal@*/
94 void rpmsqAction(int signum, void * info, void * context)
95  /*@globals rpmsqCaught, rpmsqQueue, errno, fileSystem, internalState @*/
96  /*@modifies rpmsqCaught, rpmsqQueue, errno,
97  fileSystem, internalState @*/;
98 /*@=exportlocal@*/
99 
106 int rpmsqEnable(int signum, /*@null@*/ rpmsqAction_t handler)
107  /*@globals rpmsqCaught, rpmsqQueue, fileSystem, internalState @*/
108  /*@modifies rpmsqCaught, rpmsqQueue, fileSystem, internalState @*/;
109 
115 pid_t rpmsqFork(rpmsq sq)
116  /*@globals fileSystem, internalState @*/
117  /*@modifies sq, fileSystem, internalState @*/;
118 
124 pid_t rpmsqWait(rpmsq sq)
125  /*@globals fileSystem, internalState @*/
126  /*@modifies sq, fileSystem, internalState @*/;
127 
134 void * rpmsqThread(void * (*start) (void * arg), void * arg)
135  /*@globals internalState @*/
136  /*@modifies internalState @*/;
137 
143 int rpmsqJoin(/*@null@*/ void * thread)
144  /*@globals internalState @*/
145  /*@modifies internalState @*/;
146 
152 int rpmsqThreadEqual(/*@null@*/ void * thread)
153  /*@globals internalState @*/
154  /*@modifies internalState @*/;
155 
159 int rpmsqExecve (const char ** argv)
160  /*@globals fileSystem, internalState @*/
161  /*@modifies fileSystem, internalState @*/;
162 
163 #ifdef __cplusplus
164 }
165 #endif
166 
167 #endif /* H_RPMSQ */