1 /* CC0 license (public domain) - see LICENSE file for details */
10 * pipecmd - run a command, optionally connect pipes.
11 * @infd: input fd to write to child (if non-NULL)
12 * @outfd: output fd to read from child (if non-NULL)
13 * @errfd: error-output fd to read from child (if non-NULL)
14 * @cmd...: NULL-terminate list of command and arguments.
16 * If @infd is NULL, the child's input is (read-only) /dev/null.
17 * If @outfd is NULL, the child's output is (write-only) /dev/null.
18 * If @errfd is NULL, the child's stderr is (write-only) /dev/null.
20 * If @errfd == @outfd (and non-NULL) they will be shared.
22 * The return value is the pid of the child, or -1.
24 pid_t pipecmd(int *infd, int *outfd, int *errfd, const char *cmd, ...);
27 * pipecmdv - run a command, optionally connect pipes (stdarg version)
28 * @infd: input fd to write to child (if non-NULL)
29 * @outfd: output fd to read from child (if non-NULL)
30 * @errfd: error-output fd to read from child (if non-NULL)
31 * @cmd: command to run.
32 * @ap: argument list for arguments.
34 pid_t pipecmdv(int *infd, int *outfd, int *errfd, const char *cmd, va_list ap);
37 * pipecmdarr - run a command, optionally connect pipes (char arry version)
38 * @infd: input fd to write to child (if non-NULL)
39 * @outfd: output fd to read from child (if non-NULL)
40 * @errfd: error-output fd to read from child (if non-NULL)
41 * @arr: NULL-terminated array for arguments (first is program to run).
43 pid_t pipecmdarr(int *infd, int *outfd, int *errfd, char *const *arr);
44 #endif /* CCAN_PIPECMD_H */