redo plugin structure
[vlock.git] / src / process.h
blob78a67a70732843139430dd2a1e395bf629ea0174
1 /* process.h -- header for child process routines for vlock,
2 * the VT locking program for linux
4 * This program is copyright (C) 2007 Frank Benkstein, and is free
5 * software which is freely distributable under the terms of the
6 * GNU General Public License version 2, included as the file COPYING in this
7 * distribution. It is NOT public domain software, and any
8 * redistribution not permitted by the GNU General Public License is
9 * expressly forbidden without prior written permission from
10 * the author.
14 #include <stdbool.h>
15 #include <sys/types.h>
17 /* Wait for the given amount of time for the death of the given child process.
18 * If the child process dies in the given amount of time or already was dead
19 * true is returned and false otherwise. */
20 bool wait_for_death(pid_t pid, long sec, long usec);
22 /* Try hard to kill the given child process. */
23 void ensure_death(pid_t pid);
25 /* Close all possibly open file descriptors except STDIN_FILENO, STDOUT_FILENO
26 * and STDERR_FILENO. */
27 void close_all_fds(void);