Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 4 Jul 2014 18:17:18 +0400
From:      Dmitry Sivachenko <trtrmitya@gmail.com>
To:        Konstantin Belousov <kostikbel@gmail.com>
Cc:        freebsd-standards@freebsd.org
Subject:   Re: About sysconf(_SC_GETPW_R_SIZE_MAX)
Message-ID:  <5EA35BF7-3984-4FD4-B523-9767E142475A@gmail.com>
In-Reply-To: <20140704130017.GG93733@kib.kiev.ua>
References:  <DDC4C361-1C27-4913-91BB-1974AD1163A7@gmail.com> <20140704130017.GG93733@kib.kiev.ua>

next in thread | previous in thread | raw e-mail | index | archive | help

On 04 =D0=B8=D1=8E=D0=BB=D1=8F 2014 =D0=B3., at 17:00, Konstantin =
Belousov <kostikbel@gmail.com> wrote:

> On Fri, Jul 04, 2014 at 11:05:46AM +0400, Dmitry Sivachenko wrote:
>> Hello!
>>=20
>> (FreeBSD-10/stable).
>>=20
>> According to sysconf(3), _SC_GETPW_R_SIZE_MAX is the valid argument =
to sysconf():
>>=20
>> _SC_GETPW_R_SIZE_MAX
>>             Suggested initial value for the size of the password =
entry
>>             buffer.
>>=20
>> But the following test program fails:
>>=20
>> #include <unistd.h>
>> #include <err.h>
>> #include <errno.h>
>> #include <stdio.h>
>>=20
>> int main() {
>>  int buf_sz;
>>=20
>>  errno=3D0;
>>  buf_sz =3D sysconf(_SC_GETPW_R_SIZE_MAX);
>>  printf("%d\n", buf_sz);
>>  warn("sysconf: ");
>>  return 0;
>> }
>>=20
>> % ./a.out=20
>> -1
>> a.out: sysconf: : Invalid argument
>>=20
>>=20
>> What is wrong?
>=20
> =46rom lib/libc/gen/sysconf.c, around line 327:
> #if _POSIX_THREAD_SAFE_FUNCTIONS > -1
> 	case _SC_GETGR_R_SIZE_MAX:
> 	case _SC_GETPW_R_SIZE_MAX:
> #error "somebody needs to implement this"
> #endif


May be remove these two from man page?=



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?5EA35BF7-3984-4FD4-B523-9767E142475A>