From owner-freebsd-bugs@FreeBSD.ORG Sat Apr 23 22:20:18 2005 Return-Path: Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 3E10916A4CF for ; Sat, 23 Apr 2005 22:20:18 +0000 (GMT) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id EC35143D2D for ; Sat, 23 Apr 2005 22:20:17 +0000 (GMT) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.13.3/8.13.3) with ESMTP id j3NMKHL0020635 for ; Sat, 23 Apr 2005 22:20:17 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.13.3/8.13.1/Submit) id j3NMKHj5020634; Sat, 23 Apr 2005 22:20:17 GMT (envelope-from gnats) Resent-Date: Sat, 23 Apr 2005 22:20:17 GMT Resent-Message-Id: <200504232220.j3NMKHj5020634@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Bill Middleton Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 2EC1116A4CE for ; Sat, 23 Apr 2005 22:13:39 +0000 (GMT) Received: from www.freebsd.org (www.freebsd.org [216.136.204.117]) by mx1.FreeBSD.org (Postfix) with ESMTP id 1375F43D53 for ; Sat, 23 Apr 2005 22:13:39 +0000 (GMT) (envelope-from nobody@FreeBSD.org) Received: from www.freebsd.org (localhost [127.0.0.1]) by www.freebsd.org (8.13.1/8.13.1) with ESMTP id j3NMDcj7026588 for ; Sat, 23 Apr 2005 22:13:38 GMT (envelope-from nobody@www.freebsd.org) Received: (from nobody@localhost) by www.freebsd.org (8.13.1/8.13.1/Submit) id j3NMDcBL026587; Sat, 23 Apr 2005 22:13:38 GMT (envelope-from nobody) Message-Id: <200504232213.j3NMDcBL026587@www.freebsd.org> Date: Sat, 23 Apr 2005 22:13:38 GMT From: Bill Middleton To: freebsd-gnats-submit@FreeBSD.org X-Send-Pr-Version: www-2.3 Subject: misc/80293: sysconf() does not support well-defined unistd values X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 23 Apr 2005 22:20:18 -0000 >Number: 80293 >Category: misc >Synopsis: sysconf() does not support well-defined unistd values >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Sat Apr 23 22:20:17 GMT 2005 >Closed-Date: >Last-Modified: >Originator: Bill Middleton >Release: CURRENT >Organization: >Environment: FreeBSD my.hostname.com 6.0-CURRENT FreeBSD 6.0-CURRENT #0: Wed Apr 6 02:41:00 CEST 2005 >Description: Calling sysconf() on an defined value, including _SC_GETGR_R_SIZE_MAX, is supposed to return -1 and not set errno(), if I understand the man page correctly. However, in CURRENT, errno is set to "Invalid argument", even though the value is defined in unistd.h. >How-To-Repeat: The following C snippet will print: Errno is currently Unknown error: 0 _SC_GETGR_R_SIZE_MAX is Errno is now Invalid argument Arguably, errno should not have been set? #include #include int main(int argc, char **argv) { long fbufsize; printf("Errno is currently %s\n", strerror(errno)); printf("_SC_GETGR_R_SIZE_MAX is %l\n",_SC_GETGR_R_SIZE_MAX); fbufsize = sysconf (_SC_GETGR_R_SIZE_MAX); printf("Errno is now %s\n", strerror(errno)); } >Fix: Make sysconf() support all values defined in unistd.h, or don't define them, perhaps. >Release-Note: >Audit-Trail: >Unformatted: