2012-08-20 19:25:02 +00:00
|
|
|
From cde99cd2b7b16a6113acb054e89d490047932a9f Mon Sep 17 00:00:00 2001
|
|
|
|
From: Andreas Schwab <schwab@redhat.com>
|
|
|
|
Date: Thu, 8 Apr 2010 11:18:26 +0200
|
|
|
|
Subject: [PATCH] Don't call uname or getrlimit in libpthread init function
|
|
|
|
|
|
|
|
* sysdeps/unix/sysv/linux/i386/Versions: Export __uname under
|
|
|
|
GLIBC_PRIVATE.
|
|
|
|
* nptl/Versions: Export __getrlimit under GLIBC_PRIVATE.
|
|
|
|
* sysdeps/unix/sysv/linux/i386/smp.h: Call __uname instead of uname.
|
|
|
|
* nptl/nptl-init.c: Call __getrlimit instead of getrlimit.
|
|
|
|
|
|
|
|
---
|
|
|
|
ChangeLog | 8 ++++++++
|
|
|
|
nptl/Versions | 1 +
|
|
|
|
nptl/nptl-init.c | 2 +-
|
2014-05-15 06:56:54 +00:00
|
|
|
sysdeps/unix/sysv/linux/i386/Versions | 6 ++++++
|
|
|
|
sysdeps/unix/sysv/linux/i386/smp.h | 2 +-
|
2012-08-20 19:25:02 +00:00
|
|
|
5 files changed, 17 insertions(+), 2 deletions(-)
|
2014-05-15 06:56:54 +00:00
|
|
|
create mode 100644 sysdeps/unix/sysv/linux/i386/Versions
|
2012-08-20 19:25:02 +00:00
|
|
|
|
|
|
|
--- a/nptl/Version
|
|
|
|
+++ b/nptl/Versions
|
|
|
|
@@ -30,6 +30,7 @@ libc {
|
2014-07-03 05:34:10 +00:00
|
|
|
__libc_pthread_init;
|
|
|
|
__libc_current_sigrtmin_private; __libc_current_sigrtmax_private;
|
|
|
|
__libc_allocate_rtsig_private;
|
2012-08-20 19:25:02 +00:00
|
|
|
+ __getrlimit;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
--- a/nptl/nptl-init.c
|
|
|
|
+++ b/nptl/nptl-init.c
|
|
|
|
@@ -414,7 +414,7 @@ __pthread_initialize_minimal_internal (void)
|
|
|
|
/* Determine the default allowed stack size. This is the size used
|
|
|
|
in case the user does not specify one. */
|
|
|
|
struct rlimit limit;
|
|
|
|
- if (getrlimit (RLIMIT_STACK, &limit) != 0
|
|
|
|
+ if (__getrlimit (RLIMIT_STACK, &limit) != 0
|
|
|
|
|| limit.rlim_cur == RLIM_INFINITY)
|
|
|
|
/* The system limit is not usable. Use an architecture-specific
|
|
|
|
default. */
|
2014-05-15 06:56:54 +00:00
|
|
|
--- a/sysdeps/unix/sysv/linux/i386/Versions
|
|
|
|
+++ b/sysdeps/unix/sysv/linux/i386/Versions
|
|
|
|
@@ -53,5 +53,6 @@
|
|
|
|
}
|
|
|
|
GLIBC_PRIVATE {
|
|
|
|
__modify_ldt;
|
2012-08-20 19:25:02 +00:00
|
|
|
+ __uname;
|
2014-05-15 06:56:54 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
--- a/sysdeps/unix/sysv/linux/i386/smp.h
|
|
|
|
+++ b/sysdeps/unix/sysv/linux/i386/smp.h
|
2012-08-20 19:25:02 +00:00
|
|
|
@@ -36,7 +36,7 @@ is_smp_system (void)
|
|
|
|
char *cp;
|
|
|
|
|
|
|
|
/* Try reading the number using `sysctl' first. */
|
|
|
|
- if (uname (&u.uts) == 0)
|
|
|
|
+ if (__uname (&u.uts) == 0)
|
|
|
|
cp = u.uts.version;
|
|
|
|
else
|
|
|
|
{
|