1 #ifndef NDO_LIBNAGIOS_RUNCMD_H_INCLUDED 2 #define NDO_LIBNAGIOS_RUNCMD_H_INCLUDED 27 #define RUNCMD_HAS_REDIR (1 << 0) 28 #define RUNCMD_HAS_SUBCOMMAND (1 << 1) 29 #define RUNCMD_HAS_PAREN (1 << 2) 30 #define RUNCMD_HAS_JOBCONTROL (1 << 3) 31 #define RUNCMD_HAS_UBSQ (1 << 4) 32 #define RUNCMD_HAS_UBDQ (1 << 5) 33 #define RUNCMD_HAS_WILDCARD (1 << 6) 34 #define RUNCMD_HAS_SHVAR (1 << 7) 37 #define RUNCMD_EFD (-1) 38 #define RUNCMD_EALLOC (-2) 39 #define RUNCMD_ECMD (-3) 40 #define RUNCMD_EFORK (-4) 41 #define RUNCMD_EINVAL (-5) 42 #define RUNCMD_EWAIT (-6) 77 extern int runcmd_open(
const char *cmd,
int *pfd,
int *pfderr,
char **env,
78 void (*iobreg)(
int,
int,
void *),
void *iobregarg);
104 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 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.
int runcmd_open(const char *cmd, int *pfd, int *pfderr, char **env, void(*iobreg)(int, int, void *), void *iobregarg)
Start a command from a command string.
pid_t runcmd_pid(int fd)
Return pid of a command with a specific file descriptor.
void runcmd_free_pids(void)
If you're using libnagios to execute a remote command, the static pid_t pids is not freed after runcm...