3 /* Which POSIX version to conform to, for utilities.
5 Copyright (C) 2002 Free Software Foundation, Inc.
7 This program is free software; you can redistribute it and/or modify it
8 under the terms of the GNU Library General Public License as published
9 by the Free Software Foundation; either version 2, or (at your option)
12 This program is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 Library General Public License for more details.
17 You should have received a copy of the GNU Library General Public
18 License along with this program; if not, write to the Free Software
19 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
22 /* Written by Paul Eggert. */
31 #if !HAVE_DECL_GETENV && !defined getenv
38 #ifndef _POSIX2_VERSION
39 # define _POSIX2_VERSION 0
42 /* The POSIX version that utilities should conform to. The default is
43 specified by the system. */
48 long int v
= _POSIX2_VERSION
;
49 char const *s
= getenv ("_POSIX2_VERSION");
54 long int i
= strtol (s
, &e
, 10);
59 return v
< INT_MIN
? INT_MIN
: v
< INT_MAX
? v
: INT_MAX
;