aboutsummaryrefslogtreecommitdiff
path: root/src/include/gnunet_os_lib.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/include/gnunet_os_lib.h')
-rw-r--r--src/include/gnunet_os_lib.h57
1 files changed, 29 insertions, 28 deletions
diff --git a/src/include/gnunet_os_lib.h b/src/include/gnunet_os_lib.h
index 48027e922..b285e3b60 100644
--- a/src/include/gnunet_os_lib.h
+++ b/src/include/gnunet_os_lib.h
@@ -211,8 +211,7 @@ void GNUNET_OS_process_close (struct GNUNET_OS_Process *proc);
211 * 211 *
212 * @return the current process id 212 * @return the current process id
213 */ 213 */
214pid_t 214pid_t GNUNET_OS_process_get_pid (struct GNUNET_OS_Process *proc);
215GNUNET_OS_process_get_pid (struct GNUNET_OS_Process *proc);
216 215
217/** 216/**
218 * Set process priority 217 * Set process priority
@@ -234,10 +233,11 @@ int GNUNET_OS_set_process_priority (struct GNUNET_OS_Process *proc,
234 * @param ... NULL-terminated list of arguments to the process 233 * @param ... NULL-terminated list of arguments to the process
235 * @return pointer to process structure of the new process, NULL on error 234 * @return pointer to process structure of the new process, NULL on error
236 */ 235 */
237struct GNUNET_OS_Process * 236struct GNUNET_OS_Process *GNUNET_OS_start_process (struct GNUNET_DISK_PipeHandle
238GNUNET_OS_start_process (struct GNUNET_DISK_PipeHandle *pipe_stdin, 237 *pipe_stdin,
239 struct GNUNET_DISK_PipeHandle *pipe_stdout, 238 struct GNUNET_DISK_PipeHandle
240 const char *filename, ...); 239 *pipe_stdout,
240 const char *filename, ...);
241 241
242 242
243/** 243/**
@@ -249,11 +249,14 @@ GNUNET_OS_start_process (struct GNUNET_DISK_PipeHandle *pipe_stdin,
249 * @param va NULL-terminated list of arguments to the process 249 * @param va NULL-terminated list of arguments to the process
250 * @return pointer to process structure of the new process, NULL on error 250 * @return pointer to process structure of the new process, NULL on error
251 */ 251 */
252struct GNUNET_OS_Process * 252struct GNUNET_OS_Process *GNUNET_OS_start_process_va (struct
253GNUNET_OS_start_process_va (struct GNUNET_DISK_PipeHandle *pipe_stdin, 253 GNUNET_DISK_PipeHandle
254 struct GNUNET_DISK_PipeHandle *pipe_stdout, 254 *pipe_stdin,
255 const char *filename, 255 struct
256 va_list va); 256 GNUNET_DISK_PipeHandle
257 *pipe_stdout,
258 const char *filename,
259 va_list va);
257 260
258/** 261/**
259 * Start a process. 262 * Start a process.
@@ -265,9 +268,9 @@ GNUNET_OS_start_process_va (struct GNUNET_DISK_PipeHandle *pipe_stdin,
265 * including the process name as the first argument 268 * including the process name as the first argument
266 * @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
267 */ 270 */
268struct GNUNET_OS_Process * 271struct GNUNET_OS_Process *GNUNET_OS_start_process_v (const int *lsocks,
269GNUNET_OS_start_process_v (const int *lsocks, const char *filename, 272 const char *filename,
270 char *const argv[]); 273 char *const argv[]);
271 274
272 275
273/** 276/**
@@ -281,16 +284,14 @@ struct GNUNET_OS_CommandHandle;
281 * @param cls closure 284 * @param cls closure
282 * @param line line of output from a command, NULL for the end 285 * @param line line of output from a command, NULL for the end
283 */ 286 */
284typedef void (*GNUNET_OS_LineProcessor)(void *cls, 287typedef void (*GNUNET_OS_LineProcessor) (void *cls, const char *line);
285 const char *line);
286 288
287/** 289/**
288 * Stop/kill a command. 290 * Stop/kill a command.
289 * 291 *
290 * @param cmd handle to the process 292 * @param cmd handle to the process
291 */ 293 */
292void 294void GNUNET_OS_command_stop (struct GNUNET_OS_CommandHandle *cmd);
293GNUNET_OS_command_stop (struct GNUNET_OS_CommandHandle *cmd);
294 295
295 296
296/** 297/**
@@ -304,12 +305,12 @@ GNUNET_OS_command_stop (struct GNUNET_OS_CommandHandle *cmd);
304 * @param ... arguments to command 305 * @param ... arguments to command
305 * @return NULL on error 306 * @return NULL on error
306 */ 307 */
307struct GNUNET_OS_CommandHandle * 308struct GNUNET_OS_CommandHandle *GNUNET_OS_command_run (GNUNET_OS_LineProcessor
308GNUNET_OS_command_run (GNUNET_OS_LineProcessor proc, 309 proc, void *proc_cls,
309 void *proc_cls, 310 struct
310 struct GNUNET_TIME_Relative timeout, 311 GNUNET_TIME_Relative
311 const char *binary, 312 timeout,
312 ...); 313 const char *binary, ...);
313 314
314 315
315/** 316/**
@@ -321,7 +322,8 @@ GNUNET_OS_command_run (GNUNET_OS_LineProcessor proc,
321 * @return GNUNET_OK on success, GNUNET_NO if the process is still running, GNUNET_SYSERR otherwise 322 * @return GNUNET_OK on success, GNUNET_NO if the process is still running, GNUNET_SYSERR otherwise
322 */ 323 */
323int GNUNET_OS_process_status (struct GNUNET_OS_Process *proc, 324int GNUNET_OS_process_status (struct GNUNET_OS_Process *proc,
324 enum GNUNET_OS_ProcessStatusType *type, unsigned long *code); 325 enum GNUNET_OS_ProcessStatusType *type,
326 unsigned long *code);
325 327
326 328
327/** 329/**
@@ -343,7 +345,7 @@ int GNUNET_OS_process_wait (struct GNUNET_OS_Process *proc);
343void 345void
344GNUNET_OS_install_parent_control_handler (void *cls, 346GNUNET_OS_install_parent_control_handler (void *cls,
345 const struct 347 const struct
346 GNUNET_SCHEDULER_TaskContext * tc); 348 GNUNET_SCHEDULER_TaskContext *tc);
347 349
348 350
349/** 351/**
@@ -357,8 +359,7 @@ GNUNET_OS_install_parent_control_handler (void *cls,
357 * GNUNET_NO if not SUID (but binary exists) 359 * GNUNET_NO if not SUID (but binary exists)
358 * GNUNET_SYSERR on error (no such binary or not executable) 360 * GNUNET_SYSERR on error (no such binary or not executable)
359 */ 361 */
360int 362int GNUNET_OS_check_helper_binary (const char *binary);
361GNUNET_OS_check_helper_binary (const char *binary);
362 363
363 364
364#if 0 /* keep Emacsens' auto-indent happy */ 365#if 0 /* keep Emacsens' auto-indent happy */