1 #ifndef LIBNAGIOS_runcmd_h__
2 #define LIBNAGIOS_runcmd_h__
16 #define RUNCMD_HAS_REDIR (1 << 0)
17 #define RUNCMD_HAS_SUBCOMMAND (1 << 1)
18 #define RUNCMD_HAS_PAREN (1 << 2)
19 #define RUNCMD_HAS_JOBCONTROL (1 << 3)
20 #define RUNCMD_HAS_UBSQ (1 << 4)
21 #define RUNCMD_HAS_UBDQ (1 << 5)
22 #define RUNCMD_HAS_WILDCARD (1 << 6)
23 #define RUNCMD_HAS_SHVAR (1 << 7)
26 #define RUNCMD_EFD (-1)
27 #define RUNCMD_EALLOC (-2)
28 #define RUNCMD_ECMD (-3)
29 #define RUNCMD_EFORK (-4)
30 #define RUNCMD_EINVAL (-5)
31 #define RUNCMD_EWAIT (-6)
63 extern int runcmd_open(
const char *cmdstring,
int *pfd,
int *pfderr,
char **env)
64 __attribute__((__nonnull__(1, 2, 3)));
90 extern int runcmd_cmd2strv(
const char *str,
int *out_argc,
char **out_argv);
const char * runcmd_strerror(int code)
Return explanation of which system call or operation failed.
int int runcmd_close(int fd)
Close a command and return its exit status.
void runcmd_init(void)
Initialize the runcmd library.
int runcmd_cmd2strv(const char *str, int *out_argc, char **out_argv)
Convert a string to a vector of arguments like a shell would.
pid_t runcmd_pid(int fd)
Return pid of a command with a specific file descriptor.
int runcmd_open(const char *cmdstring, int *pfd, int *pfderr, char **env) __attribute__((__nonnull__(1
Start a command from a command string.