[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

RE: Fwd: "getopt.h" no longer part of <stdlib.h>



Title: RE: Fwd: "getopt.h" no longer part of <stdlib.h>


> -----Original Message-----
> From: Ulrich Drepper [mailto:drepper@cygnus.com]
> Sent: Wednesday, August 25, 1999 1:34 PM
> To: Joel Klecker
> Cc: libc-hacker@sourceware.cygnus.com; debian-glibc@lists.debian.org;
> Brent Fulgham
> Subject: Re: Fwd: "getopt.h" no longer part of <stdlib.h>
>
>
> > One of the packages I maintain uses the tried-and-true
> > getopt function from the C library.  The standard System V
> > semantic is that get getopt function is included when you
> > include <stdlib.h>.
>
> getopt.h never was included in stdlib.h.  Old SysV systems included it
> in stdio.h which was deprecarted in Unix98 and will be removed in the
> next revision.
>
Looking at an earlier release of GLIBC I see that getopt is actually
*not* prototyped in <stdlib.h>   However, if I refer to my only
SysV reference (UNIX Systems Programming for SVR4) it explicitely
states that the function prototype is in <stdlib.h>  Furthermore,
a quick `grep` through my AIX include files here at work shows
getopt in <stdlib.h>, although it seems to be prototyped in
<unistd.h> as well.

> The only portable way to get to the prototypes is using unistd.h.
> Which is of course logical since getopt is a POSIX function.
>

All I can tell you is that something seems to have changed in the
way the header files are configured between GlibC 2.1.1 and 2.1.2,
which has resulted in the need for a compile-time test for library
revision.  If, as you suggest, including "unistd.h" will just work,
then I will be perfectly happy to modify the source. (Is that
what you are saying? :-)

Thanks,

-Brent



Reply to: