Skip to content

Latest commit

 

History

History
70 lines (43 loc) · 1.82 KB

README.md

File metadata and controls

70 lines (43 loc) · 1.82 KB

pexec(3)

NAME

pexec - execute file in an interprocess channel

SYNOPSIS

#include "pexec.h"

int pexecl(pid_t *pid, const char *path, const char *arg , ...);

int pexeclp(pid_t *pid, const char *file, const char *arg , ...);

int pexecle(pid_t *pid, const char *path, const char *arg , ...);

int pexecv(pid_t *pid, const char *path, char * const argv[]);

int pexecvp(pid_t *pid, const char *file, char * const argv[]);

int pexecve(pid_t *pid, const char *path, char * const argv[], char * const envp[]);

#ifdef _GNU_SOURCE

pid_t pexecvpe(const char *file, char * const argv[] , char * const envp[]);

#endif

DESCRIPTION

The pexec(3) familly of functions combines pipe(3p), fork(2) and exec(3) functions.

These functions open a pipe(3p) between the caller and the new created process.

The process is fork(2)'ed and its image is exec(3)'ed with the content of path or file given in parameter using argv as argument and envp as environment.

For a more thorough description of the pexec(3) functions familly, please refers theirs exec(3) equivalents.

RETURN VALUE

Upon successful completion, these functions return the file descriptor of the created pipe; if not NULL, the PID of the child process is set to pid. Otherwise, these functions shall return −1 and set errno to indicate the error.

AUTHOR

Written by Gaël PORTAY gael.portay@savoirfairelinux.com

COPYRIGHT

Copyright (c) 2017 Gaël PORTAY

This program is free software: you can redistribute it and/or modify it under the terms of the MIT License.

SEE ALSO

pipe(3p), fork(2), exec(3)