History log of /netbsd-current/include/limits.h
Revision (<<< Hide revision tags) (Show revision tags >>>) Date Author Comments
# 1.43 31-May-2022 riastradh

libc: Reintroduce getentropy.

This was introduced two years ago when the getrandom/getentropy API
question was still open, and removed because the discussion was
ongoing. Now getentropy is more widely adopted and soon to be in
POSIX. So reintroduce the symbol into libc since we'll be keeping it
anyway. Discussion of details of the semantics, as interpreted by
NetBSD, is ongoing, but the symbol needs to get in before the
netbsd-10 branch. The draft POSIX text is
(https://www.opengroup.org/austin/docs/austin_1110.pdf):

SYNOPSIS
#include <unistd.h>

int getentropy(void *buffer, size_t length);

DESCRIPTION
The getentropy() function shall write length bytes of data
starting at the location pointed to by buffer. The output
shall be unpredictable high quality random data, generated by
a cryptographically secure pseudo-random number
generator. The maximum permitted value for the length
argument is given by the {GETENTROPY_MAX} symbolic constant
defined in <limits.h>.

RETURN VALUES
Upon successful completion, getentropy() shall return 0;
otherwise, -1 shall be retunred and errno set to indicate the
error.

ERRORS
The getentropy() function shall fail if:

[EINVAL] The value of length is greater than
{GETENTROPY_MAX}.

The getentropy() function may fail if:

[ENOSYS] The system does not provide the necessary
source of entropy.

RATIONALE
The getentropy() function is not a cancellation point.

Minor changes from the previous introduction of getentropy into libc:

- Return EINVAL, not EIO, on buflen > 256.
- Define GETENTROPY_MAX in limits.h.

The declaration of getentropy in unistd.h and definition of
GETENTROPY_MAX in limits.h are currently conditional on
_NETBSD_SOURCE. When the next revision of POSIX is finalized, we can
expose them also under _POSIX_C_SOURCE > 20yymmL as usual -- and this
can be done as a pullup without breaking existing compiled programs.


Revision tags: cjep_sun2x-base1 cjep_sun2x-base cjep_staticlib_x-base1 cjep_staticlib_x-base phil-wifi-20200421 phil-wifi-20200411 is-mlppp-base phil-wifi-20200406 phil-wifi-20191119
# 1.42 15-Sep-2019 christos

remove comment for incomplete x/open impl (kamil)


# 1.41 15-Sep-2019 christos

Remove the _INCOMPLETE_XOPEN_C063 stuff.


Revision tags: netbsd-9-2-RELEASE netbsd-9-1-RELEASE netbsd-8-2-RELEASE netbsd-9-0-RELEASE netbsd-9-0-RC2 netbsd-9-0-RC1 netbsd-9-base phil-wifi-20190609 netbsd-8-1-RELEASE netbsd-8-1-RC1 pgoyette-compat-merge-20190127 pgoyette-compat-20190127 pgoyette-compat-20190118 pgoyette-compat-1226 pgoyette-compat-1126 pgoyette-compat-1020 pgoyette-compat-0930 pgoyette-compat-0906 pgoyette-compat-0728 netbsd-8-0-RELEASE phil-wifi-base pgoyette-compat-0625 netbsd-8-0-RC2 pgoyette-compat-0521 pgoyette-compat-0502 pgoyette-compat-0422 netbsd-8-0-RC1 pgoyette-compat-0415 pgoyette-compat-0407 pgoyette-compat-0330 pgoyette-compat-0322 pgoyette-compat-0315 pgoyette-compat-base matt-nb8-mediatek-base perseant-stdc-iso10646-base netbsd-8-base prg-localcount2-base3 prg-localcount2-base2 prg-localcount2-base1 prg-localcount2-base pgoyette-localcount-20170426 bouyer-socketcan-base1 pgoyette-localcount-20170320 bouyer-socketcan-base pgoyette-localcount-20170107 pgoyette-localcount-20161104 localcount-20160914 pgoyette-localcount-20160806
# 1.40 04-Aug-2016 christos

branches: 1.40.14;
Realtime signal support from GSoC 2016, Charles Cui.


Revision tags: pgoyette-localcount-20160726
# 1.39 21-Jul-2016 njoly

According to Opengroup online specifications[1], _POSIX_CPUTIME and
_POSIX_THREAD_CPUTIME options should be present in unistd.h not
limits.h. Move them with other options.

[1] http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/unistd.h.html


Revision tags: pgoyette-localcount-base
# 1.38 10-Jun-2016 christos

branches: 1.38.2;
GSoC 2016: Charles Cui: Add timer related macros
_POSIX_CPUTIME
_POSIX_THREAD_CPUTIME
_POSIX_DELAYTIMER_MAX


# 1.37 10-Jun-2016 christos

GSoC 2016: Charles Cui: add SEM_NSEMS_MAX


# 1.36 08-Mar-2016 christos

- GC pts_fired, and fix the comment about MAX_TIMERS
- Bump MAX_TIMERS to 36 so that we have 32 POSIX user timers which is the
minimum required.


# 1.35 26-Feb-2016 christos

We only have 28 timers available.


# 1.34 29-May-2015 manu

Make PTHREAD_KEYS_MAX dynamically adjustable

NetBSD's PTHREAD_KEYS_MAX is set to 256, which is low compared to
other systems like Linux (1024) or MacOS X (512). As a result some
setups tested on Linux will exhibit problems on NetBSD because of
pthread_keys usage beyond the limit. This happens for instance on
Apache with various module loaded, and in this case no particular
developper can be blamed for going beyond the limit, since several
modules from different sources contribute to the problem.

This patch makes the limit conigurable through the PTHREAD_KEYS_MAX
environement variable. If undefined, the default remains unchanged
(256). In any case, the value cannot be lowered below POSIX-mandated
_POSIX_THREAD_KEYS_MAX (128).

While there:
- use EXIT_FAILURE instead of 1 when calling err(3) in libpthread.
- Reset _POSIX_THREAD_KEYS_MAX to POSIX mandated 128, instead of 256.


Revision tags: netbsd-7-0-2-RELEASE netbsd-7-0-1-RELEASE netbsd-7-0-RELEASE netbsd-7-0-RC3 netbsd-7-0-RC2 netbsd-7-0-RC1 netbsd-7-base yamt-pagecache-base9 tls-earlyentropy-base riastradh-xf86-video-intel-2-7-1-pre-2-21-15 riastradh-drm2-base3 riastradh-drm2-base2 riastradh-drm2-base1 riastradh-drm2-base agc-symver-base yamt-pagecache-base8 yamt-pagecache-base7 tls-maxphys-base
# 1.33 18-Nov-2012 manu

branches: 1.33.8;
Add most system calls for POSIX extended API set, part 2, with test cases:
faccessat(2), fchmodat(2), fchownat(2), fstatat(2), mkdirat(2), mkfifoat(2),
mknodat(2), linkat(2), readlinkat(2), symlinkat(2), renameat(2), unlinkat(2),
utimensat(2), openat(2).

Also implement O_SEARCH for openat(2)

Still missing:
- some flags for openat(2)
- fexecve(2) implementation


Revision tags: yamt-pagecache-base6 yamt-pagecache-base5 yamt-pagecache-base4
# 1.32 28-Mar-2012 christos

branches: 1.32.2;
make CHAR_{MIN,MAX} work for both -fsigned-char and -funsigned-char


Revision tags: netbsd-6-0-6-RELEASE netbsd-6-1-5-RELEASE netbsd-6-1-4-RELEASE netbsd-6-0-5-RELEASE netbsd-6-1-3-RELEASE netbsd-6-0-4-RELEASE netbsd-6-1-2-RELEASE netbsd-6-0-3-RELEASE netbsd-6-1-1-RELEASE netbsd-6-0-2-RELEASE netbsd-6-1-RELEASE netbsd-6-1-RC4 netbsd-6-1-RC3 netbsd-6-1-RC2 netbsd-6-1-RC1 netbsd-6-0-1-RELEASE matt-nb6-plus-nbase netbsd-6-0-RELEASE netbsd-6-0-RC2 matt-nb6-plus-base netbsd-6-0-RC1 netbsd-6-base yamt-pagecache-base3 yamt-pagecache-base2 yamt-pagecache-base
# 1.31 06-Oct-2011 christos

branches: 1.31.2;
Fix pthreads variables:
- Add missing stuff from Issue 6 (some of it commented out)
- Fix _POSIX_THREAD -> PTHREAD variable confusion
- Amend PTHREAD_KEYS_MAX to 256 since this is what libpthread defined internally


# 1.30 16-Aug-2011 manu

Add macros to hide OpenGroup extened API set 2 from GNU configure. This
is a temporary workaround until the implementation is completed.


Revision tags: cherry-xenmp-base uebayasi-xip-base7 bouyer-quota2-nbase bouyer-quota2-base matt-mips64-premerge-20101231 uebayasi-xip-base6 uebayasi-xip-base5 uebayasi-xip-base4 uebayasi-xip-base3 uebayasi-xip-base2
# 1.29 07-Jun-2010 tnozaki

1. MB_LEN_MAX switch MD to MI.
2. unfortunately hppa's MB_LEN_MAX is defined incorrectly 6 instead of 32
so we have to add more setlocale(3) __RENAME func, __setlocale50.
3. move setlocale1.c and setlocale32.c to lib/libc/compat/locale/*
prepareing for next libc major crunk.
4. bump libc minor version.


Revision tags: netbsd-5-1-5-RELEASE netbsd-5-1-4-RELEASE netbsd-5-1-3-RELEASE netbsd-5-1-2-RELEASE netbsd-5-1-1-RELEASE matt-nb5-mips64-premerge-20101231 matt-nb5-pq3-base netbsd-5-1-RELEASE netbsd-5-1-RC4 matt-nb5-mips64-k15 netbsd-5-1-RC3 netbsd-5-1-RC2 uebayasi-xip-base1 netbsd-5-1-RC1 uebayasi-xip-base netbsd-5-0-2-RELEASE matt-nb5-mips64-premerge-20091211 matt-premerge-20091211 matt-nb5-mips64-u2-k2-k4-k7-k8-k9 matt-nb4-mips64-k7-u2a-k9b matt-nb5-mips64-u1-k1-k5 netbsd-5-0-1-RELEASE jym-xensuspend-nbase netbsd-5-0-RELEASE netbsd-5-0-RC4 netbsd-5-0-RC3 netbsd-5-0-RC2 jym-xensuspend-base netbsd-5-0-RC1 christos-time_t-nbase christos-time_t-base netbsd-5-base matt-mips64-base2 wrstuden-revivesa-base-3 wrstuden-revivesa-base-2
# 1.28 27-Aug-2008 christos

branches: 1.28.4; 1.28.6; 1.28.14;
Make _POSIX_TZNAME_MAX=6 per SUSv3, from Andy Shevchenko


# 1.27 04-Aug-2008 matt

Add _POSIX_HOST_NAME_MAX and _POSIX_SYMLOOP_MAX to <limits.h> and add some
references to them in <sys/param.h>
in <stdio.h> also export v*scanf when _ISOC99_SOURCE is defined

From andy dot shevchenko at gmail dot com.


Revision tags: wrstuden-revivesa-base-1 simonb-wapbl-nbase yamt-pf42-base4 simonb-wapbl-base yamt-pf42-base3 hpcarm-cleanup-nbase yamt-pf42-baseX yamt-pf42-base2 wrstuden-revivesa-base yamt-pf42-base keiichi-mipv6-base matt-armv6-nbase cube-autoconf-base matt-armv6-base hpcarm-cleanup-base
# 1.26 21-Sep-2007 rmind

branches: 1.26.8;
- Correct the value of _POSIX_SYMLINK_MAX as defined in standard.
Closes PR/37007 by Ighighi.
- While here, increase _POSIX_CHILD_MAX as suggested by standard.


# 1.25 07-Sep-2007 rmind

Implementation of POSIX message queues.

Reviewed by: <ad>, <tech-kern>


Revision tags: matt-mips64-base
# 1.24 01-May-2007 rmind

branches: 1.24.4;
- Create sysctl nodes for AIO.
- Add POSIX defined system variables and constants of AIO_LISTIO_MAX and
AIO_MAX values. Both with _POSIX_ASYNCHRONOUS_IO, provide them in
sysconf(3) and getconf(1) interfaces.
- Clean up sysconf(3) for handling sysctl nodes dynamically.


Revision tags: netbsd-4-0-1-RELEASE wrstuden-fixsa-newbase wrstuden-fixsa-base-1 netbsd-4-0-RELEASE netbsd-4-0-RC5 netbsd-4-0-RC4 netbsd-4-0-RC3 netbsd-4-0-RC2 netbsd-4-0-RC1 netbsd-3-1-1-RELEASE netbsd-3-0-3-RELEASE wrstuden-fixsa-base abandoned-netbsd-4-base netbsd-3-1-RELEASE netbsd-3-0-2-RELEASE netbsd-3-1-RC4 netbsd-3-1-RC3 netbsd-3-1-RC2 netbsd-3-1-RC1 netbsd-4-base netbsd-3-0-1-RELEASE netbsd-3-0-RELEASE netbsd-3-0-RC6 netbsd-3-0-RC5 netbsd-3-0-RC4 netbsd-3-0-RC3 netbsd-3-0-RC2 netbsd-3-0-RC1 netbsd-3-base
# 1.23 10-Nov-2004 lukem

Implement sysconf(3) _SC_GETGR_R_SIZE_MAX and _SC_GETPW_R_SIZE_MAX for
the 1003.1-2001 Thread Safe Functions (TSF) getgrnam_r(3) and getpwnam_r(3).

These are not implemented in sysctl(3) "user.*", since that adds a lot
of complexity in the implementation for no real benefit.


Revision tags: netbsd-2-0-3-RELEASE netbsd-2-1-RELEASE netbsd-2-1-RC6 netbsd-2-1-RC5 netbsd-2-1-RC4 netbsd-2-1-RC3 netbsd-2-1-RC2 netbsd-2-1-RC1 netbsd-2-0-2-RELEASE netbsd-2-0-1-RELEASE netbsd-2-base netbsd-2-0-RELEASE netbsd-2-0-RC5 netbsd-2-0-RC4 netbsd-2-0-RC3 netbsd-2-0-RC2 netbsd-2-0-RC1 netbsd-2-0-base
# 1.22 07-Aug-2003 agc

Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22270, verified by myself.


# 1.21 16-Jul-2003 nathanw

Add the _POSIX_THREAD and _POSIX_TIMER mandated minimum limits.


# 1.20 28-Apr-2003 bjh21

Add a new feature-test macro, _NETBSD_SOURCE. If this is defined
by the application, all NetBSD interfaces are made visible, even
if some other feature-test macro (like _POSIX_C_SOURCE) is defined.
<sys/featuretest.h> defined _NETBSD_SOURCE if none of _ANSI_SOURCE,
_POSIX_C_SOURCE and _XOPEN_SOURCE is defined, so as to preserve
existing behaviour.

This has two major advantages:
+ Programs that require non-POSIX facilities but define _POSIX_C_SOURCE
can trivially be overruled by putting -D_NETBSD_SOURCE in their CFLAGS.
+ It makes most of the #ifs simpler, in that they're all now ORs of the
various macros, rather than having checks for (!defined(_ANSI_SOURCE) ||
!defined(_POSIX_C_SOURCE) || !defined(_XOPEN_SOURCE)) all over the place.

I've tried not to change the semantics of the headers in any case where
_NETBSD_SOURCE wasn't defined, but there were some places where the
current semantics were clearly mad, and retaining them was harder than
correcting them. In particular, I've mostly normalised things so that
_ANSI_SOURCE gets you the smallest set of stuff, then _POSIX_C_SOURCE,
_XOPEN_SOURCE and _NETBSD_SOURCE in that order.

Tested by building for vax, encouraged by thorpej, and uncontested in
tech-userlevel for a week.


# 1.19 18-Jan-2003 christos

oops, erased word accidentally.


# 1.18 18-Jan-2003 christos

avoid TMP_MAX redefinition


Revision tags: nathanw_sa_before_merge fvdl_fs64_base nathanw_sa_base
# 1.17 18-Nov-2002 kleink

Update for 1003.1-2001 base and XSI changes.


# 1.16 04-Aug-2002 soren

Back out previous - I was confused.


# 1.15 04-Aug-2002 soren

Per IEEE 1003.1-2001, omit from <limits.h> those Pathname Variable Values
that may vary between filesystems: _POSIX_LINK_MAX, _POSIX_NAME_MAX, and
_POSIX_PATH_MAX. These are to be obtained from pathconf() instead.


# 1.14 04-Aug-2002 soren

As of IEEE (POSIX) 1003.1-2001, _POSIX_PATH_MAX must be at least 256 rather
than 255 and is now defined to include the terminating NUL.


Revision tags: netbsd-1-6-PATCH002-RELEASE netbsd-1-6-PATCH002 netbsd-1-6-PATCH002-RC4 netbsd-1-6-PATCH002-RC3 netbsd-1-6-PATCH002-RC2 netbsd-1-6-PATCH002-RC1 netbsd-1-6-PATCH001 netbsd-1-6-PATCH001-RELEASE netbsd-1-6-PATCH001-RC3 netbsd-1-6-PATCH001-RC2 netbsd-1-6-PATCH001-RC1 netbsd-1-6-RELEASE netbsd-1-6-RC3 netbsd-1-6-RC2 netbsd-1-6-RC1 netbsd-1-6-base netbsd-1-5-PATCH003 netbsd-1-5-PATCH002 netbsd-1-5-PATCH001 netbsd-1-5-RELEASE netbsd-1-5-BETA2 netbsd-1-5-BETA netbsd-1-5-ALPHA2 netbsd-1-5-base minoura-xpg4dl-base wrstuden-devbsize-19991221 wrstuden-devbsize-base comdex-fall-1999-base
# 1.13 27-Sep-1999 kleink

branches: 1.13.8;
1003.1c: add {LOGIN_NAME_MAX}.


# 1.12 06-Sep-1999 kleink

branches: 1.12.2;
Bump NL_TEXTMAX to 2048 (== _POSIX2_LINE_MAX, which is the minimum value
required by XSH5.)


Revision tags: netbsd-1-4-PATCH003 netbsd-1-4-PATCH002 netbsd-1-4-PATCH001 netbsd-1-4-RELEASE netbsd-1-4-base
# 1.11 03-Aug-1998 kleink

Per XSH5, define _XOPEN_IOV_MAX.


# 1.10 08-Jul-1998 kleink

For the sake of XPG3 and later, provide TMP_MAX; consistent with the defintion
in <stdio.h>. Also, rearrange name space protection a bit.


# 1.9 02-Feb-1998 perry

merge lite-2


Revision tags: netbsd-1-3-PATCH003 netbsd-1-3-PATCH003-CANDIDATE2 netbsd-1-3-PATCH003-CANDIDATE1 netbsd-1-3-PATCH003-CANDIDATE0 netbsd-1-3-PATCH002 netbsd-1-3-PATCH001 netbsd-1-3-RELEASE netbsd-1-3-BETA netbsd-1-3-base
# 1.8 21-Oct-1996 jtc

Fix typo: _POSIX_SSIZE_MAX was set to wrong value


Revision tags: netbsd-1-2-PATCH001 netbsd-1-2-RELEASE netbsd-1-2-BETA netbsd-1-2-base netbsd-1-1-PATCH001 netbsd-1-1-RELEASE netbsd-1-1-base
# 1.7 26-Oct-1994 cgd

new RCS ID format.


# 1.6 05-Oct-1994 jtc

Add constants required by XPG3


Revision tags: netbsd-1-0-PATCH06 netbsd-1-0-PATCH05 netbsd-1-0-PATCH04 netbsd-1-0-PATCH03 netbsd-1-0-PATCH02 netbsd-1-0-PATCH1 netbsd-1-0-PATCH0 netbsd-1-0-RELEASE netbsd-1-0-base
# 1.5 12-Oct-1993 jtc

POSIX2_VERSION macro is supposed to live in <unistd.h>


# 1.4 24-Sep-1993 jtc

Do not #define the _POSIX_FOO constants if compliling in strict ANSI mode.
Define the _POSIX_SSIZE_MAX, _POSIX_STREAM_MAX, and _POSIX_TZNAME_MAX constants
added in 1003.1-90.


# 1.3 21-Sep-1993 jtc

POSIX_EQUIV_CLASS_MAX was renamed POSIX_COLL_WEIGHTS_MAX in final draft
of POSIX.2.
Added definintion for _POSIX2_VERSION.


# 1.2 01-Aug-1993 mycroft

Add RCS identifiers.


# 1.1 21-Mar-1993 cgd

branches: 1.1.1;
Initial revision


# 1.42 15-Sep-2019 christos

remove comment for incomplete x/open impl (kamil)


# 1.41 15-Sep-2019 christos

Remove the _INCOMPLETE_XOPEN_C063 stuff.


Revision tags: netbsd-9-base phil-wifi-20190609 netbsd-8-1-RELEASE netbsd-8-1-RC1 pgoyette-compat-merge-20190127 pgoyette-compat-20190127 pgoyette-compat-20190118 pgoyette-compat-1226 pgoyette-compat-1126 pgoyette-compat-1020 pgoyette-compat-0930 pgoyette-compat-0906 pgoyette-compat-0728 netbsd-8-0-RELEASE phil-wifi-base pgoyette-compat-0625 netbsd-8-0-RC2 pgoyette-compat-0521 pgoyette-compat-0502 pgoyette-compat-0422 netbsd-8-0-RC1 pgoyette-compat-0415 pgoyette-compat-0407 pgoyette-compat-0330 pgoyette-compat-0322 pgoyette-compat-0315 pgoyette-compat-base matt-nb8-mediatek-base perseant-stdc-iso10646-base netbsd-8-base prg-localcount2-base3 prg-localcount2-base2 prg-localcount2-base1 prg-localcount2-base pgoyette-localcount-20170426 bouyer-socketcan-base1 pgoyette-localcount-20170320 bouyer-socketcan-base pgoyette-localcount-20170107 pgoyette-localcount-20161104 localcount-20160914 pgoyette-localcount-20160806
# 1.40 04-Aug-2016 christos

Realtime signal support from GSoC 2016, Charles Cui.


Revision tags: pgoyette-localcount-20160726
# 1.39 21-Jul-2016 njoly

According to Opengroup online specifications[1], _POSIX_CPUTIME and
_POSIX_THREAD_CPUTIME options should be present in unistd.h not
limits.h. Move them with other options.

[1] http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/unistd.h.html


Revision tags: pgoyette-localcount-base
# 1.38 10-Jun-2016 christos

branches: 1.38.2;
GSoC 2016: Charles Cui: Add timer related macros
_POSIX_CPUTIME
_POSIX_THREAD_CPUTIME
_POSIX_DELAYTIMER_MAX


# 1.37 10-Jun-2016 christos

GSoC 2016: Charles Cui: add SEM_NSEMS_MAX


# 1.36 08-Mar-2016 christos

- GC pts_fired, and fix the comment about MAX_TIMERS
- Bump MAX_TIMERS to 36 so that we have 32 POSIX user timers which is the
minimum required.


# 1.35 26-Feb-2016 christos

We only have 28 timers available.


# 1.34 29-May-2015 manu

Make PTHREAD_KEYS_MAX dynamically adjustable

NetBSD's PTHREAD_KEYS_MAX is set to 256, which is low compared to
other systems like Linux (1024) or MacOS X (512). As a result some
setups tested on Linux will exhibit problems on NetBSD because of
pthread_keys usage beyond the limit. This happens for instance on
Apache with various module loaded, and in this case no particular
developper can be blamed for going beyond the limit, since several
modules from different sources contribute to the problem.

This patch makes the limit conigurable through the PTHREAD_KEYS_MAX
environement variable. If undefined, the default remains unchanged
(256). In any case, the value cannot be lowered below POSIX-mandated
_POSIX_THREAD_KEYS_MAX (128).

While there:
- use EXIT_FAILURE instead of 1 when calling err(3) in libpthread.
- Reset _POSIX_THREAD_KEYS_MAX to POSIX mandated 128, instead of 256.


Revision tags: netbsd-7-0-2-RELEASE netbsd-7-0-1-RELEASE netbsd-7-0-RELEASE netbsd-7-0-RC3 netbsd-7-0-RC2 netbsd-7-0-RC1 netbsd-7-base yamt-pagecache-base9 tls-earlyentropy-base riastradh-xf86-video-intel-2-7-1-pre-2-21-15 riastradh-drm2-base3 riastradh-drm2-base2 riastradh-drm2-base1 riastradh-drm2-base agc-symver-base yamt-pagecache-base8 yamt-pagecache-base7 tls-maxphys-base
# 1.33 18-Nov-2012 manu

branches: 1.33.8;
Add most system calls for POSIX extended API set, part 2, with test cases:
faccessat(2), fchmodat(2), fchownat(2), fstatat(2), mkdirat(2), mkfifoat(2),
mknodat(2), linkat(2), readlinkat(2), symlinkat(2), renameat(2), unlinkat(2),
utimensat(2), openat(2).

Also implement O_SEARCH for openat(2)

Still missing:
- some flags for openat(2)
- fexecve(2) implementation


Revision tags: yamt-pagecache-base6 yamt-pagecache-base5 yamt-pagecache-base4
# 1.32 28-Mar-2012 christos

branches: 1.32.2;
make CHAR_{MIN,MAX} work for both -fsigned-char and -funsigned-char


Revision tags: netbsd-6-0-6-RELEASE netbsd-6-1-5-RELEASE netbsd-6-1-4-RELEASE netbsd-6-0-5-RELEASE netbsd-6-1-3-RELEASE netbsd-6-0-4-RELEASE netbsd-6-1-2-RELEASE netbsd-6-0-3-RELEASE netbsd-6-1-1-RELEASE netbsd-6-0-2-RELEASE netbsd-6-1-RELEASE netbsd-6-1-RC4 netbsd-6-1-RC3 netbsd-6-1-RC2 netbsd-6-1-RC1 netbsd-6-0-1-RELEASE matt-nb6-plus-nbase netbsd-6-0-RELEASE netbsd-6-0-RC2 matt-nb6-plus-base netbsd-6-0-RC1 netbsd-6-base yamt-pagecache-base3 yamt-pagecache-base2 yamt-pagecache-base
# 1.31 06-Oct-2011 christos

branches: 1.31.2;
Fix pthreads variables:
- Add missing stuff from Issue 6 (some of it commented out)
- Fix _POSIX_THREAD -> PTHREAD variable confusion
- Amend PTHREAD_KEYS_MAX to 256 since this is what libpthread defined internally


# 1.30 16-Aug-2011 manu

Add macros to hide OpenGroup extened API set 2 from GNU configure. This
is a temporary workaround until the implementation is completed.


Revision tags: cherry-xenmp-base uebayasi-xip-base7 bouyer-quota2-nbase bouyer-quota2-base matt-mips64-premerge-20101231 uebayasi-xip-base6 uebayasi-xip-base5 uebayasi-xip-base4 uebayasi-xip-base3 uebayasi-xip-base2
# 1.29 07-Jun-2010 tnozaki

1. MB_LEN_MAX switch MD to MI.
2. unfortunately hppa's MB_LEN_MAX is defined incorrectly 6 instead of 32
so we have to add more setlocale(3) __RENAME func, __setlocale50.
3. move setlocale1.c and setlocale32.c to lib/libc/compat/locale/*
prepareing for next libc major crunk.
4. bump libc minor version.


Revision tags: netbsd-5-1-5-RELEASE netbsd-5-1-4-RELEASE netbsd-5-1-3-RELEASE netbsd-5-1-2-RELEASE netbsd-5-1-1-RELEASE matt-nb5-mips64-premerge-20101231 matt-nb5-pq3-base netbsd-5-1-RELEASE netbsd-5-1-RC4 matt-nb5-mips64-k15 netbsd-5-1-RC3 netbsd-5-1-RC2 uebayasi-xip-base1 netbsd-5-1-RC1 uebayasi-xip-base netbsd-5-0-2-RELEASE matt-nb5-mips64-premerge-20091211 matt-premerge-20091211 matt-nb5-mips64-u2-k2-k4-k7-k8-k9 matt-nb4-mips64-k7-u2a-k9b matt-nb5-mips64-u1-k1-k5 netbsd-5-0-1-RELEASE jym-xensuspend-nbase netbsd-5-0-RELEASE netbsd-5-0-RC4 netbsd-5-0-RC3 netbsd-5-0-RC2 jym-xensuspend-base netbsd-5-0-RC1 christos-time_t-nbase christos-time_t-base netbsd-5-base matt-mips64-base2 wrstuden-revivesa-base-3 wrstuden-revivesa-base-2
# 1.28 27-Aug-2008 christos

branches: 1.28.4; 1.28.6; 1.28.14;
Make _POSIX_TZNAME_MAX=6 per SUSv3, from Andy Shevchenko


# 1.27 04-Aug-2008 matt

Add _POSIX_HOST_NAME_MAX and _POSIX_SYMLOOP_MAX to <limits.h> and add some
references to them in <sys/param.h>
in <stdio.h> also export v*scanf when _ISOC99_SOURCE is defined

From andy dot shevchenko at gmail dot com.


Revision tags: wrstuden-revivesa-base-1 simonb-wapbl-nbase yamt-pf42-base4 simonb-wapbl-base yamt-pf42-base3 hpcarm-cleanup-nbase yamt-pf42-baseX yamt-pf42-base2 wrstuden-revivesa-base yamt-pf42-base keiichi-mipv6-base matt-armv6-nbase cube-autoconf-base matt-armv6-base hpcarm-cleanup-base
# 1.26 21-Sep-2007 rmind

branches: 1.26.8;
- Correct the value of _POSIX_SYMLINK_MAX as defined in standard.
Closes PR/37007 by Ighighi.
- While here, increase _POSIX_CHILD_MAX as suggested by standard.


# 1.25 07-Sep-2007 rmind

Implementation of POSIX message queues.

Reviewed by: <ad>, <tech-kern>


Revision tags: matt-mips64-base
# 1.24 01-May-2007 rmind

branches: 1.24.4;
- Create sysctl nodes for AIO.
- Add POSIX defined system variables and constants of AIO_LISTIO_MAX and
AIO_MAX values. Both with _POSIX_ASYNCHRONOUS_IO, provide them in
sysconf(3) and getconf(1) interfaces.
- Clean up sysconf(3) for handling sysctl nodes dynamically.


Revision tags: netbsd-4-0-1-RELEASE wrstuden-fixsa-newbase wrstuden-fixsa-base-1 netbsd-4-0-RELEASE netbsd-4-0-RC5 netbsd-4-0-RC4 netbsd-4-0-RC3 netbsd-4-0-RC2 netbsd-4-0-RC1 netbsd-3-1-1-RELEASE netbsd-3-0-3-RELEASE wrstuden-fixsa-base abandoned-netbsd-4-base netbsd-3-1-RELEASE netbsd-3-0-2-RELEASE netbsd-3-1-RC4 netbsd-3-1-RC3 netbsd-3-1-RC2 netbsd-3-1-RC1 netbsd-4-base netbsd-3-0-1-RELEASE netbsd-3-0-RELEASE netbsd-3-0-RC6 netbsd-3-0-RC5 netbsd-3-0-RC4 netbsd-3-0-RC3 netbsd-3-0-RC2 netbsd-3-0-RC1 netbsd-3-base
# 1.23 10-Nov-2004 lukem

Implement sysconf(3) _SC_GETGR_R_SIZE_MAX and _SC_GETPW_R_SIZE_MAX for
the 1003.1-2001 Thread Safe Functions (TSF) getgrnam_r(3) and getpwnam_r(3).

These are not implemented in sysctl(3) "user.*", since that adds a lot
of complexity in the implementation for no real benefit.


Revision tags: netbsd-2-0-3-RELEASE netbsd-2-1-RELEASE netbsd-2-1-RC6 netbsd-2-1-RC5 netbsd-2-1-RC4 netbsd-2-1-RC3 netbsd-2-1-RC2 netbsd-2-1-RC1 netbsd-2-0-2-RELEASE netbsd-2-0-1-RELEASE netbsd-2-base netbsd-2-0-RELEASE netbsd-2-0-RC5 netbsd-2-0-RC4 netbsd-2-0-RC3 netbsd-2-0-RC2 netbsd-2-0-RC1 netbsd-2-0-base
# 1.22 07-Aug-2003 agc

Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22270, verified by myself.


# 1.21 16-Jul-2003 nathanw

Add the _POSIX_THREAD and _POSIX_TIMER mandated minimum limits.


# 1.20 28-Apr-2003 bjh21

Add a new feature-test macro, _NETBSD_SOURCE. If this is defined
by the application, all NetBSD interfaces are made visible, even
if some other feature-test macro (like _POSIX_C_SOURCE) is defined.
<sys/featuretest.h> defined _NETBSD_SOURCE if none of _ANSI_SOURCE,
_POSIX_C_SOURCE and _XOPEN_SOURCE is defined, so as to preserve
existing behaviour.

This has two major advantages:
+ Programs that require non-POSIX facilities but define _POSIX_C_SOURCE
can trivially be overruled by putting -D_NETBSD_SOURCE in their CFLAGS.
+ It makes most of the #ifs simpler, in that they're all now ORs of the
various macros, rather than having checks for (!defined(_ANSI_SOURCE) ||
!defined(_POSIX_C_SOURCE) || !defined(_XOPEN_SOURCE)) all over the place.

I've tried not to change the semantics of the headers in any case where
_NETBSD_SOURCE wasn't defined, but there were some places where the
current semantics were clearly mad, and retaining them was harder than
correcting them. In particular, I've mostly normalised things so that
_ANSI_SOURCE gets you the smallest set of stuff, then _POSIX_C_SOURCE,
_XOPEN_SOURCE and _NETBSD_SOURCE in that order.

Tested by building for vax, encouraged by thorpej, and uncontested in
tech-userlevel for a week.


# 1.19 18-Jan-2003 christos

oops, erased word accidentally.


# 1.18 18-Jan-2003 christos

avoid TMP_MAX redefinition


Revision tags: nathanw_sa_before_merge fvdl_fs64_base nathanw_sa_base
# 1.17 18-Nov-2002 kleink

Update for 1003.1-2001 base and XSI changes.


# 1.16 04-Aug-2002 soren

Back out previous - I was confused.


# 1.15 04-Aug-2002 soren

Per IEEE 1003.1-2001, omit from <limits.h> those Pathname Variable Values
that may vary between filesystems: _POSIX_LINK_MAX, _POSIX_NAME_MAX, and
_POSIX_PATH_MAX. These are to be obtained from pathconf() instead.


# 1.14 04-Aug-2002 soren

As of IEEE (POSIX) 1003.1-2001, _POSIX_PATH_MAX must be at least 256 rather
than 255 and is now defined to include the terminating NUL.


Revision tags: netbsd-1-6-PATCH002-RELEASE netbsd-1-6-PATCH002 netbsd-1-6-PATCH002-RC4 netbsd-1-6-PATCH002-RC3 netbsd-1-6-PATCH002-RC2 netbsd-1-6-PATCH002-RC1 netbsd-1-6-PATCH001 netbsd-1-6-PATCH001-RELEASE netbsd-1-6-PATCH001-RC3 netbsd-1-6-PATCH001-RC2 netbsd-1-6-PATCH001-RC1 netbsd-1-6-RELEASE netbsd-1-6-RC3 netbsd-1-6-RC2 netbsd-1-6-RC1 netbsd-1-6-base netbsd-1-5-PATCH003 netbsd-1-5-PATCH002 netbsd-1-5-PATCH001 netbsd-1-5-RELEASE netbsd-1-5-BETA2 netbsd-1-5-BETA netbsd-1-5-ALPHA2 netbsd-1-5-base minoura-xpg4dl-base wrstuden-devbsize-19991221 wrstuden-devbsize-base comdex-fall-1999-base
# 1.13 27-Sep-1999 kleink

branches: 1.13.8;
1003.1c: add {LOGIN_NAME_MAX}.


# 1.12 06-Sep-1999 kleink

branches: 1.12.2;
Bump NL_TEXTMAX to 2048 (== _POSIX2_LINE_MAX, which is the minimum value
required by XSH5.)


Revision tags: netbsd-1-4-PATCH003 netbsd-1-4-PATCH002 netbsd-1-4-PATCH001 netbsd-1-4-RELEASE netbsd-1-4-base
# 1.11 03-Aug-1998 kleink

Per XSH5, define _XOPEN_IOV_MAX.


# 1.10 08-Jul-1998 kleink

For the sake of XPG3 and later, provide TMP_MAX; consistent with the defintion
in <stdio.h>. Also, rearrange name space protection a bit.


# 1.9 02-Feb-1998 perry

merge lite-2


Revision tags: netbsd-1-3-PATCH003 netbsd-1-3-PATCH003-CANDIDATE2 netbsd-1-3-PATCH003-CANDIDATE1 netbsd-1-3-PATCH003-CANDIDATE0 netbsd-1-3-PATCH002 netbsd-1-3-PATCH001 netbsd-1-3-RELEASE netbsd-1-3-BETA netbsd-1-3-base
# 1.8 21-Oct-1996 jtc

Fix typo: _POSIX_SSIZE_MAX was set to wrong value


Revision tags: netbsd-1-2-PATCH001 netbsd-1-2-RELEASE netbsd-1-2-BETA netbsd-1-2-base netbsd-1-1-PATCH001 netbsd-1-1-RELEASE netbsd-1-1-base
# 1.7 26-Oct-1994 cgd

new RCS ID format.


# 1.6 05-Oct-1994 jtc

Add constants required by XPG3


Revision tags: netbsd-1-0-PATCH06 netbsd-1-0-PATCH05 netbsd-1-0-PATCH04 netbsd-1-0-PATCH03 netbsd-1-0-PATCH02 netbsd-1-0-PATCH1 netbsd-1-0-PATCH0 netbsd-1-0-RELEASE netbsd-1-0-base
# 1.5 12-Oct-1993 jtc

POSIX2_VERSION macro is supposed to live in <unistd.h>


# 1.4 24-Sep-1993 jtc

Do not #define the _POSIX_FOO constants if compliling in strict ANSI mode.
Define the _POSIX_SSIZE_MAX, _POSIX_STREAM_MAX, and _POSIX_TZNAME_MAX constants
added in 1003.1-90.


# 1.3 21-Sep-1993 jtc

POSIX_EQUIV_CLASS_MAX was renamed POSIX_COLL_WEIGHTS_MAX in final draft
of POSIX.2.
Added definintion for _POSIX2_VERSION.


# 1.2 01-Aug-1993 mycroft

Add RCS identifiers.


# 1.1 21-Mar-1993 cgd

branches: 1.1.1;
Initial revision


Revision tags: pgoyette-localcount-20161104 localcount-20160914 pgoyette-localcount-20160806
# 1.40 04-Aug-2016 christos

Realtime signal support from GSoC 2016, Charles Cui.


Revision tags: pgoyette-localcount-20160726
# 1.39 21-Jul-2016 njoly

According to Opengroup online specifications[1], _POSIX_CPUTIME and
_POSIX_THREAD_CPUTIME options should be present in unistd.h not
limits.h. Move them with other options.

[1] http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/unistd.h.html


Revision tags: pgoyette-localcount-base
# 1.38 10-Jun-2016 christos

branches: 1.38.2;
GSoC 2016: Charles Cui: Add timer related macros
_POSIX_CPUTIME
_POSIX_THREAD_CPUTIME
_POSIX_DELAYTIMER_MAX


# 1.37 10-Jun-2016 christos

GSoC 2016: Charles Cui: add SEM_NSEMS_MAX


# 1.36 08-Mar-2016 christos

- GC pts_fired, and fix the comment about MAX_TIMERS
- Bump MAX_TIMERS to 36 so that we have 32 POSIX user timers which is the
minimum required.


# 1.35 26-Feb-2016 christos

We only have 28 timers available.


# 1.34 29-May-2015 manu

Make PTHREAD_KEYS_MAX dynamically adjustable

NetBSD's PTHREAD_KEYS_MAX is set to 256, which is low compared to
other systems like Linux (1024) or MacOS X (512). As a result some
setups tested on Linux will exhibit problems on NetBSD because of
pthread_keys usage beyond the limit. This happens for instance on
Apache with various module loaded, and in this case no particular
developper can be blamed for going beyond the limit, since several
modules from different sources contribute to the problem.

This patch makes the limit conigurable through the PTHREAD_KEYS_MAX
environement variable. If undefined, the default remains unchanged
(256). In any case, the value cannot be lowered below POSIX-mandated
_POSIX_THREAD_KEYS_MAX (128).

While there:
- use EXIT_FAILURE instead of 1 when calling err(3) in libpthread.
- Reset _POSIX_THREAD_KEYS_MAX to POSIX mandated 128, instead of 256.


Revision tags: netbsd-7-0-2-RELEASE netbsd-7-0-1-RELEASE netbsd-7-0-RELEASE netbsd-7-0-RC3 netbsd-7-0-RC2 netbsd-7-0-RC1 netbsd-7-base yamt-pagecache-base9 tls-earlyentropy-base riastradh-xf86-video-intel-2-7-1-pre-2-21-15 riastradh-drm2-base3 riastradh-drm2-base2 riastradh-drm2-base1 riastradh-drm2-base agc-symver-base yamt-pagecache-base8 yamt-pagecache-base7 tls-maxphys-base
# 1.33 18-Nov-2012 manu

branches: 1.33.8;
Add most system calls for POSIX extended API set, part 2, with test cases:
faccessat(2), fchmodat(2), fchownat(2), fstatat(2), mkdirat(2), mkfifoat(2),
mknodat(2), linkat(2), readlinkat(2), symlinkat(2), renameat(2), unlinkat(2),
utimensat(2), openat(2).

Also implement O_SEARCH for openat(2)

Still missing:
- some flags for openat(2)
- fexecve(2) implementation


Revision tags: yamt-pagecache-base6 yamt-pagecache-base5 yamt-pagecache-base4
# 1.32 28-Mar-2012 christos

branches: 1.32.2;
make CHAR_{MIN,MAX} work for both -fsigned-char and -funsigned-char


Revision tags: netbsd-6-0-6-RELEASE netbsd-6-1-5-RELEASE netbsd-6-1-4-RELEASE netbsd-6-0-5-RELEASE netbsd-6-1-3-RELEASE netbsd-6-0-4-RELEASE netbsd-6-1-2-RELEASE netbsd-6-0-3-RELEASE netbsd-6-1-1-RELEASE netbsd-6-0-2-RELEASE netbsd-6-1-RELEASE netbsd-6-1-RC4 netbsd-6-1-RC3 netbsd-6-1-RC2 netbsd-6-1-RC1 netbsd-6-0-1-RELEASE matt-nb6-plus-nbase netbsd-6-0-RELEASE netbsd-6-0-RC2 matt-nb6-plus-base netbsd-6-0-RC1 netbsd-6-base yamt-pagecache-base3 yamt-pagecache-base2 yamt-pagecache-base
# 1.31 06-Oct-2011 christos

branches: 1.31.2;
Fix pthreads variables:
- Add missing stuff from Issue 6 (some of it commented out)
- Fix _POSIX_THREAD -> PTHREAD variable confusion
- Amend PTHREAD_KEYS_MAX to 256 since this is what libpthread defined internally


# 1.30 16-Aug-2011 manu

Add macros to hide OpenGroup extened API set 2 from GNU configure. This
is a temporary workaround until the implementation is completed.


Revision tags: cherry-xenmp-base uebayasi-xip-base7 bouyer-quota2-nbase bouyer-quota2-base matt-mips64-premerge-20101231 uebayasi-xip-base6 uebayasi-xip-base5 uebayasi-xip-base4 uebayasi-xip-base3 uebayasi-xip-base2
# 1.29 07-Jun-2010 tnozaki

1. MB_LEN_MAX switch MD to MI.
2. unfortunately hppa's MB_LEN_MAX is defined incorrectly 6 instead of 32
so we have to add more setlocale(3) __RENAME func, __setlocale50.
3. move setlocale1.c and setlocale32.c to lib/libc/compat/locale/*
prepareing for next libc major crunk.
4. bump libc minor version.


Revision tags: netbsd-5-1-5-RELEASE netbsd-5-1-4-RELEASE netbsd-5-1-3-RELEASE netbsd-5-1-2-RELEASE netbsd-5-1-1-RELEASE matt-nb5-mips64-premerge-20101231 matt-nb5-pq3-base netbsd-5-1-RELEASE netbsd-5-1-RC4 matt-nb5-mips64-k15 netbsd-5-1-RC3 netbsd-5-1-RC2 uebayasi-xip-base1 netbsd-5-1-RC1 uebayasi-xip-base netbsd-5-0-2-RELEASE matt-nb5-mips64-premerge-20091211 matt-premerge-20091211 matt-nb5-mips64-u2-k2-k4-k7-k8-k9 matt-nb4-mips64-k7-u2a-k9b matt-nb5-mips64-u1-k1-k5 netbsd-5-0-1-RELEASE jym-xensuspend-nbase netbsd-5-0-RELEASE netbsd-5-0-RC4 netbsd-5-0-RC3 netbsd-5-0-RC2 jym-xensuspend-base netbsd-5-0-RC1 christos-time_t-nbase christos-time_t-base netbsd-5-base matt-mips64-base2 wrstuden-revivesa-base-3 wrstuden-revivesa-base-2
# 1.28 27-Aug-2008 christos

branches: 1.28.4; 1.28.6; 1.28.14;
Make _POSIX_TZNAME_MAX=6 per SUSv3, from Andy Shevchenko


# 1.27 04-Aug-2008 matt

Add _POSIX_HOST_NAME_MAX and _POSIX_SYMLOOP_MAX to <limits.h> and add some
references to them in <sys/param.h>
in <stdio.h> also export v*scanf when _ISOC99_SOURCE is defined

From andy dot shevchenko at gmail dot com.


Revision tags: wrstuden-revivesa-base-1 simonb-wapbl-nbase yamt-pf42-base4 simonb-wapbl-base yamt-pf42-base3 hpcarm-cleanup-nbase yamt-pf42-baseX yamt-pf42-base2 wrstuden-revivesa-base yamt-pf42-base keiichi-mipv6-base matt-armv6-nbase cube-autoconf-base matt-armv6-base hpcarm-cleanup-base
# 1.26 21-Sep-2007 rmind

branches: 1.26.8;
- Correct the value of _POSIX_SYMLINK_MAX as defined in standard.
Closes PR/37007 by Ighighi.
- While here, increase _POSIX_CHILD_MAX as suggested by standard.


# 1.25 07-Sep-2007 rmind

Implementation of POSIX message queues.

Reviewed by: <ad>, <tech-kern>


Revision tags: matt-mips64-base
# 1.24 01-May-2007 rmind

branches: 1.24.4;
- Create sysctl nodes for AIO.
- Add POSIX defined system variables and constants of AIO_LISTIO_MAX and
AIO_MAX values. Both with _POSIX_ASYNCHRONOUS_IO, provide them in
sysconf(3) and getconf(1) interfaces.
- Clean up sysconf(3) for handling sysctl nodes dynamically.


Revision tags: netbsd-4-0-1-RELEASE wrstuden-fixsa-newbase wrstuden-fixsa-base-1 netbsd-4-0-RELEASE netbsd-4-0-RC5 netbsd-4-0-RC4 netbsd-4-0-RC3 netbsd-4-0-RC2 netbsd-4-0-RC1 netbsd-3-1-1-RELEASE netbsd-3-0-3-RELEASE wrstuden-fixsa-base abandoned-netbsd-4-base netbsd-3-1-RELEASE netbsd-3-0-2-RELEASE netbsd-3-1-RC4 netbsd-3-1-RC3 netbsd-3-1-RC2 netbsd-3-1-RC1 netbsd-4-base netbsd-3-0-1-RELEASE netbsd-3-0-RELEASE netbsd-3-0-RC6 netbsd-3-0-RC5 netbsd-3-0-RC4 netbsd-3-0-RC3 netbsd-3-0-RC2 netbsd-3-0-RC1 netbsd-3-base
# 1.23 10-Nov-2004 lukem

Implement sysconf(3) _SC_GETGR_R_SIZE_MAX and _SC_GETPW_R_SIZE_MAX for
the 1003.1-2001 Thread Safe Functions (TSF) getgrnam_r(3) and getpwnam_r(3).

These are not implemented in sysctl(3) "user.*", since that adds a lot
of complexity in the implementation for no real benefit.


Revision tags: netbsd-2-0-3-RELEASE netbsd-2-1-RELEASE netbsd-2-1-RC6 netbsd-2-1-RC5 netbsd-2-1-RC4 netbsd-2-1-RC3 netbsd-2-1-RC2 netbsd-2-1-RC1 netbsd-2-0-2-RELEASE netbsd-2-0-1-RELEASE netbsd-2-base netbsd-2-0-RELEASE netbsd-2-0-RC5 netbsd-2-0-RC4 netbsd-2-0-RC3 netbsd-2-0-RC2 netbsd-2-0-RC1 netbsd-2-0-base
# 1.22 07-Aug-2003 agc

Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22270, verified by myself.


# 1.21 16-Jul-2003 nathanw

Add the _POSIX_THREAD and _POSIX_TIMER mandated minimum limits.


# 1.20 28-Apr-2003 bjh21

Add a new feature-test macro, _NETBSD_SOURCE. If this is defined
by the application, all NetBSD interfaces are made visible, even
if some other feature-test macro (like _POSIX_C_SOURCE) is defined.
<sys/featuretest.h> defined _NETBSD_SOURCE if none of _ANSI_SOURCE,
_POSIX_C_SOURCE and _XOPEN_SOURCE is defined, so as to preserve
existing behaviour.

This has two major advantages:
+ Programs that require non-POSIX facilities but define _POSIX_C_SOURCE
can trivially be overruled by putting -D_NETBSD_SOURCE in their CFLAGS.
+ It makes most of the #ifs simpler, in that they're all now ORs of the
various macros, rather than having checks for (!defined(_ANSI_SOURCE) ||
!defined(_POSIX_C_SOURCE) || !defined(_XOPEN_SOURCE)) all over the place.

I've tried not to change the semantics of the headers in any case where
_NETBSD_SOURCE wasn't defined, but there were some places where the
current semantics were clearly mad, and retaining them was harder than
correcting them. In particular, I've mostly normalised things so that
_ANSI_SOURCE gets you the smallest set of stuff, then _POSIX_C_SOURCE,
_XOPEN_SOURCE and _NETBSD_SOURCE in that order.

Tested by building for vax, encouraged by thorpej, and uncontested in
tech-userlevel for a week.


# 1.19 18-Jan-2003 christos

oops, erased word accidentally.


# 1.18 18-Jan-2003 christos

avoid TMP_MAX redefinition


Revision tags: nathanw_sa_before_merge fvdl_fs64_base nathanw_sa_base
# 1.17 18-Nov-2002 kleink

Update for 1003.1-2001 base and XSI changes.


# 1.16 04-Aug-2002 soren

Back out previous - I was confused.


# 1.15 04-Aug-2002 soren

Per IEEE 1003.1-2001, omit from <limits.h> those Pathname Variable Values
that may vary between filesystems: _POSIX_LINK_MAX, _POSIX_NAME_MAX, and
_POSIX_PATH_MAX. These are to be obtained from pathconf() instead.


# 1.14 04-Aug-2002 soren

As of IEEE (POSIX) 1003.1-2001, _POSIX_PATH_MAX must be at least 256 rather
than 255 and is now defined to include the terminating NUL.


Revision tags: netbsd-1-6-PATCH002-RELEASE netbsd-1-6-PATCH002 netbsd-1-6-PATCH002-RC4 netbsd-1-6-PATCH002-RC3 netbsd-1-6-PATCH002-RC2 netbsd-1-6-PATCH002-RC1 netbsd-1-6-PATCH001 netbsd-1-6-PATCH001-RELEASE netbsd-1-6-PATCH001-RC3 netbsd-1-6-PATCH001-RC2 netbsd-1-6-PATCH001-RC1 netbsd-1-6-RELEASE netbsd-1-6-RC3 netbsd-1-6-RC2 netbsd-1-6-RC1 netbsd-1-6-base netbsd-1-5-PATCH003 netbsd-1-5-PATCH002 netbsd-1-5-PATCH001 netbsd-1-5-RELEASE netbsd-1-5-BETA2 netbsd-1-5-BETA netbsd-1-5-ALPHA2 netbsd-1-5-base minoura-xpg4dl-base wrstuden-devbsize-19991221 wrstuden-devbsize-base comdex-fall-1999-base
# 1.13 27-Sep-1999 kleink

branches: 1.13.8;
1003.1c: add {LOGIN_NAME_MAX}.


# 1.12 06-Sep-1999 kleink

branches: 1.12.2;
Bump NL_TEXTMAX to 2048 (== _POSIX2_LINE_MAX, which is the minimum value
required by XSH5.)


Revision tags: netbsd-1-4-PATCH003 netbsd-1-4-PATCH002 netbsd-1-4-PATCH001 netbsd-1-4-RELEASE netbsd-1-4-base
# 1.11 03-Aug-1998 kleink

Per XSH5, define _XOPEN_IOV_MAX.


# 1.10 08-Jul-1998 kleink

For the sake of XPG3 and later, provide TMP_MAX; consistent with the defintion
in <stdio.h>. Also, rearrange name space protection a bit.


# 1.9 02-Feb-1998 perry

merge lite-2


Revision tags: netbsd-1-3-PATCH003 netbsd-1-3-PATCH003-CANDIDATE2 netbsd-1-3-PATCH003-CANDIDATE1 netbsd-1-3-PATCH003-CANDIDATE0 netbsd-1-3-PATCH002 netbsd-1-3-PATCH001 netbsd-1-3-RELEASE netbsd-1-3-BETA netbsd-1-3-base
# 1.8 21-Oct-1996 jtc

Fix typo: _POSIX_SSIZE_MAX was set to wrong value


Revision tags: netbsd-1-2-PATCH001 netbsd-1-2-RELEASE netbsd-1-2-BETA netbsd-1-2-base netbsd-1-1-PATCH001 netbsd-1-1-RELEASE netbsd-1-1-base
# 1.7 26-Oct-1994 cgd

new RCS ID format.


# 1.6 05-Oct-1994 jtc

Add constants required by XPG3


Revision tags: netbsd-1-0-PATCH06 netbsd-1-0-PATCH05 netbsd-1-0-PATCH04 netbsd-1-0-PATCH03 netbsd-1-0-PATCH02 netbsd-1-0-PATCH1 netbsd-1-0-PATCH0 netbsd-1-0-RELEASE netbsd-1-0-base
# 1.5 12-Oct-1993 jtc

POSIX2_VERSION macro is supposed to live in <unistd.h>


# 1.4 24-Sep-1993 jtc

Do not #define the _POSIX_FOO constants if compliling in strict ANSI mode.
Define the _POSIX_SSIZE_MAX, _POSIX_STREAM_MAX, and _POSIX_TZNAME_MAX constants
added in 1003.1-90.


# 1.3 21-Sep-1993 jtc

POSIX_EQUIV_CLASS_MAX was renamed POSIX_COLL_WEIGHTS_MAX in final draft
of POSIX.2.
Added definintion for _POSIX2_VERSION.


# 1.2 01-Aug-1993 mycroft

Add RCS identifiers.


# 1.1 21-Mar-1993 cgd

branches: 1.1.1;
Initial revision