1 #ifndef LTTNG_DAEMONIZE_H
2 #define LTTNG_DAEMONIZE_H
5 * Copyright (C) 2013 - David Goulet <dgoulet@efficios.com>
6 * Copyright (C) 2014 - Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
8 * This program is free software; you can redistribute it and/or modify it
9 * under the terms of the GNU General Public License, version 2 only, as
10 * published by the Free Software Foundation.
12 * This program is distributed in the hope that it will be useful, but WITHOUT
13 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
14 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
17 * You should have received a copy of the GNU General Public License along with
18 * this program; if not, write to the Free Software Foundation, Inc., 51
19 * Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
23 #include <common/macros.h>
26 * Daemonize this process by forking and making the parent wait for the child
27 * to signal it indicating readiness. Once received, the parent successfully
30 * The child process undergoes the same action that daemon(3) does meaning
31 * setsid, chdir, and dup /dev/null into 0, 1 and 2.
33 * Return 0 on success else -1 on error.
36 int lttng_daemonize(pid_t
*child_ppid
, int *completion_flag
,
39 #endif /* LTTNG_DAEMONIZE_H */
This page took 0.032836 seconds and 5 git commands to generate.