rpm  4.5
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 
36 struct rpmsqElem {
37  struct rpmsqElem * q_forw;
38  struct rpmsqElem * q_back;
39  pid_t child;
40  volatile pid_t reaped;
41  volatile int status;
42  struct rpmop_s op;
44  int reaper;
45  int pipes[2];
46 /*@shared@*/
47  void * id;
48  pthread_mutex_t mutex;
49  pthread_cond_t cond;
50 };
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 systemState @*/
73  /*@modifies elem, prev, 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 @*/
96  /*@modifies rpmsqCaught, rpmsqQueue, errno, fileSystem @*/;
97 /*@=exportlocal@*/
98 
105 int rpmsqEnable(int signum, /*@null@*/ rpmsqAction_t handler)
106  /*@globals rpmsqCaught, rpmsqQueue, fileSystem, internalState @*/
107  /*@modifies rpmsqCaught, rpmsqQueue, fileSystem, internalState @*/;
108 
114 pid_t rpmsqFork(rpmsq sq)
115  /*@globals fileSystem, internalState @*/
116  /*@modifies sq, fileSystem, internalState @*/;
117 
123 pid_t rpmsqWait(rpmsq sq)
124  /*@globals fileSystem, internalState @*/
125  /*@modifies sq, fileSystem, internalState @*/;
126 
133 void * rpmsqThread(void * (*start) (void * arg), void * arg)
134  /*@globals internalState @*/
135  /*@modifies internalState @*/;
136 
142 int rpmsqJoin(/*@null@*/ void * thread)
143  /*@globals internalState @*/
144  /*@modifies internalState @*/;
145 
151 int rpmsqThreadEqual(/*@null@*/ void * thread)
152  /*@globals internalState @*/
153  /*@modifies internalState @*/;
154 
158 int rpmsqExecve (const char ** argv)
159  /*@globals fileSystem, internalState @*/
160  /*@modifies fileSystem, internalState @*/;
161 
162 #ifdef __cplusplus
163 }
164 #endif
165 
166 #endif /* H_RPMSQ */