From owner-freebsd-standards@FreeBSD.ORG Fri Jul 4 14:17:25 2014 Return-Path: Delivered-To: freebsd-standards@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 631B871D for ; Fri, 4 Jul 2014 14:17:25 +0000 (UTC) Received: from mail-lb0-x22a.google.com (mail-lb0-x22a.google.com [IPv6:2a00:1450:4010:c04::22a]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id DDBD22EA6 for ; Fri, 4 Jul 2014 14:17:24 +0000 (UTC) Received: by mail-lb0-f170.google.com with SMTP id 10so1224379lbg.15 for ; Fri, 04 Jul 2014 07:17:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=content-type:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=97wswigKZeeKNA6JtLKdkFHGnZ4gtlBj3EQvT96J/k4=; b=vNhVwI5zdoTgkAPhYoFxE2CRV/DMB01OSW5Bw2Tm3uD7xbGTMS6T8BZkzRKXeoZLi6 nB56JpK4q8W5EGelBfMeG8IWM69QUZ1+DQ1D4fCjCvA/Jv1AYFrzGIeGdhsJYleFa9FZ MOjQaFRbdRzMgNR7ijB0OWdBBfoERNkVfh97olv20c7seR/2wPWPf9UVB6IY1ENqovpY dJKCiI/bGrGOTq4qWx7bXAJp55NWxNs9iPvmNxd5IeQAIXFG4DHhB634cIMuyUAvVuJE j6dbCYFGl9YhjM/0BVOci1Kl2Ngqqls/iAUcbIKZz0VDhkWVgpVDEGgBOjHI2YX9BnDJ fkMQ== X-Received: by 10.152.121.73 with SMTP id li9mr47952lab.94.1404483442692; Fri, 04 Jul 2014 07:17:22 -0700 (PDT) Received: from ?IPv6:2a02:6b8::408:9186:aec2:d3a:9405? ([2a02:6b8:0:408:9186:aec2:d3a:9405]) by mx.google.com with ESMTPSA id k5sm6851170lak.8.2014.07.04.07.17.19 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 04 Jul 2014 07:17:20 -0700 (PDT) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 7.3 \(1878.2\)) Subject: Re: About sysconf(_SC_GETPW_R_SIZE_MAX) From: Dmitry Sivachenko In-Reply-To: <20140704130017.GG93733@kib.kiev.ua> Date: Fri, 4 Jul 2014 18:17:18 +0400 Content-Transfer-Encoding: quoted-printable Message-Id: <5EA35BF7-3984-4FD4-B523-9767E142475A@gmail.com> References: <20140704130017.GG93733@kib.kiev.ua> To: Konstantin Belousov X-Mailer: Apple Mail (2.1878.2) Cc: freebsd-standards@freebsd.org X-BeenThere: freebsd-standards@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Standards compliance List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 04 Jul 2014 14:17:25 -0000 On 04 =D0=B8=D1=8E=D0=BB=D1=8F 2014 =D0=B3., at 17:00, Konstantin = Belousov 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 >> #include >> #include >> #include >>=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?=