From owner-freebsd-questions Tue Mar 9 10:36:47 1999 Delivered-To: freebsd-questions@freebsd.org Received: from ns1.tu-graz.ac.at (ns1.tu-graz.ac.at [129.27.2.3]) by hub.freebsd.org (Postfix) with ESMTP id 4E2D714EBC for ; Tue, 9 Mar 1999 10:36:29 -0800 (PST) (envelope-from dada@ns1.tu-graz.ac.at) Received: from fcggsg07.icg.tu-graz.ac.at (fcggsg07.icg.tu-graz.ac.at [129.27.201.16]) by ns1.tu-graz.ac.at (8.8.6/8.8.6) with ESMTP id TAA08400; Tue, 9 Mar 1999 19:36:10 +0100 (MET) Received: from localhost.tu-graz.ac.at (isdn282.tu-graz.ac.at [129.27.241.82]) by fcggsg07.icg.tu-graz.ac.at (8.8.8/8.8.8) with ESMTP id TAA06912; Tue, 9 Mar 1999 19:36:06 +0100 (MET) Received: from localhost (localhost.tu-graz.ac.at [127.0.0.1]) by localhost.tu-graz.ac.at (8.8.8/8.8.8) with SMTP id NAA01478; Mon, 8 Mar 1999 13:23:08 +0100 (CET) (envelope-from dada@localhost.tu-graz.ac.at) Date: Mon, 8 Mar 1999 13:23:08 +0100 (CET) From: Martin Kammerhofer To: freebsd-questions@freebsd.org Cc: Florian Schintke Subject: getopt(3) and POSIX Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG On my FreeBSD 2.2.8 system I see in /usr/include/stdlib.h #if !defined(_ANSI_SOURCE) && !defined(_POSIX_SOURCE) [...snip...] extern char *optarg; /* getopt(3) external variables */ extern int opterr, optind, optopt; int getopt __P((int, char * const *, const char *)); Nevertheless manpage getopt(3) says: [...snip...] EXTENSIONS The optreset variable was added to make it possible to call the getopt() function multiple times. This is an extension to the IEEE Std1003.2 (``POSIX.2'') specification. If getopt(3) is Posix - why doesn't it compile if one defines _POSIX_SOURCE? Is this a bug or a feature? TIA, Martin To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message