From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 2270 invoked by alias); 23 Feb 2008 00:28:58 -0000 Received: (qmail 2176 invoked by uid 48); 23 Feb 2008 00:28:12 -0000 Date: Sat, 23 Feb 2008 00:28:00 -0000 Message-ID: <20080223002812.2175.qmail@sourceware.org> From: "carlos at codesourcery dot com" To: glibc-bugs@sources.redhat.com In-Reply-To: <20080222153833.5786.michael.kerrisk@gmail.com> References: <20080222153833.5786.michael.kerrisk@gmail.com> Reply-To: sourceware-bugzilla@sourceware.org Subject: [Bug libc/5786] sysconf(_SC_ARG_MAX) no longer accurate since Linux kernel 2.6.23 X-Bugzilla-Reason: CC Mailing-List: contact glibc-bugs-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Post: List-Help: , Sender: glibc-bugs-owner@sourceware.org X-SW-Source: 2008-02/txt/msg00104.txt.bz2 ------- Additional Comments From carlos at codesourcery dot com 2008-02-23 00:28 ------- Interesting change, this is nice for programs that don't use libiberty's @file support. This change makes _SC_ARG_MAX variable over the life of the program, simialr to _SC_OPEN_MAX (after a call to setrlimit with RLIMIT_NOFILE). The standard will need to be changed, as it was changed for _SC_OPEN_MAX, to say "...may return different values before and after a call to..." We can immediately add support for calling getrlimit to compute the result of sysconf(_SC_ARG_MAX), conditional on `__LINUX_KERNEL_VERSION >= 0x020617' (>= 2.6.23) i.e. the minimum kernel version supported by this glibc is 2.6.23. Otherwise sysconf(_SC_ARM_MAX) must continue to return ARG_MAX, less than accurate, but still correct. The alternative is to add a new RLIMIT_* resource. Glibc may call getrlimit to see if that is set (the kernel would take care to compute the right value), return that for sysconf(_SC_ARG_MAX), otherwise ARG_MAX. This code would be enabled if you were building against headers that defined the new RLIMIT_* resource. What happens if you have less than 512 kB of RLIMIT_STACK? A quarter of that RLIMIT_STACK could be less than ARG_MAX. I would think it a kernel bug if it doesn't honour providing ARG_MAX space. Are you interested in helping implement this change in glibc? Are you working with someone on the kernel side? -- What |Removed |Added ---------------------------------------------------------------------------- Severity|normal |minor Status|NEW |WAITING http://sourceware.org/bugzilla/show_bug.cgi?id=5786 ------- You are receiving this mail because: ------- You are on the CC list for the bug, or are watching someone who is.