Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 4 Jul 2014 11:05:46 +0400
From:      Dmitry Sivachenko <trtrmitya@gmail.com>
To:        freebsd-standards@freebsd.org
Subject:   About sysconf(_SC_GETPW_R_SIZE_MAX)
Message-ID:  <DDC4C361-1C27-4913-91BB-1974AD1163A7@gmail.com>

next in thread | raw e-mail | index | archive | help
Hello!

(FreeBSD-10/stable).

According to sysconf(3), _SC_GETPW_R_SIZE_MAX is the valid argument to =
sysconf():

 _SC_GETPW_R_SIZE_MAX
             Suggested initial value for the size of the password entry
             buffer.

But the following test program fails:

#include <unistd.h>
#include <err.h>
#include <errno.h>
#include <stdio.h>

int main() {
  int buf_sz;

  errno=3D0;
  buf_sz =3D sysconf(_SC_GETPW_R_SIZE_MAX);
  printf("%d\n", buf_sz);
  warn("sysconf: ");
  return 0;
}

% ./a.out=20
-1
a.out: sysconf: : Invalid argument


What is wrong?

Thanks!=



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?DDC4C361-1C27-4913-91BB-1974AD1163A7>