--- libelwix/inc/elwix/apio.h 2015/06/25 17:53:49 1.4 +++ libelwix/inc/elwix/apio.h 2024/12/05 12:33:49 1.6.40.1 @@ -3,7 +3,7 @@ * by Michael Pounov * * $Author: misho $ -* $Id: apio.h,v 1.4 2015/06/25 17:53:49 misho Exp $ +* $Id: apio.h,v 1.6.40.1 2024/12/05 12:33:49 misho Exp $ * ************************************************************************** The ELWIX and AITNET software is distributed under the following @@ -12,7 +12,7 @@ terms: All of the documentation and software included in the ELWIX and AITNET Releases is copyrighted by ELWIX - Sofia/Bulgaria -Copyright 2004 - 2015 +Copyright 2004 - 2024 by Michael Pounov . All rights reserved. Redistribution and use in source and binary forms, with or without @@ -62,6 +62,9 @@ typedef SLIST_HEAD(, tagPIOPID) pio_pid_t; extern pio_pid_t pio_pidlist; +#ifdef __cplusplus +extern "C" { +#endif /* * e_popen() - ELWIX replacement of standard popen @@ -69,6 +72,7 @@ extern pio_pid_t pio_pidlist; * @command = command * @type = type * @ppid = return pid of child program + * If value of *ppid is -1 when invoke routine then child will be session leader * return: NULL error or !=NULL open program */ #ifdef POPEN_STREAM @@ -77,6 +81,22 @@ FILE *e_popen(const char *command, const char *type, p int e_popen(const char *command, const char *type, pid_t *ppid); #endif /* + * e_popen2() - ELWIX replacement of standard popen with post close of chosen handles + * + * @command = command + * @type = type + * @ppid = return pid of child program + * If value of *ppid is -1 when invoke routine then child will be session leader + * @fds = file descriptor array for close when fork + * @fdslen = fds number of descriptors + * return: NULL error or !=NULL open program + */ +#ifdef POPEN_STREAM +FILE *e_popen2(const char *command, const char *type, pid_t *ppid, int *fds, size_t fdslen); +#else +int e_popen2(const char *command, const char *type, pid_t *ppid, int *fds, size_t fdslen); +#endif +/* * e_pclose() - ELWIX replacement of standard pclose * * @iop = popen handle @@ -108,5 +128,8 @@ struct tagPIOPID *pio_pgetpid(int iop); */ int pio_pchkpid(array_t ** __restrict pids); +#ifdef __cplusplus +} +#endif #endif