standards/80293: sysconf() does not support well-defined unistd
values
Jung-uk Kim
jkim at FreeBSD.org
Wed Apr 11 19:00:14 UTC 2007
The following reply was made to PR standards/80293; it has been noted by GNATS.
From: Jung-uk Kim <jkim at FreeBSD.org>
To: bug-followup at FreeBSD.org, flashdict at gmail.com
Cc:
Subject: Re: standards/80293: sysconf() does not support well-defined unistd values
Date: Wed, 11 Apr 2007 14:52:17 -0400
> We could probably return GRP_STORAGE_MAX as the limit value (1Mb
> currently). Non-threaded versions of these functions is limited by
> this value anyway.
_SC_GETGR_R_SIZE_MAX is specifically for threaded versions and we
should not use non-threaded version's limit. Interestingly, Mac OS
10.4 returns -1 without changing errno, which means it is unlimited.
(FYI, Mac OS 10.3 used to return -1 with errno EINVAL.) NetBSD
returns 1024 (which is arbitrary number chosen to shut up ports, I
believe). SUSv3 says:
'If name is an invalid value, sysconf() shall return -1 and set errno
to indicate the error. If the variable corresponding to name has no
limit, sysconf() shall return -1 without changing the value of errno.
Note that indefinite limits do not imply infinite limits; see
<limits.h>.'
Unfortunately FreeBSD falls under indefinite category and SUSv3 is not
clear on this although it says indefinite does not imply
infinite. :-( I am wondering how Mac OS 10.4 can claim that it is
infinite.
Jung-uk Kim
More information about the freebsd-standards
mailing list