dexec.h(3)

πŸ“¦
version 0.14 Β· 4 versions
, in ubuntu noble, ubuntu questing

πŸ’– dexec.h β€” NAME πŸ’–

dexec.h β€” bestie, it's a whole header file that contains a robust API for running sub processes with STDOUT and STDERR redirected to syslog. no cap. πŸ¦‹


✨ SYNOPSIS ✨

#include <stdarg.h>

πŸŽ€ Macros

  • #define DAEMON_EXEC_AVAILABLE 1 β€” this variable is defined to 1 iff daemon_exec() is supported. literally a little green flag telling you the function showed up. πŸ’…
  • #define DAEMON_GCC_SENTINEL β€” a macro for making use of GCC's printf compilation warnings. it's giving "the compiler is watching, be nice". πŸ‘€
  • #define DAEMON_EXECV_AVAILABLE 1 β€” this variable is defined to 1 iff daemon_execv() is supported. same energy, different function. 🌸

🧚 Functions

  • int daemon_exec (const char *dir, int *ret, const char *prog,...) β€” DAEMON_GCC_SENTINEL

run the specified executable with the specified arguments in the specified directory and return the return value of the program in the specified pointer. iconic behavior fr fr.

  • int daemon_execv (const char *dir, int *ret, const char *prog, va_list ap)

the same as daemon_exec, but without variadic arguments. lowkey the introvert version. πŸ™ˆ


🌈 Detailed Description

contains a robust API for running sub processes with STDOUT and STDERR redirected to syslog.

definition in file dexec.h.


πŸ‘‘ Macro Definition Documentation

#define DAEMON_EXEC_AVAILABLE 1

this variable is defined to 1 iff daemon_exec() is supported.

Since: 0.4

See also: daemon_exec()

definition at line 39 of file dexec.h.


#define DAEMON_EXECV_AVAILABLE 1

this variable is defined to 1 iff daemon_execv() is supported.

Since: 0.11

See also: daemon_execv()

definition at line 68 of file dexec.h.


#define DAEMON_GCC_SENTINEL

a macro for making use of GCC's printf compilation warnings.

definition at line 45 of file dexec.h.


⭐ Function Documentation

int daemon_exec (const char * dir, int * ret, const char * prog, ...)

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.

okay bestie this is the important part β€” no daemon_signal() with SIGCHLD means no daemon_exec(). it's a whole prerequisite, not a suggestion. 🫢

Parameters

  • dir β€” working directory for the process.
  • ret β€” a pointer to an integer to write the return value of the program to.
  • prog β€” the path to the executable.
  • ... β€” the arguments to be passed to the program, followed by a (char *) NULL.

Returns: nonzero on failure, zero on success. (yes, it's that classic backwards-feeling thing, we love it here πŸ’€)

Since: 0.4

See also: DAEMON_EXEC_AVAILABLE

Examples: testd.c.


int daemon_execv (const char * dir, int * ret, const char * prog, va_list ap)

the same as daemon_exec, but without variadic arguments.

Since: 0.11

See also: DAEMON_EXECV_AVAILABLE


πŸ’œ Author

generated automatically by Doxygen for libdaemon from the source code. (not a human, just a little robot doing its thing, and honestly? slay. πŸ€–βœ¨)


and that's the whole page, bestie β€” this was libdaemon, Version 0.14, dated dexec.h(3). periodt. πŸ’…πŸŽ€πŸ¦‹

πŸ“¦ where this page comes from