standards/63173: Patch to add getopt_long_only(3) to libc
Marius Strobl
marius at alchemy.franken.de
Sun Feb 22 08:20:11 PST 2004
The following reply was made to PR standards/63173; it has been noted by GNATS.
From: Marius Strobl <marius at alchemy.franken.de>
To: Andrey Chernov <ache at nagual.pp.ru>
Cc: FreeBSD-gnats-submit at FreeBSD.ORG, ru at FreeBSD.ORG
Subject: Re: standards/63173: Patch to add getopt_long_only(3) to libc
Date: Sun, 22 Feb 2004 17:12:41 +0100
On Sat, Feb 21, 2004 at 09:48:14PM +0300, Andrey Chernov wrote:
> On Sat, Feb 21, 2004 at 04:57:06PM +0100, Marius Strobl wrote:
> > after applying the patch still doesn't implement getopt(3) and
> > therefore replace src/lib/libc/stdlib/getopt.c, i.e. it doesn't
> > define REPLACE_GETOPT, yet. This is something that should be taken
> > into consideration for FreeBSD 6 (regardless if the patch is applied
> > or not).
>
> Please always consider POSIX as superceeded standard against GNU/Linux.
>
> It means your patch for header is wrong. If POSIX says that getopt() must
> be declared in <unistd.h>, it is only place where is must be declared, and
> not in <getopt.h> etc. If you need its declaration in non-standard header
> <getopt.h>, <unistd.h> must be included, as was done before your patch.
> Also please remove all getopt()-related redeclarations from <getopt.h>
Well, that's exactly the point where I got confused as e.g. according
to the Single UNIX Specification Version 2 getsubopt(3) should live in
stdlib.h, yet on FreeBSD it's primarily in unistd.h with a second
declaration in stdlib.h. :)
The intention of the way it's done in OpenBSD and the patch is to
declare getopt(3) etc. unconditionally as done by the GNU getopt.h and
not in specific namespaces (like __XSI_VISIBLE etc.). However, I don't
feel strongly about it either way. I put up a new patch keeping getopt.h
the way it was at:
ftp://ftp.zeist.de/pub/patches/src_getopt_long_only.diff2
Thanks for having a look at this!
More information about the freebsd-standards
mailing list