00001 #ifndef H_RPMSQ 00002 #define H_RPMSQ 00003 00009 #include <rpmsw.h> 00010 00013 typedef struct rpmsig_s * rpmsig; 00014 00017 typedef struct rpmsqElem * rpmsq; 00018 00025 typedef void (*rpmsqAction_t) (int signum, void * info, void * context) 00026 /*@*/; 00027 00028 /*@-redecl@*/ 00029 /*@unchecked@*/ 00030 extern int _rpmsq_debug; 00031 /*@=redecl@*/ 00032 00036 struct rpmsqElem { 00037 struct rpmsqElem * q_forw; 00038 struct rpmsqElem * q_back; 00039 pid_t child; 00040 volatile pid_t reaped; 00041 volatile int status; 00042 struct rpmop_s op; 00043 rpmtime_t ms_scriptlets; 00044 int reaper; 00045 int pipes[2]; 00046 /*@shared@*/ 00047 void * id; 00048 pthread_mutex_t mutex; 00049 pthread_cond_t cond; 00050 }; 00051 00052 /*@-exportlocal@*/ 00053 /*@unchecked@*/ 00054 extern rpmsq rpmsqQueue; 00055 /*@=exportlocal@*/ 00056 00057 /*@unchecked@*/ 00058 extern sigset_t rpmsqCaught; 00059 00060 #ifdef __cplusplus 00061 extern "C" { 00062 #endif 00063 00070 /*@-exportlocal@*/ 00071 int rpmsqInsert(/*@null@*/ void * elem, /*@null@*/ void * prev) 00072 /*@globals systemState @*/ 00073 /*@modifies elem, prev, systemState @*/; 00074 /*@=exportlocal@*/ 00075 00081 /*@-exportlocal@*/ 00082 int rpmsqRemove(/*@null@*/ void * elem) 00083 /*@globals fileSystem, internalState @*/ 00084 /*@modifies elem, fileSystem, internalState @*/; 00085 /*@=exportlocal@*/ 00086 00093 /*@-exportlocal@*/ 00094 void rpmsqAction(int signum, void * info, void * context) 00095 /*@globals rpmsqCaught, rpmsqQueue, errno, fileSystem @*/ 00096 /*@modifies rpmsqCaught, rpmsqQueue, errno, fileSystem @*/; 00097 /*@=exportlocal@*/ 00098 00105 int rpmsqEnable(int signum, /*@null@*/ rpmsqAction_t handler) 00106 /*@globals rpmsqCaught, rpmsqQueue, fileSystem, internalState @*/ 00107 /*@modifies rpmsqCaught, rpmsqQueue, fileSystem, internalState @*/; 00108 00114 pid_t rpmsqFork(rpmsq sq) 00115 /*@globals fileSystem, internalState @*/ 00116 /*@modifies sq, fileSystem, internalState @*/; 00117 00123 pid_t rpmsqWait(rpmsq sq) 00124 /*@globals fileSystem, internalState @*/ 00125 /*@modifies sq, fileSystem, internalState @*/; 00126 00133 void * rpmsqThread(void * (*start) (void * arg), void * arg) 00134 /*@globals internalState @*/ 00135 /*@modifies internalState @*/; 00136 00142 int rpmsqJoin(/*@null@*/ void * thread) 00143 /*@globals internalState @*/ 00144 /*@modifies internalState @*/; 00145 00151 int rpmsqThreadEqual(/*@null@*/ void * thread) 00152 /*@globals internalState @*/ 00153 /*@modifies internalState @*/; 00154 00158 int rpmsqExecve (const char ** argv) 00159 /*@globals fileSystem, internalState @*/ 00160 /*@modifies fileSystem, internalState @*/; 00161 00162 #ifdef __cplusplus 00163 } 00164 #endif 00165 00166 #endif /* H_RPMSQ */