diff options
Diffstat (limited to 'src/include/gnunet_os_lib.h')
-rw-r--r-- | src/include/gnunet_os_lib.h | 87 |
1 files changed, 45 insertions, 42 deletions
diff --git a/src/include/gnunet_os_lib.h b/src/include/gnunet_os_lib.h index d2474d2d8..9d611af9b 100644 --- a/src/include/gnunet_os_lib.h +++ b/src/include/gnunet_os_lib.h | |||
@@ -135,8 +135,8 @@ enum GNUNET_OS_ProcessStatusType | |||
135 | * @param dirkind what kind of directory is desired? | 135 | * @param dirkind what kind of directory is desired? |
136 | * @return a pointer to the dir path (to be freed by the caller) | 136 | * @return a pointer to the dir path (to be freed by the caller) |
137 | */ | 137 | */ |
138 | char *GNUNET_OS_installation_get_path (enum GNUNET_OS_InstallationPathKind | 138 | char * |
139 | dirkind); | 139 | GNUNET_OS_installation_get_path (enum GNUNET_OS_InstallationPathKind dirkind); |
140 | 140 | ||
141 | 141 | ||
142 | /** | 142 | /** |
@@ -160,8 +160,9 @@ typedef int (*GNUNET_OS_NetworkInterfaceProcessor) (void *cls, const char *name, | |||
160 | * @param proc the callback function | 160 | * @param proc the callback function |
161 | * @param proc_cls closure for proc | 161 | * @param proc_cls closure for proc |
162 | */ | 162 | */ |
163 | void GNUNET_OS_network_interfaces_list (GNUNET_OS_NetworkInterfaceProcessor | 163 | void |
164 | proc, void *proc_cls); | 164 | GNUNET_OS_network_interfaces_list (GNUNET_OS_NetworkInterfaceProcessor proc, |
165 | void *proc_cls); | ||
165 | 166 | ||
166 | /** | 167 | /** |
167 | * @brief Get maximum string length returned by gethostname() | 168 | * @brief Get maximum string length returned by gethostname() |
@@ -183,7 +184,8 @@ void GNUNET_OS_network_interfaces_list (GNUNET_OS_NetworkInterfaceProcessor | |||
183 | * | 184 | * |
184 | * @return pointer to the process sturcutre for this process | 185 | * @return pointer to the process sturcutre for this process |
185 | */ | 186 | */ |
186 | struct GNUNET_OS_Process *GNUNET_OS_process_current (void); | 187 | struct GNUNET_OS_Process * |
188 | GNUNET_OS_process_current (void); | ||
187 | 189 | ||
188 | 190 | ||
189 | /** | 191 | /** |
@@ -193,7 +195,8 @@ struct GNUNET_OS_Process *GNUNET_OS_process_current (void); | |||
193 | * @param sig signal | 195 | * @param sig signal |
194 | * @return 0 on success, -1 on error | 196 | * @return 0 on success, -1 on error |
195 | */ | 197 | */ |
196 | int GNUNET_OS_process_kill (struct GNUNET_OS_Process *proc, int sig); | 198 | int |
199 | GNUNET_OS_process_kill (struct GNUNET_OS_Process *proc, int sig); | ||
197 | 200 | ||
198 | 201 | ||
199 | /** | 202 | /** |
@@ -201,7 +204,8 @@ int GNUNET_OS_process_kill (struct GNUNET_OS_Process *proc, int sig); | |||
201 | * | 204 | * |
202 | * @param proc pointer to process structure | 205 | * @param proc pointer to process structure |
203 | */ | 206 | */ |
204 | void GNUNET_OS_process_close (struct GNUNET_OS_Process *proc); | 207 | void |
208 | GNUNET_OS_process_close (struct GNUNET_OS_Process *proc); | ||
205 | 209 | ||
206 | /** | 210 | /** |
207 | * Get the pid of the process in question | 211 | * Get the pid of the process in question |
@@ -210,7 +214,8 @@ void GNUNET_OS_process_close (struct GNUNET_OS_Process *proc); | |||
210 | * | 214 | * |
211 | * @return the current process id | 215 | * @return the current process id |
212 | */ | 216 | */ |
213 | pid_t GNUNET_OS_process_get_pid (struct GNUNET_OS_Process *proc); | 217 | pid_t |
218 | GNUNET_OS_process_get_pid (struct GNUNET_OS_Process *proc); | ||
214 | 219 | ||
215 | /** | 220 | /** |
216 | * Set process priority | 221 | * Set process priority |
@@ -219,8 +224,9 @@ pid_t GNUNET_OS_process_get_pid (struct GNUNET_OS_Process *proc); | |||
219 | * @param prio priority value | 224 | * @param prio priority value |
220 | * @return GNUNET_OK on success, GNUNET_SYSERR on error | 225 | * @return GNUNET_OK on success, GNUNET_SYSERR on error |
221 | */ | 226 | */ |
222 | int GNUNET_OS_set_process_priority (struct GNUNET_OS_Process *proc, | 227 | int |
223 | enum GNUNET_SCHEDULER_Priority prio); | 228 | GNUNET_OS_set_process_priority (struct GNUNET_OS_Process *proc, |
229 | enum GNUNET_SCHEDULER_Priority prio); | ||
224 | 230 | ||
225 | 231 | ||
226 | /** | 232 | /** |
@@ -232,11 +238,10 @@ int GNUNET_OS_set_process_priority (struct GNUNET_OS_Process *proc, | |||
232 | * @param ... NULL-terminated list of arguments to the process | 238 | * @param ... NULL-terminated list of arguments to the process |
233 | * @return pointer to process structure of the new process, NULL on error | 239 | * @return pointer to process structure of the new process, NULL on error |
234 | */ | 240 | */ |
235 | struct GNUNET_OS_Process *GNUNET_OS_start_process (struct GNUNET_DISK_PipeHandle | 241 | struct GNUNET_OS_Process * |
236 | *pipe_stdin, | 242 | GNUNET_OS_start_process (struct GNUNET_DISK_PipeHandle *pipe_stdin, |
237 | struct GNUNET_DISK_PipeHandle | 243 | struct GNUNET_DISK_PipeHandle *pipe_stdout, |
238 | *pipe_stdout, | 244 | const char *filename, ...); |
239 | const char *filename, ...); | ||
240 | 245 | ||
241 | 246 | ||
242 | /** | 247 | /** |
@@ -248,14 +253,10 @@ struct GNUNET_OS_Process *GNUNET_OS_start_process (struct GNUNET_DISK_PipeHandle | |||
248 | * @param va NULL-terminated list of arguments to the process | 253 | * @param va NULL-terminated list of arguments to the process |
249 | * @return pointer to process structure of the new process, NULL on error | 254 | * @return pointer to process structure of the new process, NULL on error |
250 | */ | 255 | */ |
251 | struct GNUNET_OS_Process *GNUNET_OS_start_process_va (struct | 256 | struct GNUNET_OS_Process * |
252 | GNUNET_DISK_PipeHandle | 257 | GNUNET_OS_start_process_va (struct GNUNET_DISK_PipeHandle *pipe_stdin, |
253 | *pipe_stdin, | 258 | struct GNUNET_DISK_PipeHandle *pipe_stdout, |
254 | struct | 259 | const char *filename, va_list va); |
255 | GNUNET_DISK_PipeHandle | ||
256 | *pipe_stdout, | ||
257 | const char *filename, | ||
258 | va_list va); | ||
259 | 260 | ||
260 | /** | 261 | /** |
261 | * Start a process. | 262 | * Start a process. |
@@ -267,9 +268,9 @@ struct GNUNET_OS_Process *GNUNET_OS_start_process_va (struct | |||
267 | * including the process name as the first argument | 268 | * including the process name as the first argument |
268 | * @return pointer to process structure of the new process, NULL on error | 269 | * @return pointer to process structure of the new process, NULL on error |
269 | */ | 270 | */ |
270 | struct GNUNET_OS_Process *GNUNET_OS_start_process_v (const int *lsocks, | 271 | struct GNUNET_OS_Process * |
271 | const char *filename, | 272 | GNUNET_OS_start_process_v (const int *lsocks, const char *filename, |
272 | char *const argv[]); | 273 | char *const argv[]); |
273 | 274 | ||
274 | 275 | ||
275 | /** | 276 | /** |
@@ -290,7 +291,8 @@ typedef void (*GNUNET_OS_LineProcessor) (void *cls, const char *line); | |||
290 | * | 291 | * |
291 | * @param cmd handle to the process | 292 | * @param cmd handle to the process |
292 | */ | 293 | */ |
293 | void GNUNET_OS_command_stop (struct GNUNET_OS_CommandHandle *cmd); | 294 | void |
295 | GNUNET_OS_command_stop (struct GNUNET_OS_CommandHandle *cmd); | ||
294 | 296 | ||
295 | 297 | ||
296 | /** | 298 | /** |
@@ -304,12 +306,10 @@ void GNUNET_OS_command_stop (struct GNUNET_OS_CommandHandle *cmd); | |||
304 | * @param ... arguments to command | 306 | * @param ... arguments to command |
305 | * @return NULL on error | 307 | * @return NULL on error |
306 | */ | 308 | */ |
307 | struct GNUNET_OS_CommandHandle *GNUNET_OS_command_run (GNUNET_OS_LineProcessor | 309 | struct GNUNET_OS_CommandHandle * |
308 | proc, void *proc_cls, | 310 | GNUNET_OS_command_run (GNUNET_OS_LineProcessor proc, void *proc_cls, |
309 | struct | 311 | struct GNUNET_TIME_Relative timeout, const char *binary, |
310 | GNUNET_TIME_Relative | 312 | ...); |
311 | timeout, | ||
312 | const char *binary, ...); | ||
313 | 313 | ||
314 | 314 | ||
315 | /** | 315 | /** |
@@ -320,9 +320,10 @@ struct GNUNET_OS_CommandHandle *GNUNET_OS_command_run (GNUNET_OS_LineProcessor | |||
320 | * @param code return code/signal number | 320 | * @param code return code/signal number |
321 | * @return GNUNET_OK on success, GNUNET_NO if the process is still running, GNUNET_SYSERR otherwise | 321 | * @return GNUNET_OK on success, GNUNET_NO if the process is still running, GNUNET_SYSERR otherwise |
322 | */ | 322 | */ |
323 | int GNUNET_OS_process_status (struct GNUNET_OS_Process *proc, | 323 | int |
324 | enum GNUNET_OS_ProcessStatusType *type, | 324 | GNUNET_OS_process_status (struct GNUNET_OS_Process *proc, |
325 | unsigned long *code); | 325 | enum GNUNET_OS_ProcessStatusType *type, |
326 | unsigned long *code); | ||
326 | 327 | ||
327 | 328 | ||
328 | /** | 329 | /** |
@@ -335,16 +336,17 @@ int GNUNET_OS_process_status (struct GNUNET_OS_Process *proc, | |||
335 | * @param proc pointer to process structure of the process to wait for | 336 | * @param proc pointer to process structure of the process to wait for |
336 | * @return GNUNET_OK on success, GNUNET_SYSERR otherwise | 337 | * @return GNUNET_OK on success, GNUNET_SYSERR otherwise |
337 | */ | 338 | */ |
338 | int GNUNET_OS_process_wait (struct GNUNET_OS_Process *proc); | 339 | int |
340 | GNUNET_OS_process_wait (struct GNUNET_OS_Process *proc); | ||
339 | 341 | ||
340 | 342 | ||
341 | /** | 343 | /** |
342 | * Connects this process to its parent via pipe | 344 | * Connects this process to its parent via pipe |
343 | */ | 345 | */ |
344 | void GNUNET_OS_install_parent_control_handler (void *cls, | 346 | void |
345 | const struct | 347 | GNUNET_OS_install_parent_control_handler (void *cls, |
346 | GNUNET_SCHEDULER_TaskContext | 348 | const struct |
347 | *tc); | 349 | GNUNET_SCHEDULER_TaskContext *tc); |
348 | 350 | ||
349 | 351 | ||
350 | /** | 352 | /** |
@@ -358,7 +360,8 @@ void GNUNET_OS_install_parent_control_handler (void *cls, | |||
358 | * GNUNET_NO if not SUID (but binary exists) | 360 | * GNUNET_NO if not SUID (but binary exists) |
359 | * GNUNET_SYSERR on error (no such binary or not executable) | 361 | * GNUNET_SYSERR on error (no such binary or not executable) |
360 | */ | 362 | */ |
361 | int GNUNET_OS_check_helper_binary (const char *binary); | 363 | int |
364 | GNUNET_OS_check_helper_binary (const char *binary); | ||
362 | 365 | ||
363 | 366 | ||
364 | #if 0 /* keep Emacsens' auto-indent happy */ | 367 | #if 0 /* keep Emacsens' auto-indent happy */ |