xref: /netbsd-src/external/bsd/nsd/dist/popen3.h (revision 811a4a0195236f69295602fbee687a174d42af9b)
1 /*
2  * popen3.h -- execute a command and connect stdin, stdout and stderr
3  *
4  * Copyright (c) 2019, NLnet Labs. All rights reserved.
5  *
6  * See LICENSE for the license.
7  *
8  */
9 #ifndef POPEN3_H
10 #define POPEN3_H
11 
12 #include <stdio.h>
13 #include <sys/types.h>
14 
15 /*
16  * Execute a command and connect stdin, stdout and stderr of the process to
17  * respectively finptr, foutptr and ferrptr if non-NULL. The process
18  * identifier of the new process is returned on success and the pointers to
19  * the FILE handles will have been set. On failure, -1 is returned and none
20  * of the pointers will have been set.
21  */
22 pid_t popen3(char *const *command,
23              int *fdinptr,
24              int *fdoutptr,
25              int *fderrptr);
26 
27 #endif /* POPEN3_H */
28