1filter_create_fd(3) util/filter.h filter_create_fd(3)
2
3
4
6 filter_create_fd - Create a sub process and return the requested pipes
7
9 #include <util/filter.h>
10
11
12 NEOERR *filter_create_fd(const char *cmd, int *fdin, int *fdout, int *fderr,
13 pid_t *pid);
14
15
16
17
19 cmd -> the sub command to execute. Will be executed with
20 /bin/sh -c
21 fdin -> pointer to return the stdin pipe, or NULL if you don't
22 want the stdin pipe
23 fdout -> pointer to return the stdout pipe, or NULL if you don't
24 want the stdout pipe
25 fderr -> pointer to return the stderr pipe, or NULL if you don't
26 want the stderr pipe
27
28
30 filter_create_fd and filter_create_fp are what popen
31
32 been: a mechanism to create sub processes and have pipes to all their
33 input/output. The concept was taken from mutt, though python has some‐
34 thing similar with popen3/popen4. You control which pipes the function
35 returns by the fdin/fdout/fderr arguments. A NULL value means "don't
36 create a pipe", a pointer to an int will cause the pipes to be created
37 and the value of the file descriptor stored in the int. You will have
38 to close(2) the file descriptors yourself.
39
40
42 fdin -> the stdin file descriptor of the sub process
43 fdout -> the stdout file descriptor of the sub process
44 fderr -> the stderr file descriptor of the sub process
45 pid -> the pid of the sub process
46
47
49 filter_wait(3), filter_create_fp(3), filter_create_fd
50
51
52
53ClearSilver 12 July 2007 filter_create_fd(3)