Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 8 Mar 1999 13:23:08 +0100 (CET)
From:      Martin Kammerhofer <dada@sbox.tu-graz.ac.at>
To:        freebsd-questions@freebsd.org
Cc:        Florian Schintke <schintke@cs.tu-berlin.de>
Subject:   getopt(3) and POSIX
Message-ID:  <Pine.BSF.3.96.990308131014.1391A-100000@localhost.tu-graz.ac.at>

next in thread | raw e-mail | index | archive | help
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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.BSF.3.96.990308131014.1391A-100000>