.TH "dexec.h" 3 "Fri Apr 27 2018" "Version 0.14" "libdaemon" \" -*- nroff -*- .ad l .nh .SH NAME dexec.h \- Contains a robust API for running sub processes with STDOUT and STDERR redirected to syslog\&. .SH SYNOPSIS .br .PP \fC#include \fP .br .SS "Macros" .in +1c .ti -1c .RI "#define \fBDAEMON_EXEC_AVAILABLE\fP 1" .br .RI "This variable is defined to 1 iff \fBdaemon_exec()\fP is supported\&. " .ti -1c .RI "#define \fBDAEMON_GCC_SENTINEL\fP" .br .RI "A macro for making use of GCCs printf compilation warnings\&. " .ti -1c .RI "#define \fBDAEMON_EXECV_AVAILABLE\fP 1" .br .RI "This variable is defined to 1 iff \fBdaemon_execv()\fP is supported\&. " .in -1c .SS "Functions" .in +1c .ti -1c .RI "int \fBdaemon_exec\fP (const char *dir, int *ret, const char *prog,\&.\&.\&.) \fBDAEMON_GCC_SENTINEL\fP" .br .RI "Run the specified executable with the specified arguments in the specified directory and return the return value of the program in the specified pointer\&. " .ti -1c .RI "int \fBdaemon_execv\fP (const char *dir, int *ret, const char *prog, va_list ap)" .br .RI "The same as daemon_exec, but without variadic arguments\&. " .in -1c .SH "Detailed Description" .PP Contains a robust API for running sub processes with STDOUT and STDERR redirected to syslog\&. .PP Definition in file \fBdexec\&.h\fP\&. .SH "Macro Definition Documentation" .PP .SS "#define DAEMON_EXEC_AVAILABLE 1" .PP This variable is defined to 1 iff \fBdaemon_exec()\fP is supported\&. .PP \fBSince:\fP .RS 4 0\&.4 .RE .PP \fBSee also:\fP .RS 4 \fBdaemon_exec()\fP .RE .PP .PP Definition at line 39 of file dexec\&.h\&. .SS "#define DAEMON_EXECV_AVAILABLE 1" .PP This variable is defined to 1 iff \fBdaemon_execv()\fP is supported\&. .PP \fBSince:\fP .RS 4 0\&.11 .RE .PP \fBSee also:\fP .RS 4 \fBdaemon_execv()\fP .RE .PP .PP Definition at line 68 of file dexec\&.h\&. .SS "#define DAEMON_GCC_SENTINEL" .PP A macro for making use of GCCs printf compilation warnings\&. .PP Definition at line 45 of file dexec\&.h\&. .SH "Function Documentation" .PP .SS "int daemon_exec (const char * dir, int * ret, const char * prog, \&.\&.\&.)" .PP Run the specified executable with the specified arguments in the specified directory and return the return value of the program in the specified pointer\&. The calling process is blocked until the child finishes and all child output (either STDOUT or STDIN) has been written to syslog\&. Running this function requires that daemon_signal() has been called with SIGCHLD as argument\&. .PP \fBParameters:\fP .RS 4 \fIdir\fP Working directory for the process\&. .br \fIret\fP A pointer to an integer to write the return value of the program to\&. .br \fIprog\fP The path to the executable .br \fI\&.\&.\&.\fP The arguments to be passed to the program, followed by a (char *) NULL .RE .PP \fBReturns:\fP .RS 4 Nonzero on failure, zero on success .RE .PP \fBSince:\fP .RS 4 0\&.4 .RE .PP \fBSee also:\fP .RS 4 \fBDAEMON_EXEC_AVAILABLE\fP .RE .PP .PP \fBExamples: \fP .in +1c \fBtestd\&.c\fP\&. .SS "int daemon_execv (const char * dir, int * ret, const char * prog, va_list ap)" .PP The same as daemon_exec, but without variadic arguments\&. .PP \fBSince:\fP .RS 4 0\&.11 .RE .PP \fBSee also:\fP .RS 4 \fBDAEMON_EXECV_AVAILABLE\fP .RE .PP .SH "Author" .PP Generated automatically by Doxygen for libdaemon from the source code\&.