summaryrefslogtreecommitdiff
path: root/sysdeps/unix/sysv/linux/sysconf.c
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2009-03-09 14:35:26 +0000
committerJakub Jelinek <jakub@redhat.com>2009-03-09 14:35:26 +0000
commit5c1d419918b3637170da9a5592049048aaf0ee49 (patch)
tree8ad672f8707275fdbeaf5b8a45eeb2bc8144623a /sysdeps/unix/sysv/linux/sysconf.c
parent48da74123eca38beeaec03d3d46ba09f069ef7dc (diff)
Updated to fedora-glibc-20090309T1421cvs/fedora-glibc-2_9_90-9
Diffstat (limited to 'sysdeps/unix/sysv/linux/sysconf.c')
-rw-r--r--sysdeps/unix/sysv/linux/sysconf.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/sysdeps/unix/sysv/linux/sysconf.c b/sysdeps/unix/sysv/linux/sysconf.c
index f4e36e0c6f..50c5528dd8 100644
--- a/sysdeps/unix/sysv/linux/sysconf.c
+++ b/sysdeps/unix/sysv/linux/sysconf.c
@@ -1,5 +1,5 @@
/* Get file-specific information about a file. Linux version.
- Copyright (C) 2003, 2004, 2006, 2008 Free Software Foundation, Inc.
+ Copyright (C) 2003, 2004, 2006, 2008, 2009 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
@@ -43,6 +43,7 @@ __sysconf (int name)
switch (name)
{
+ struct rlimit rlimit;
#ifdef __NR_clock_getres
case _SC_MONOTONIC_CLOCK:
/* Check using the clock_getres system call. */
@@ -84,12 +85,9 @@ __sysconf (int name)
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 (legacy_ARG_MAX, rlimit.rlim_cur / 4);
- }
+ /* Use getrlimit to get the stack limit. */
+ if (__getrlimit (RLIMIT_STACK, &rlimit) == 0)
+ return MAX (legacy_ARG_MAX, rlimit.rlim_cur / 4);
return legacy_ARG_MAX;
@@ -100,6 +98,9 @@ __sysconf (int name)
break;
case _SC_SIGQUEUE_MAX:
+ if (__getrlimit (RLIMIT_SIGPENDING, &rlimit) == 0)
+ return rlimit.rlim_cur;
+
/* The /proc/sys/kernel/rtsig-max file contains the answer. */
procfname = "/proc/sys/kernel/rtsig-max";
break;