File: fork_func.h

package info (click to toggle)
spiped 1.6.4-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 1,328 kB
  • sloc: ansic: 11,951; sh: 1,081; makefile: 629; perl: 121
file content (19 lines) | stat: -rw-r--r-- 465 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#ifndef FORK_FUNC_H_
#define FORK_FUNC_H_

#include <sys/types.h>

/**
 * fork_func(func, cookie):
 * Fork and run ${func} in a new process, with ${cookie} as the sole argument.
 */
pid_t fork_func(int (*)(void *), void *);

/**
 * fork_func_wait(pid):
 * Wait for the process ${pid} to finish.  Print any error arising from ${pid}.
 * If ${pid} exited cleanly, return its exit code; otherwise, return -1.
 */
int fork_func_wait(pid_t);

#endif /* !FORK_FUNC_H_ */