Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

filter_create_fd(3) [debian man page]

filter_create_fd(3)						   util/filter.h					       filter_create_fd(3)

NAME
filter_create_fd - Create a sub process and return the requested pipes SYNOPSIS
#include <util/filter.h> NEOERR *filter_create_fd(const char *cmd, int *fdin, int *fdout, int *fderr, pid_t *pid); ARGUMENTS
cmd -> the sub command to execute. Will be executed with /bin/sh -c fdin -> pointer to return the stdin pipe, or NULL if you don't want the stdin pipe fdout -> pointer to return the stdout pipe, or NULL if you don't want the stdout pipe fderr -> pointer to return the stderr pipe, or NULL if you don't want the stderr pipe DESCRIPTION
filter_create_fd and filter_create_fp are what popen been: a mechanism to create sub processes and have pipes to all their input/output. The concept was taken from mutt, though python has something similar with popen3/popen4. You control which pipes the function returns by the fdin/fdout/fderr arguments. A NULL value means "don't create a pipe", a pointer to an int will cause the pipes to be created and the value of the file descriptor stored in the int. You will have to close(2) the file descriptors yourself. RETURN VALUE
fdin -> the stdin file descriptor of the sub process fdout -> the stdout file descriptor of the sub process fderr -> the stderr file descriptor of the sub process pid -> the pid of the sub process SEE ALSO
filter_wait(3), filter_create_fp(3), filter_create_fd ClearSilver 12 July 2007 filter_create_fd(3)

Check Out this Related Man Page

Ns_Exec(3aolserver)					   AOLserver Library Procedures 				       Ns_Exec(3aolserver)

__________________________________________________________________________________________________________________________________________________

NAME
Ns_ExecArgblk, Ns_ExecArgv, Ns_ExecProc, Ns_ExecProcess, Ns_Fork, Ns_GetEnviron, Ns_WaitForProcess, Ns_WaitProcess, ns_fork - External process execution SYNOPSIS
#include "ns.h" int Ns_ExecArgblk(char *exec, char *dir, int fdin, int fdout, char *args, Ns_Set *env) int Ns_ExecArgv(char *exec, char *dir, int fdin, int fdout, char **argv, Ns_Set *env) int Ns_ExecProc(char *exec, char **argv) int Ns_ExecProcess(char *exec, char *dir, int fdin, int fdout, char *args, Ns_Set *env) int Ns_Fork(void) char **Ns_GetEnviron(void) int Ns_WaitForProcess(int pid, int *statusPtr) int Ns_WaitProcess(int pid) int ns_fork(void) _________________________________________________________________ DESCRIPTION
These functions handle fork and exec operations. See files: nsd/exec.c, nsd/tclenv.c and nsthread/fork.c. Ns_ExecArgblk(exec, dir, fdin, fdout, args, env) Executes a command in a child process. Return process id of child process exec'ing the command or -1 on failure. Provides extended error checking and error messages. Ns_ExecArgv(exec, dir, fdin, fdout, argv, env) Execute a command in a child process using fork(2) and execve(2), returns the process id of child process exec'ing the command or -1 on failure. The child sends an extended error message to the parent. Ns_ExecProc(exec, argv) Executes a command in a child process. Returns the process id of the child process exec'ing the command or -1 on failure. Simpli- fies call to Ns_ExecArgv. Ns_ExecProcess(exec, dir, fdin, fdout, args, env) Executes a command in a child process. Returns the process id of the child process exec'ing the command or -1 on failure. Calls Ns_ExecArgblk with same arguments. Ns_Fork() Posix style fork(), using fork1() on Solaris if needed. See fork(2) man page. Calls ns_fork. Ns_GetEnviron() Returns pointer to the environment vector. Ns_WaitForProcess(pid, statusPtr) Wait for child process. Returns NS_OK on success, or NS_ERROR on failure. *statusPtr is set to the exit code of the child process. Ns_WaitProcess(pid) Wait for child process. Calls Ns_WaitForProcess with NULL statusPtr. Returns NS_OK on success, or NS_ERROR on failure. ns_fork() Posix style fork(), using fork1() on Solaris if needed. SEE ALSO
nsd(1), info(n) KEYWORDS
AOLserver 4.0 Ns_Exec(3aolserver)
Man Page