mirror of
https://sourceware.org/git/glibc.git
synced 2025-07-29 11:41:21 +03:00
[BZ #5786]
* elf/dl-sysdep.c: Undefine ROUND after use. * sysdeps/generic/ldsodefs.h [HAVE_DL_DISCOVER_OSVERSION] (struct rtld_global_ro): Add _dl_tls_get_addr_soft element. * elf/rtld.c (rtld_global_ro): Initialize _dl_discover_osversion. * sysdeps/unix/sysv/linux/dl-osinfo.h: Move _dl_discover_osversion to ... * sysdeps/unix/sysv/linux/dl-sysdep.c: ...here. * sysdeps/unix/sysv/linux/dl-sysdep.h: Declare _dl_discover_osversion if necessary. * sysdeps/unix/sysv/linux/sysconf.c: Handle _SC_ARG_MAX here.
This commit is contained in:
@ -1,5 +1,5 @@
|
||||
/* Get file-specific information about a file. Linux version.
|
||||
Copyright (C) 2003, 2004, 2006 Free Software Foundation, Inc.
|
||||
Copyright (C) 2003, 2004, 2006, 2008 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
@ -23,7 +23,9 @@
|
||||
#include <sysdep.h>
|
||||
#include <time.h>
|
||||
#include <unistd.h>
|
||||
#include <sys/resource.h>
|
||||
#include <not-cancel.h>
|
||||
#include <ldsodefs.h>
|
||||
|
||||
static long int posix_sysconf (int name);
|
||||
|
||||
@ -70,6 +72,22 @@ __sysconf (int name)
|
||||
}
|
||||
#endif
|
||||
|
||||
case _SC_ARG_MAX:
|
||||
#if __LINUX_KERNEL_VERSION < 0x020617
|
||||
/* Determine whether this is a kernel 2.6.23 or later. Only
|
||||
then do we have an argument limit determined by the stack
|
||||
size. */
|
||||
if (GLRO(dl_discover_osversion) () >= 0x020617)
|
||||
#endif
|
||||
{
|
||||
/* Use getrlimit to get the stack limit. */
|
||||
struct rlimit rlimit;
|
||||
if (__getrlimit (RLIMIT_STACK, &rlimit) == 0)
|
||||
return MAX (ARG_MAX, rlimit.rlim_cur / 4);
|
||||
}
|
||||
|
||||
return ARG_MAX;
|
||||
|
||||
case _SC_NGROUPS_MAX:
|
||||
/* Try to read the information from the /proc/sys/kernel/ngroups_max
|
||||
file. */
|
||||
|
Reference in New Issue
Block a user