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.h87
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 */
138char *GNUNET_OS_installation_get_path (enum GNUNET_OS_InstallationPathKind 138char *
139 dirkind); 139GNUNET_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 */
163void GNUNET_OS_network_interfaces_list (GNUNET_OS_NetworkInterfaceProcessor 163void
164 proc, void *proc_cls); 164GNUNET_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 */
186struct GNUNET_OS_Process *GNUNET_OS_process_current (void); 187struct GNUNET_OS_Process *
188GNUNET_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 */
196int GNUNET_OS_process_kill (struct GNUNET_OS_Process *proc, int sig); 198int
199GNUNET_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 */
204void GNUNET_OS_process_close (struct GNUNET_OS_Process *proc); 207void
208GNUNET_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 */
213pid_t GNUNET_OS_process_get_pid (struct GNUNET_OS_Process *proc); 217pid_t
218GNUNET_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 */
222int GNUNET_OS_set_process_priority (struct GNUNET_OS_Process *proc, 227int
223 enum GNUNET_SCHEDULER_Priority prio); 228GNUNET_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 */
235struct GNUNET_OS_Process *GNUNET_OS_start_process (struct GNUNET_DISK_PipeHandle 241struct GNUNET_OS_Process *
236 *pipe_stdin, 242GNUNET_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 */
251struct GNUNET_OS_Process *GNUNET_OS_start_process_va (struct 256struct GNUNET_OS_Process *
252 GNUNET_DISK_PipeHandle 257GNUNET_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 */
270struct GNUNET_OS_Process *GNUNET_OS_start_process_v (const int *lsocks, 271struct GNUNET_OS_Process *
271 const char *filename, 272GNUNET_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 */
293void GNUNET_OS_command_stop (struct GNUNET_OS_CommandHandle *cmd); 294void
295GNUNET_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 */
307struct GNUNET_OS_CommandHandle *GNUNET_OS_command_run (GNUNET_OS_LineProcessor 309struct GNUNET_OS_CommandHandle *
308 proc, void *proc_cls, 310GNUNET_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 */
323int GNUNET_OS_process_status (struct GNUNET_OS_Process *proc, 323int
324 enum GNUNET_OS_ProcessStatusType *type, 324GNUNET_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 */
338int GNUNET_OS_process_wait (struct GNUNET_OS_Process *proc); 339int
340GNUNET_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 */
344void GNUNET_OS_install_parent_control_handler (void *cls, 346void
345 const struct 347GNUNET_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 */
361int GNUNET_OS_check_helper_binary (const char *binary); 363int
364GNUNET_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 */