This is the mail archive of the libc-hacker@sourceware.cygnus.com mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Problem with popen/pclose


hjl@lucon.org (H.J. Lu) writes:

> But it doesn't want to see popen/pclose. Can we do
> 
> #if defined _POSIX_C_SOURCE && _POSIX_C_SOURCE == 2 || \
>     defined _XOPEN_SOURCE
> # define __USE_POSIX2   1
> #endif

No, this does not make sense.  Then any program which wants a modern
POSIX environment and sets _POSIX_C_SOURCE to 199506L looses all
POSIX.2 funcationality.

It must simply be accepted that the standards kind of contradict each
other here.  The >= 2 is necessary and I'm a revision of POSIX.2 will
establish this.

> #if defined __USE_UNIX98 || defined __USE_SVID  || \
>     defined __USE_BSD || defined __USE_MISC
> /* Create a new stream connected to a pipe running the given command.  */
> extern FILE *popen __P ((__const char *__command, __const char *__modes));
> 
> /* Close a stream opened by popen and return the status of its child.  */
> extern int pclose __P ((FILE *__stream));
> #endif

This is also wrong since popen is a POSIX.2 function.

There is no way out.

-- 
---------------.      drepper at gnu.org  ,-.   1325 Chesapeake Terrace
Ulrich Drepper  \    ,-------------------'   \  Sunnyvale, CA 94089 USA
Cygnus Solutions `--' drepper at cygnus.com   `------------------------


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]