Updated to fedora-glibc-20041005T0745

This commit is contained in:
Jakub Jelinek 2004-10-05 08:25:34 +00:00
parent 85148842d4
commit fd63f7c6ce
56 changed files with 469 additions and 231 deletions

View File

@ -1,5 +1,77 @@
2004-10-05 Jakub Jelinek <jakub@redhat.com>
* sysdeps/unix/sysv/linux/i386/sysconf.c: Include hp-timing.h.
(__sysconf): Return -1 for _SC_CPUTIME or _SC_THREAD_CPUTIME if
!HP_TIMING_AVAIL.
* nscd/connections.c: Include dlfcn.h and gnu/lib-names.h.
(start_threads): If _POSIX_CLOCK_SELECTION is -1 but
_POSIX_THREADS > 0, dlopen LIBPTHREAD_SO and look for
pthread_condattr_setclock in it.
* nscd/Makefile (relro-LDFLAGS): Add -Wl,-z,now if have-z-relro.
($(objpfx)nscd): Add $(relro-LDFLAGS).
2004-10-04 Ulrich Drepper <drepper@redhat.com>
* nscd/gai.c: Define __no_netlink_support if NEED_NETLINK is
defined and __ASSUME_NETLINK_SUPPORT is zero.
* sysdeps/unix/sysv/linux/Makefile (CFLAGS-gai.c): Add
-DNEED_NETLINK.
* malloc/mtrace.pl: Avoid calling location unless it is needed for
output. Patch by Edward Bishop <binutils@gmail.com>.
* nscd/Makefile (CFLAGS-gai.c): Add -fpie.
2004-10-04 H.J. Lu <hongjiu.lu@intel.com>
* sysdeps/unix/sysv/linux/ia64/clock_getcpuclockid.c
(clock_getcpuclockid): Add missing retval.
* sysdeps/unix/sysv/linux/ia64/sysconf.c (linux_sysconf): Fix a typo.
2004-10-04 Roland McGrath <roland@redhat.com>
* include/errno.h [RTLD_PRIVATE_ERRNO] (errno): Rename the real symbol
to rtld_errno.
* sysdeps/generic/errno.c [RTLD_PRIVATE_ERRNO] (rtld_errno): Define it,
and don't define any other errno names.
* sysdeps/unix/alpha/sysdep.h [RTLD_PRIVATE_ERRNO]: Use rtld_errno in
place of errno.
* sysdeps/unix/i386/sysdep.S: Likewise.
* sysdeps/unix/sysv/linux/i386/sysdep.h: Likewise.
* sysdeps/unix/sysv/linux/ia64/sysdep.S: Likewise.
* sysdeps/unix/sysv/linux/m68k/sysdep.h: Likewise.
* sysdeps/unix/sysv/linux/s390/s390-32/sysdep.S: Likewise.
* sysdeps/unix/sysv/linux/s390/s390-32/sysdep.h: Likewise.
* sysdeps/unix/sysv/linux/s390/s390-64/sysdep.S: Likewise.
* sysdeps/unix/sysv/linux/s390/s390-64/sysdep.h: Likewise.
* sysdeps/unix/sysv/linux/sh/sysdep.h: Likewise.
* sysdeps/unix/sysv/linux/sparc/sparc32/sysdep.h: Likewise.
* sysdeps/unix/sysv/linux/x86_64/sysdep.h: Likewise.
* sysdeps/unix/x86_64/sysdep.S: Likewise.
* sysdeps/generic/errno.c [! USE___THREAD] (errno): Use `nocommon'
attribute instead of `section'.
2004-10-04 Ulrich Drepper <drepper@redhat.com>
* sysdeps/unix/sysv/linux/ia64/sysconf.c: New file.
* sysdeps/unix/sysv/linux/ia64/Dist: Add has_cpuclock.c.
* sysdeps/unix/sysv/linux/ia64/clock_getcpuclockid.c: Move actual
testing code to...
* sysdeps/unix/sysv/linux/ia64/has_cpuclock.c: ...here. New file.
* sysdeps/unix/sysv/linux/i386/sysconf.c: Add dynamic check for
_SC_CPUTIME and _SC_THREAD_CPUTIME.
* nscd/connections.c (start_threads): Use sysconf in case
_POSIX_CLOCK_SELECTION or _POSIX_MONOTONIC_CLOCK is not greater zero.
* nscd/Makefile (nscd-modules): Add gai.
* nscd/gai.c: New file.
* nscd/nscd.c: Remove getaddrinfo stub definition.
* assert/assert.h: Give up on using __builtin_expect.
* elf/rtld.c (dl_main): Only skip => output in ldd mode if both
@ -17,7 +89,7 @@
2004-10-03 Juerg Billeter <j@bitron.ch>
* nscd/nscd_initgroups.c (__nscd_getgrouplist): Return -1 if nscd
can't be used.
can't be used. [BZ #424]
2004-10-03 Ulrich Drepper <drepper@redhat.com>
@ -61,7 +133,7 @@
don't replace old content.
* nscd/connections.c: Rewrite handling of incoming connections. All
are handled by one thread which then hands of the descriptors for the
are handled by one thread which then hands off the descriptors for the
real work to the worker threads.
* nscd/Makefile: Link nscd with librt.

View File

@ -1,5 +1,5 @@
# This file is updated automatically by Makefile.
glibc-branch := fedora
glibc-base := HEAD
fedora-sync-date := 2004-10-04 07:47 UTC
fedora-sync-tag := fedora-glibc-20041004T0747
fedora-sync-date := 2004-10-05 07:45 UTC
fedora-sync-tag := fedora-glibc-20041005T0745

View File

@ -1,4 +1,4 @@
%define glibcrelease 64
%define glibcrelease 65
%define auxarches i586 i686 athlon sparcv9 alphaev6
%define prelinkarches noarch
%define nptlarches i386 i686 athlon x86_64 ia64 s390 s390x sparcv9 ppc ppc64
@ -1239,6 +1239,18 @@ rm -f *.filelist*
%endif
%changelog
* Tue Oct 5 2004 Jakub Jelinek <jakub@redhat.com> 2.3.3-65
- update from CVS
- define _POSIX_THREAD_PROCESS_SHARED and _POSIX_CLOCK_SELECTION
to -1 in LinuxThreads
- define _POSIX_CPUTIME and _POSIX_THREAD_CPUTIME to 0
on i?86/ia64 and make sure sysconf (_SC_{,THREAD_}CPUTIME)
returns correct value
- if _POSIX_CLOCK_SELECTION == -1 in nscd, still try
sysconf (_SC_CLOCK_SELECTION) and if it returns true,
dlopen libpthread.so and dlsym pthread_condattr_setclock
- build nscd with -z relro and -z now
* Mon Oct 4 2004 Jakub Jelinek <jakub@redhat.com> 2.3.3-64
- update from CVS
- stop using __builtin_expect in assert and assert_perror

View File

@ -14,8 +14,8 @@
so a single (hidden) global variable is all it needs. */
# undef errno
# define errno errno /* For #ifndef errno tests. */
extern int errno attribute_hidden;
# define errno rtld_errno
extern int rtld_errno attribute_hidden;
# else

View File

@ -1,3 +1,15 @@
2004-10-04 Ulrich Drepper <drepper@redhat.com>
* sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: Set _POSIX_CPUTIME
and _POSIX_THREAD_CPUTIME to zero.
* sysdeps/unix/sysv/linux/ia64/bits/posix_opt.h: Likewise.
* sysdeps/unix/sysv/linux/bits/posix_opt.h: Define
_POSIX_THREAD_PROCESS_SHARED and _POSIX_CLOCK_SELECTION as -1.
* sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: Likewise.
* sysdeps/unix/sysv/linux/ia64/bits/posix_opt.h: Likewise.
* sysdeps/unix/sysv/linux/x86_64/bits/posix_opt.h: Likewise.
2004-09-25 Roland McGrath <roland@redhat.com>
[BZ #406]

View File

@ -132,7 +132,13 @@
/* POSIX message queues are available. */
#define _POSIX_MESSAGE_PASSING 200112L
/* Thread process-shared synchronization is not supported. */
#define _POSIX_THREAD_PROCESS_SHARED -1
/* The monotonic clock might be available. */
#define _POSIX_MONOTONIC_CLOCK 0
/* The clock selection interfaces are not available. */
#define _POSIX_CLOCK_SELECTION -1
#endif /* posix_opt.h */

View File

@ -106,10 +106,10 @@
#define _POSIX_SHARED_MEMORY_OBJECTS 200112L
/* CPU-time clocks supported. */
#define _POSIX_CPUTIME 200112L
#define _POSIX_CPUTIME 0
/* We support the clock also in threads. */
#define _POSIX_THREAD_CPUTIME 200112L
#define _POSIX_THREAD_CPUTIME 0
/* GNU libc provides regular expression handling. */
#define _POSIX_REGEXP 1
@ -138,7 +138,13 @@
/* POSIX message queues are available. */
#define _POSIX_MESSAGE_PASSING 200112L
/* Thread process-shared synchronization is not supported. */
#define _POSIX_THREAD_PROCESS_SHARED -1
/* The monotonic clock might be available. */
#define _POSIX_MONOTONIC_CLOCK 0
/* The clock selection interfaces are not available. */
#define _POSIX_CLOCK_SELECTION -1
#endif /* posix_opt.h */

View File

@ -106,10 +106,10 @@
#define _POSIX_SHARED_MEMORY_OBJECTS 200112L
/* CPU-time clocks supported. */
#define _POSIX_CPUTIME 200112L
#define _POSIX_CPUTIME 0
/* We support the clock also in threads. */
#define _POSIX_THREAD_CPUTIME 200112L
#define _POSIX_THREAD_CPUTIME 0
/* GNU libc provides regular expression handling. */
#define _POSIX_REGEXP 1
@ -138,7 +138,13 @@
/* POSIX message queues are available. */
#define _POSIX_MESSAGE_PASSING 200112L
/* Thread process-shared synchronization is not supported. */
#define _POSIX_THREAD_PROCESS_SHARED -1
/* The monotonic clock might be available. */
#define _POSIX_MONOTONIC_CLOCK 0
/* The clock selection interfaces are not available. */
#define _POSIX_CLOCK_SELECTION -1
#endif /* posix_opt.h */

View File

@ -138,7 +138,13 @@
/* POSIX message queues are available. */
#define _POSIX_MESSAGE_PASSING 200112L
/* Thread process-shared synchronization is not supported. */
#define _POSIX_THREAD_PROCESS_SHARED -1
/* The monotonic clock might be available. */
#define _POSIX_MONOTONIC_CLOCK 0
/* The clock selection interfaces are not available. */
#define _POSIX_CLOCK_SELECTION -1
#endif /* posix_opt.h */

View File

@ -1,3 +1,8 @@
2004-10-04 Ulrich Drepper <drepper@redhat.com>
* locales/gu_IN: Update various incorrect and missing information.
Patch by Ankit Patel <ankit@redhat.com>.
2004-09-28 Ulrich Drepper <drepper@redhat.com>
* locales/nb_NO: Make language field consistent in form with nn_NO.

View File

@ -1,11 +1,12 @@
comment_char %
escape_char /
% Gurajati language locale for India.
% Copied fron hi_IN one, G Karunakar <karunakar@freedomink.org>
% Gurajati Language Locale For India.
% Copied from hi_IN one, G Karunakar <karunakar@freedomink.org>
% Gujarati stuff from Tapan Parikh <tap2k@yahoo.com>
% Gujarati stuff Modified by Ankit Patel <ankit@redhat.com>
LC_IDENTIFICATION
title "Gujarati language locale for India"
title "Gujarati Language Locale For India"
source "IndLinux.org"
address ""
contact ""
@ -14,8 +15,8 @@ tel ""
fax ""
language "Gujarati"
territory "India"
revision "0.1"
date "2003-01-10"
revision "0.2"
date "2004-14-09"
%
category "gu_IN:2000";LC_IDENTIFICATION
category "gu_IN:2000";LC_CTYPE
@ -53,7 +54,7 @@ currency_symbol "<U0AB0><U0AC1>"
mon_decimal_point "<U002E>"
mon_thousands_sep "<U002C>"
mon_grouping 3
positive_sign ""
positive_sign "<U002B>"
negative_sign "<U002D>"
int_frac_digits 2
frac_digits 2
@ -79,7 +80,7 @@ LC_TIME
% Abbreviated weekday names (%a)
abday "<U0AB0><U0AB5><U0ABF>";/
"<U0AB8><U0ACB><U0AAE>";/
"<U0AAE><U0AA8><U0ACD><U0A97><U0AB3>";/
"<U0AAE><U0A82><U0A97><U0AB3>";/
"<U0AAC><U0AC1><U0AA7>";/
"<U0A97><U0AC1><U0AB0><U0AC1>";/
"<U0AB6><U0AC1><U0A95><U0ACD><U0AB0>";/
@ -89,7 +90,7 @@ abday "<U0AB0><U0AB5><U0ABF>";/
% Full weekday names (%A)
day "<U0AB0><U0AB5><U0ABF><U0AB5><U0ABE><U0AB0>";/
"<U0AB8><U0ACB><U0AAE><U0AB5><U0ABE><U0AB0>";/
"<U0AAE><U0AA8><U0ACD><U0A97><U0AB3><U0AB5><U0ABE><U0AB0>";/
"<U0AAE><U0A82><U0A97><U0AB3><U0AB5><U0ABE><U0AB0>";/
"<U0AAC><U0AC1><U0AA7><U0AB5><U0ABE><U0AB0>";/
"<U0A97><U0AC1><U0AB0><U0AC1><U0AB5><U0ABE><U0AB0>";/
"<U0AB6><U0AC1><U0A95><U0ACD><U0AB0><U0AB5><U0ABE><U0AB0>";/
@ -104,7 +105,7 @@ abmon "<U0A9C><U0ABE><U0AA8>";/
"<U0A9C><U0AC1><U0AA8>";/
"<U0A9C><U0AC1><U0AB2>";/
"<U0A93><U0A97>";/
"<U0AB8><U0AC7><U0AAA><U0ACD><U0A9F>";/
"<U0AB8><U0AAA><U0ACD><U0A9F>";/
"<U0A93><U0A95><U0ACD><U0A9F>";/
"<U0AA8><U0ACB><U0AB5>";/
"<U0AA1><U0ABF><U0AB8>"
@ -119,7 +120,7 @@ mon "<U0A9C><U0ABE><U0AA8><U0ACD><U0AAF><U0AC1><U0A86><U0AB0><U0AC0>";/
"<U0A9C><U0AC1><U0AA8>";/
"<U0A9C><U0AC1><U0AB2><U0ABE><U0A87>";/
"<U0A93><U0A97><U0AB8><U0ACD><U0A9F>";/
"<U0AB8><U0AC7><U0AAA><U0ACD><U0A9F><U0AC7><U0AAE><U0ACD><U0AAC><U0AB0>";/
"<U0AB8><U0AAA><U0ACD><U0A9F><U0AC7><U0AAE><U0ACD><U0AAC><U0AB0>";/
"<U0A93><U0A95><U0ACD><U0A9F><U0ACB><U0AAC><U0AB0>";/
"<U0AA8><U0AB5><U0AC7><U0AAE><U0ACD><U0AAC><U0AB0>";/
"<U0AA1><U0ABF><U0AB8><U0AC7><U0AAE><U0ACD><U0AAC><U0AB0>"
@ -127,9 +128,9 @@ mon "<U0A9C><U0ABE><U0AA8><U0ACD><U0AAF><U0AC1><U0A86><U0AB0><U0AC0>";/
%
% Equivalent of AM PM
am_pm "<U0AB8><U0AB5><U0ABE><U0AB0><U0AC7>";/
"<U0AB8><U0ABE><U0AA8><U0ACD><U0A9C><U0AC7>"
"<U0AB8><U0ABE><U0A82><U0A9C><U0AC7>"
% *** There arent any Devanagari characters below, so for time being
% *** There aren't any Devanagari characters below, so for time being
% *** maintain same for Gujarati also, Karunakar
%
@ -158,10 +159,9 @@ date_fmt "<U0025><U0061><U0020><U0025><U0062><U0020><U0025><U0065>/
<U0025><U005A><U0020><U0025><U0059>"
END LC_TIME
LC_MESSAGES
yesexpr "<U005E><U005B><U0079><U0059><U005D><U002E><U002A>"
noexpr "<U005E><U005B><U006E><U004E><U005D><U002E><U002A>"
yesexpr "<U005E><U005B><U0079><U0059><U0AB9><U005D>"
noexpr "<U005E><U005B><U006E><U004E><U0AA8><U005D>"
END LC_MESSAGES
@ -176,12 +176,11 @@ LC_NAME
%
name_fmt "<U0025><U0070><U0025><U0074><U0025><U0066><U0025><U0074>/
<U0025><U0067>"
% ***** We can have Gujarati eqv for below , Karunakar
name_gen ""
name_mr "<U004D><U0072><U002E>"
name_mrs "<U004D><U0072><U0073><U002E>"
name_miss "<U004D><U0069><U0073><U0073><U002E>"
name_ms "<U004D><U0073><U002E>"
name_gen "<U0A9C><U0ABE><U0AA4><U0ABF>"
name_mr "<U0AB6><U0ACD><U0AB0><U0AC0><U0AAE><U0ABE><U0AA8>"
name_mrs "<U0AB6><U0ACD><U0AB0><U0AC0><U0AAE><U0AA4><U0ABF>"
name_miss "<U0A95><U0AC1><U0AAE><U0ABE><U0AB0><U0AC0>"
name_ms "<U0AB8><U0AB6><U0ACD><U0AB0><U0AC0>"
END LC_NAME

View File

@ -165,17 +165,18 @@ while (<DATA>) {
if ($cols[$n] eq "+") {
if (defined $allocated{$allocaddr}) {
printf ("+ %#0@XXX@x Alloc %d duplicate: %s %s\n",
hex($allocaddr), $nr, $wherewas{$allocaddr}, $where);
hex($allocaddr), $nr, &location($addrwas{$allocaddr}),
$where);
} else {
$allocated{$allocaddr}=$howmuch;
$wherewas{$allocaddr}=&location($where);
$addrwas{$allocaddr}=$where;
}
last SWITCH;
}
if ($cols[$n] eq "-") {
if (defined $allocated{$allocaddr}) {
undef $allocated{$allocaddr};
undef $wherewas{$allocaddr};
undef $addrwas{$allocaddr};
} else {
printf ("- %#0@XXX@x Free %d was never alloc'd %s\n",
hex($allocaddr), $nr, &location($where));
@ -185,7 +186,7 @@ while (<DATA>) {
if ($cols[$n] eq "<") {
if (defined $allocated{$allocaddr}) {
undef $allocated{$allocaddr};
undef $wherewas{$allocaddr};
undef $addrwas{$allocaddr};
} else {
printf ("- %#0@XXX@x Realloc %d was never alloc'd %s\n",
hex($allocaddr), $nr, &location($where));
@ -196,10 +197,10 @@ while (<DATA>) {
if (defined $allocated{$allocaddr}) {
printf ("+ %#0@XXX@x Realloc %d duplicate: %#010x %s %s\n",
hex($allocaddr), $nr, $allocated{$allocaddr},
$wherewas{$allocaddr}, &location($where));
&location($addrwas{$allocaddr}), &location($where));
} else {
$allocated{$allocaddr}=$howmuch;
$wherewas{$allocaddr}=&location($where);
$addrwas{$allocaddr}=$where;
}
last SWITCH;
}
@ -227,7 +228,7 @@ if ($#addrs >= 0) {
$anything=1;
}
printf ("%#0@XXX@x %#8x at %s\n", hex($addr), $allocated{$addr},
$wherewas{$addr});
&location($addrwas{$addr}));
}
}
}

View File

@ -1,3 +1,25 @@
2004-10-04 Ulrich Drepper <drepper@redhat.com>
* sysdeps/unix/sysv/linux/i386/bits/posix_opt.h: Define _POSIX_CPUTIME
and _POSIX_THREAD_CPUTIME to zero.
* sysdeps/unix/sysv/linux/ia64/bits/posix_opt.h: Likewise.
* tst-barrier2.c: Fix testing for POSIX feature.
* tst-clock1.c: Likewise.
* tst-clock2.c: Likewise.
* tst-cond11.c: Likewise.
* tst-cond4.c: Likewise.
* tst-cond6.c: Likewise.
* tst-flock2.c: Likewise.
* tst-mutex4.c: Likewise.
* tst-mutex9.c: Likewise.
* tst-rwlock12.c: Likewise.
* tst-rwlock4.c: Likewise.
* tst-signal1.c: Likewise.
* tst-spin2.c: Likewise.
* sysdeps/pthread/posix-timer.h: Likewise.
* sysdeps/pthread/timer_create.c: Likewise.
* sysdeps/pthread/timer_routines.c: Likewise.
2004-10-01 Ulrich Drepper <drepper@redhat.com>
* sysdeps/unix/sysv/linux/x86_64/lowlevellock.S

View File

@ -1,5 +1,5 @@
/* Definitions for POSIX timer implementation on top of NPTL.
Copyright (C) 2000, 2002, 2003 Free Software Foundation, Inc.
Copyright (C) 2000, 2002, 2003, 2004 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Kaz Kylheku <kaz@ashi.footprints.net>.
@ -92,10 +92,10 @@ extern int __timer_init_failed;
/* A distinct thread is used for each clock type. */
extern struct thread_node __timer_signal_thread_rclk;
#ifdef _POSIX_CPUTIME
#if defined _POSIX_CPUTIME && _POSIX_CPUTIME >= 0
extern struct thread_node __timer_signal_thread_pclk;
#endif
#ifdef _POSIX_THREAD_CPUTIME
#if defined _POSIX_THREAD_CPUTIME && _POSIX_THREAD_CPUTIME >= 0
extern struct thread_node __timer_signal_thread_tclk;
#endif

View File

@ -38,10 +38,10 @@ timer_create (clock_id, evp, timerid)
struct thread_node *thread = NULL;
if (0
#ifdef _POSIX_CPUTIME
#ifdef CLOCK_PROCESS_CPUTIME_ID
|| clock_id == CLOCK_PROCESS_CPUTIME_ID
#endif
#ifdef _POSIX_THREAD_CPUTIME
#ifdef CLOCK_THREAD_CPUTIME_ID
|| clock_id == CLOCK_THREAD_CPUTIME_ID
#endif
)
@ -100,12 +100,12 @@ timer_create (clock_id, evp, timerid)
default:
thread = &__timer_signal_thread_rclk;
break;
#ifdef _POSIX_CPUTIME
#ifdef CLOCK_PROCESS_CPUTIME_ID
case CLOCK_PROCESS_CPUTIME_ID:
thread = &__timer_signal_thread_pclk;
break;
#endif
#ifdef _POSIX_THREAD_CPUTIME
#ifdef CLOCK_THREAD_CPUTIME_ID
case CLOCK_THREAD_CPUTIME_ID:
thread = &__timer_signal_thread_tclk;
break;

View File

@ -53,10 +53,10 @@ int __timer_init_failed;
/* Node for the thread used to deliver signals. */
struct thread_node __timer_signal_thread_rclk;
#ifdef _POSIX_CPUTIME
#if defined _POSIX_CPUTIME && _POSIX_CPUTIME >= 0
struct thread_node __timer_signal_thread_pclk;
#endif
#ifdef _POSIX_THREAD_CPUTIME
#if defined _POSIX_THREAD_CPUTIME && _POSIX_THREAD_CPUTIME >= 0
struct thread_node __timer_signal_thread_tclk;
#endif
@ -191,10 +191,10 @@ init_module (void)
list_append (&thread_free_list, &thread_array[i].links);
thread_init (&__timer_signal_thread_rclk, 0, CLOCK_REALTIME);
#ifdef _POSIX_CPUTIME
#if defined _POSIX_CPUTIME && _POSIX_CPUTIME >= 0
thread_init (&__timer_signal_thread_pclk, 0, CLOCK_PROCESS_CPUTIME_ID);
#endif
#ifdef _POSIX_THREAD_CPUTIME
#if defined _POSIX_THREAD_CPUTIME && _POSIX_THREAD_CPUTIME >= 0
thread_init (&__timer_signal_thread_tclk, 0, CLOCK_THREAD_CPUTIME_ID);
#endif
}
@ -281,10 +281,10 @@ thread_cleanup (void *val)
/* How did the signal thread get killed? */
assert (thread != &__timer_signal_thread_rclk);
#ifdef _POSIX_CPUTIME
#if defined _POSIX_CPUTIME && _POSIX_CPUTIME >= 0
assert (thread != &__timer_signal_thread_pclk);
#endif
#ifdef _POSIX_THREAD_CPUTIME
#if defined _POSIX_THREAD_CPUTIME && _POSIX_THREAD_CPUTIME >= 0
assert (thread != &__timer_signal_thread_tclk);
#endif

View File

@ -103,10 +103,10 @@
#define _POSIX_SHARED_MEMORY_OBJECTS 200112L
/* CPU-time clocks supported. */
#define _POSIX_CPUTIME 200112L
#define _POSIX_CPUTIME 0
/* We support the clock also in threads. */
#define _POSIX_THREAD_CPUTIME 200112L
#define _POSIX_THREAD_CPUTIME 0
/* GNU libc provides regular expression handling. */
#define _POSIX_REGEXP 1

View File

@ -103,10 +103,10 @@
#define _POSIX_SHARED_MEMORY_OBJECTS 200112L
/* CPU-time clocks supported. */
#define _POSIX_CPUTIME 200112L
#define _POSIX_CPUTIME 0
/* We support the clock also in threads. */
#define _POSIX_THREAD_CPUTIME 200112L
#define _POSIX_THREAD_CPUTIME 0
/* GNU libc provides regular expression handling. */
#define _POSIX_REGEXP 1

View File

@ -1,4 +1,4 @@
/* Copyright (C) 2002, 2003 Free Software Foundation, Inc.
/* Copyright (C) 2002, 2003, 2004 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@redhat.com>, 2002.
@ -31,12 +31,6 @@
static int
do_test (void)
{
#if ! _POSIX_THREAD_PROCESS_SHARED
puts ("_POSIX_THREAD_PROCESS_SHARED not supported, test skipped");
#else
size_t ps = sysconf (_SC_PAGESIZE);
char tmpfname[] = "/tmp/tst-barrier2.XXXXXX";
char data[ps];
@ -183,7 +177,6 @@ do_test (void)
WEXITSTATUS (status) + serials, N);
return 1;
}
#endif
return 0;
}

View File

@ -1,4 +1,4 @@
/* Copyright (C) 2003 Free Software Foundation, Inc.
/* Copyright (C) 2003, 2004 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@redhat.com>, 2003.
@ -27,13 +27,13 @@
int
do_test (void)
{
#if _POSIX_THREAD_CPUTIME
#ifdef _POSIX_THREAD_CPUTIME && _POSIX_THREAD_CPUTIME >= 0
clockid_t cl;
/* This is really only a linking-test here. */
int e = pthread_getcpuclockid (pthread_self (), &cl);
if (e != 0)
{
# if _POSIX_THREAD_CPUTIME < 0
# if _POSIX_THREAD_CPUTIME == 0
if (sysconf (_SC_THREAD_CPUTIME) >= 0)
# endif
{

View File

@ -25,7 +25,7 @@
#include <unistd.h>
#if _POSIX_THREAD_CPUTIME
#ifdef _POSIX_THREAD_CPUTIME && _POSIX_THREAD_CPUTIME >= 0
static pthread_barrier_t b2;
static pthread_barrier_t bN;
@ -55,7 +55,7 @@ tf (void *arg)
int
do_test (void)
{
#if _POSIX_THREAD_CPUTIME
#if defined _POSIX_THREAD_CPUTIME && _POSIX_THREAD_CPUTIME >= 0
# define N 10
if (pthread_barrier_init (&b2, NULL, 2) != 0

View File

@ -1,4 +1,4 @@
/* Copyright (C) 2003 Free Software Foundation, Inc.
/* Copyright (C) 2003, 2004 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@redhat.com>, 2003.
@ -24,7 +24,7 @@
#include <unistd.h>
#if _POSIX_CLOCK_SELECTION
#ifdef _POSIX_CLOCK_SELECTION && _POSIX_CLOCK_SELECTION >= 0
static int
run_test (clockid_t cl)
{
@ -156,7 +156,7 @@ run_test (clockid_t cl)
static int
do_test (void)
{
#if ! _POSIX_CLOCK_SELECTION
#if !defined _POSIX_CLOCK_SELECTION || _POSIX_CLOCK_SELECTION == -1
puts ("_POSIX_CLOCK_SELECTION not supported, test skipped");
return 0;
@ -165,7 +165,7 @@ do_test (void)
int res = run_test (CLOCK_REALTIME);
# if defined _POSIX_MONOTONIC_CLOCK
# if defined _POSIX_MONOTONIC_CLOCK && _POSIX_MONOTONIC_CLOCK >= 0
# if _POSIX_MONOTONIC_CLOCK == 0
int e = sysconf (_SC_MONOTONIC_CLOCK);
if (e < 0)

View File

@ -1,4 +1,4 @@
/* Copyright (C) 2002, 2003 Free Software Foundation, Inc.
/* Copyright (C) 2002, 2003, 2004 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@redhat.com>, 2002.
@ -32,13 +32,6 @@ int *condition;
static int
do_test (void)
{
#if ! _POSIX_THREAD_PROCESS_SHARED
puts ("_POSIX_THREAD_PROCESS_SHARED not supported, test skipped");
return 0;
#else
size_t ps = sysconf (_SC_PAGESIZE);
char tmpfname[] = "/tmp/tst-cond4.XXXXXX";
char data[ps];
@ -264,7 +257,6 @@ do_test (void)
}
return result;
#endif
}
#define TEST_FUNCTION do_test ()

View File

@ -34,13 +34,6 @@ int *condition;
static int
do_test (void)
{
#if ! _POSIX_THREAD_PROCESS_SHARED
puts ("_POSIX_THREAD_PROCESS_SHARED not supported, test skipped");
return 0;
#else
size_t ps = sysconf (_SC_PAGESIZE);
char tmpfname[] = "/tmp/tst-cond6.XXXXXX";
char data[ps];
@ -234,7 +227,6 @@ do_test (void)
}
return result;
#endif
}
#define TEST_FUNCTION do_test ()

View File

@ -1,4 +1,4 @@
/* Copyright (C) 2002, 2003 Free Software Foundation, Inc.
/* Copyright (C) 2002, 2003, 2004 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@redhat.com>, 2002.
@ -59,13 +59,6 @@ tf (void *arg)
static int
do_test (void)
{
#if ! _POSIX_THREAD_PROCESS_SHARED
puts ("_POSIX_THREAD_PROCESS_SHARED not supported, test skipped");
return 0;
#else
char tmp[] = "/tmp/tst-flock2-XXXXXX";
fd = mkstemp (tmp);
@ -261,7 +254,6 @@ do_test (void)
}
return status;
#endif
}
#define TEST_FUNCTION do_test ()

View File

@ -1,4 +1,4 @@
/* Copyright (C) 2002, 2003 Free Software Foundation, Inc.
/* Copyright (C) 2002, 2003, 2004 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@redhat.com>, 2002.
@ -31,13 +31,6 @@
static int
do_test (void)
{
#if ! _POSIX_THREAD_PROCESS_SHARED
puts ("_POSIX_THREAD_PROCESS_SHARED not supported, test skipped");
return 0;
#else
size_t ps = sysconf (_SC_PAGESIZE);
char tmpfname[] = "/tmp/tst-mutex4.XXXXXX";
char data[ps];
@ -191,7 +184,6 @@ do_test (void)
}
return 0;
#endif
}
#define TIMEOUT 4

View File

@ -1,4 +1,4 @@
/* Copyright (C) 2003 Free Software Foundation, Inc.
/* Copyright (C) 2003, 2004 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@redhat.com>, 2003.
@ -29,13 +29,6 @@
static int
do_test (void)
{
#if ! _POSIX_THREAD_PROCESS_SHARED
puts ("_POSIX_THREAD_PROCESS_SHARED not supported, test skipped");
return 0;
#else
size_t ps = sysconf (_SC_PAGESIZE);
char tmpfname[] = "/tmp/tst-mutex9.XXXXXX";
char data[ps];
@ -186,7 +179,6 @@ do_test (void)
}
return 0;
#endif
}
#define TIMEOUT 3

View File

@ -1,4 +1,4 @@
/* Copyright (C) 2002, 2003 Free Software Foundation, Inc.
/* Copyright (C) 2002, 2003, 2004 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@redhat.com>, 2002.
@ -31,13 +31,6 @@
static int
do_test (void)
{
#if ! _POSIX_THREAD_PROCESS_SHARED
puts ("_POSIX_THREAD_PROCESS_SHARED not supported, test skipped");
return 0;
#else
size_t ps = sysconf (_SC_PAGESIZE);
char tmpfname[] = "/tmp/tst-rwlock12.XXXXXX";
char data[ps];
@ -209,7 +202,6 @@ do_test (void)
}
return status;
#endif
}
#define TEST_FUNCTION do_test ()

View File

@ -1,4 +1,4 @@
/* Copyright (C) 2002, 2003 Free Software Foundation, Inc.
/* Copyright (C) 2002, 2003, 2004 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@redhat.com>, 2002.
@ -31,13 +31,6 @@
static int
do_test (void)
{
#if ! _POSIX_THREAD_PROCESS_SHARED
puts ("_POSIX_THREAD_PROCESS_SHARED not supported, test skipped");
return 0;
#else
size_t ps = sysconf (_SC_PAGESIZE);
char tmpfname[] = "/tmp/tst-rwlock4.XXXXXX";
char data[ps];
@ -191,7 +184,6 @@ do_test (void)
}
return 0;
#endif
}
#define TEST_FUNCTION do_test ()

View File

@ -1,4 +1,4 @@
/* Copyright (C) 2002, 2003 Free Software Foundation, Inc.
/* Copyright (C) 2002, 2003, 2004 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@redhat.com>, 2002.
@ -94,13 +94,6 @@ receiver (void)
static int
do_test (void)
{
#if ! _POSIX_THREAD_PROCESS_SHARED
puts ("_POSIX_THREAD_PROCESS_SHARED not supported, test skipped");
return 0;
#else
char tmp[] = "/tmp/tst-signal1-XXXXXX";
int fd = mkstemp (tmp);
@ -190,7 +183,6 @@ do_test (void)
}
return 0;
#endif
}
#define TEST_FUNCTION do_test ()

View File

@ -1,4 +1,4 @@
/* Copyright (C) 2002, 2003 Free Software Foundation, Inc.
/* Copyright (C) 2002, 2003, 2004 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@redhat.com>, 2002.
@ -31,12 +31,6 @@
static int
do_test (void)
{
#if ! _POSIX_THREAD_PROCESS_SHARED
puts ("_POSIX_THREAD_PROCESS_SHARED not supported, test skipped");
#else
size_t ps = sysconf (_SC_PAGESIZE);
char tmpfname[] = "/tmp/tst-spin2.XXXXXX";
char data[ps];
@ -157,7 +151,6 @@ do_test (void)
puts ("parent done");
}
#endif
return 0;
}

View File

@ -32,7 +32,7 @@ vpath %.c ../locale/programs
nscd-modules := nscd connections pwdcache getpwnam_r getpwuid_r grpcache \
getgrnam_r getgrgid_r hstcache gethstbyad_r gethstbynm2_r \
dbg_log nscd_conf nscd_stat cache mem nscd_setup_thread \
xmalloc xstrdup aicache initgrcache
xmalloc xstrdup aicache initgrcache gai
ifeq ($(have-thread-library),yes)
@ -96,11 +96,16 @@ CFLAGS-nscd_setup_thread.c += $(nscd-cflags)
CFLAGS-aicache.c += $(nscd-cflags)
CFLAGS-selinux.c += $(nscd-cflags)
CFLAGS-initgrcache.c += $(nscd-cflags)
CFLAGS-gai.c += $(nscd-cflags)
ifeq (yesyes,$(have-fpie)$(build-shared))
ifeq (yes,$(have-z-relro))
relro-LDFLAGS += -Wl,-z,now
endif
$(objpfx)nscd: $(addprefix $(objpfx),$(nscd-modules:=.o))
$(LINK.o) -pie -Wl,-O1 \
$(sysdep-LDFLAGS) $(config-LDFLAGS) \
$(sysdep-LDFLAGS) $(config-LDFLAGS) $(relro-LDFLAGS) \
$(extra-B-$(@F:lib%.so=%).so) -B$(csu-objpfx) \
$(extra-B-$(@F:lib%.so=%).so) $(load-map-file) \
$(LDFLAGS) $(LDFLAGS-$(@F)) \

View File

@ -21,6 +21,7 @@
#include <alloca.h>
#include <assert.h>
#include <atomic.h>
#include <dlfcn.h>
#include <error.h>
#include <errno.h>
#include <fcntl.h>
@ -42,6 +43,7 @@
#include <sys/socket.h>
#include <sys/stat.h>
#include <sys/un.h>
#include <gnu/lib-names.h>
#include "nscd.h"
#include "dbg_log.h"
@ -1455,12 +1457,39 @@ start_threads (void)
pthread_condattr_t condattr;
pthread_condattr_init (&condattr);
#if _POSIX_CLOCK_SELECTION >= 0 && _POSIX_MONOTONIC_CLOCK >= 0
#if defined _POSIX_MONOTONIC_CLOCK && _POSIX_MONOTONIC_CLOCK >= 0
/* Determine whether the monotonous clock is available. */
struct timespec dummy;
if (clock_getres (CLOCK_MONOTONIC, &dummy) == 0
&& pthread_condattr_setclock (&condattr, CLOCK_MONOTONIC) == 0)
timeout_clock = CLOCK_MONOTONIC;
# if _POSIX_MONOTONIC_CLOCK == 0
if (sysconf (_SC_MONOTONIC_CLOCK) > 0)
# endif
{
# if defined _POSIX_CLOCK_SELECTION && _POSIX_CLOCK_SELECTION >= 0
# if _POSIX_CLOCK_SELECTION == 0
if (sysconf (_SC_CLOCK_SELECTION) > 0)
# endif
if (clock_getres (CLOCK_MONOTONIC, &dummy) == 0
&& pthread_condattr_setclock (&condattr, CLOCK_MONOTONIC) == 0)
timeout_clock = CLOCK_MONOTONIC;
# elif _POSIX_THREADS > 0
if (sysconf (_SC_CLOCK_SELECTION) > 0)
{
void *h = __libc_dlopen (LIBPTHREAD_SO);
int (*condattr_setclock) (pthread_condattr_t *, __clockid_t) = NULL;
if (h != NULL)
condattr_setclock = __libc_dlsym (h, "pthread_condattr_setclock");
if (condattr_setclock
&& clock_getres (CLOCK_MONOTONIC, &dummy) == 0
&& condattr_setclock (&condattr, CLOCK_MONOTONIC) == 0)
timeout_clock = CLOCK_MONOTONIC;
if (h != NULL)
__libc_dlclose (h);
}
# endif
}
#endif
pthread_cond_init (&readylist_cond, &condattr);

25
nscd/gai.c Normal file
View File

@ -0,0 +1,25 @@
/* This file uses the getaddrinfo code but it compiles it without NSCD
support. We just need a few symbol renames. */
#define __getservbyname_r getservbyname_r
#define __inet_aton inet_aton
#define __getsockname getsockname
#define __socket socket
#define __recvmsg recvmsg
#define __bind bind
#define __sendto sendto
#define __strchrnul strchrnul
#include <getaddrinfo.c>
/* Support code. */
#include <check_pf.c>
#ifdef HAVE_LIBIDN
# include <libidn/idn-stub.c>
#endif
/* Some variables normally defined in libc. */
service_user *__nss_hosts_database;
#if defined NEED_NETLINK && __ASSUME_NETLINK_SUPPORT == 0
int __no_netlink_support attribute_hidden;
#endif

View File

@ -510,16 +510,3 @@ write_pid (const char *file)
return 0;
}
/* This is an ugly hack which prevents getaddrinfo from being dragged
into nscd. There currently is no special getaddrinfo version for
use in nscd. In case it should be necessary such a version must be
created and this dummy version should be removed. */
extern void getaddrinfo (void) __attribute ((visibility ("hidden")));
void
getaddrinfo (void)
{
abort ();
}

View File

@ -22,24 +22,32 @@
#include <dl-sysdep.h>
#undef errno
#if USE___THREAD
#if RTLD_PRIVATE_ERRNO
/* Code compiled for rtld refers only to this name. */
int rtld_errno attribute_hidden;
#elif USE___THREAD
__thread int errno;
extern __thread int __libc_errno __attribute__ ((alias ("errno")))
attribute_hidden;
#else
/* This differs from plain `int errno;' in that it doesn't create
a common definition, but a plain symbol that resides in .bss,
which can have an alias. */
int errno __attribute__ ((section (".bss")));
int errno __attribute__ ((nocommon));
strong_alias (errno, _errno)
/* We declare these with compat_symbol so that they are not visible at
link time. Programs must use the accessor functions. RTLD is special,
since it's not exported from there at any time. */
# if defined HAVE_ELF && defined SHARED && defined DO_VERSIONING \
&& !RTLD_PRIVATE_ERRNO
# if defined HAVE_ELF && defined SHARED && defined DO_VERSIONING
# include <shlib-compat.h>
compat_symbol (libc, errno, errno, GLIBC_2_0);
compat_symbol (libc, _errno, _errno, GLIBC_2_0);
# endif
#endif

View File

@ -95,17 +95,29 @@ init_has_cmpxchg (void) \
# define __arch_compare_and_exchange_val_16_acq(mem, newval, oldval) \
({ __typeof (*mem) ret; \
if (__builtin_expect (has_cmpxchg, 1)) \
__asm __volatile (LOCK_PREFIX "cmpxchgw %w2, %1" \
: "=a" (ret), "=m" (*mem) \
: "r" (newval), "m" (*mem), "0" (oldval)); \
__asm __volatile (LOCK_PREFIX "cmpxchgw %w2, %1" \
: "=a" (ret), "=m" (*mem) \
: "r" (newval), "m" (*mem), "0" (oldval)); \
else \
{ \
ret = *mem; \
if (ret == oldval) \
*mem = (newval); \
} \
ret; })
# define __arch_compare_and_exchange_val_32_acq(mem, newval, oldval) \
({ __typeof (*mem) ret; \
if (__builtin_expect (has_cmpxchg, 1)) \
__asm __volatile (LOCK_PREFIX "cmpxchgl %2, %1" \
: "=a" (ret), "=m" (*mem) \
: "r" (newval), "m" (*mem), "0" (oldval)); \
__asm __volatile (LOCK_PREFIX "cmpxchgl %2, %1" \
: "=a" (ret), "=m" (*mem) \
: "r" (newval), "m" (*mem), "0" (oldval)); \
else \
{ \
ret = *mem; \
if (ret == oldval) \
*mem = (newval); \
} \
ret; })
/* XXX We do not really need 64-bit compare-and-exchange. At least

View File

@ -82,7 +82,7 @@
#if RTLD_PRIVATE_ERRNO
# define SYSCALL_ERROR_LABEL $syscall_error
# define SYSCALL_ERROR_HANDLER \
stl v0, errno(gp) !gprel; \
stl v0, rtld_errno(gp) !gprel; \
lda v0, -1; \
ret
#elif defined(PIC)

View File

@ -1,4 +1,4 @@
/* Copyright (C) 1991, 92, 93, 94, 95, 96, 97, 2000, 2002
/* Copyright (C) 1991, 92, 93, 94, 95, 96, 97, 2000, 2002, 2004
Free Software Foundation, Inc.
This file is part of the GNU C Library.
@ -68,7 +68,7 @@ notb:
popl %ebx
movl %eax, %gs:0(%ecx)
# elif RTLD_PRIVATE_ERRNO
movl %eax, C_SYMBOL_NAME(errno@GOTOFF)(%ebx)
movl %eax, C_SYMBOL_NAME(rtld_errno@GOTOFF)(%ebx)
/* Pop %ebx value saved before jumping here. */
popl %ebx

View File

@ -153,4 +153,5 @@ endif
ifeq ($(subdir),nscd)
CFLAGS-connections.c += -DHAVE_EPOLL
CFLAGS-gai.c += -DNEED_NETLINK
endif

View File

@ -21,7 +21,7 @@
#include <stdbool.h>
#include <stdlib.h>
#include <unistd.h>
#include <hp-timing.h>
static long int linux_sysconf (int name);
@ -319,16 +319,9 @@ handle_amd (int name)
}
/* Get the value of the system variable NAME. */
long int
__sysconf (int name)
static int
i386_i486_test (void)
{
/* We only handle the cache information here (for now). */
if (name < _SC_LEVEL1_ICACHE_SIZE || name > _SC_LEVEL4_CACHE_LINESIZE)
return linux_sysconf (name);
/* Recognize i386 and compatible. These don't have any cache on
board. */
int eflags;
int ac;
asm volatile ("pushfl;\n\t"
@ -343,6 +336,35 @@ __sysconf (int name)
"pushl %0;\n\t"
"popfl"
: "=r" (eflags), "=r" (ac));
return ac;
}
/* Get the value of the system variable NAME. */
long int
__sysconf (int name)
{
if (name == _SC_CPUTIME || name == _SC_THREAD_CPUTIME)
{
#if HP_TIMING_AVAIL
// XXX We can add here test for machines which cannot support a
// XXX usable TSC.
return 200112L;
#else
return -1;
#endif
}
/* All the remainder, except the cache information, is handled in
the generic code. */
if (name < _SC_LEVEL1_ICACHE_SIZE || name > _SC_LEVEL4_CACHE_LINESIZE)
return linux_sysconf (name);
/* Recognize i386 and compatible. These don't have any cache on
board. */
int ac = i386_i486_test ();
if (ac == 0)
/* This is an i386. */
// XXX Is this true for all brands?

View File

@ -136,7 +136,7 @@ __i686.get_pc_thunk.reg: \
addl $_GLOBAL_OFFSET_TABLE_, %ecx; \
xorl %edx, %edx; \
subl %eax, %edx; \
movl %edx, errno@GOTOFF(%ecx); \
movl %edx, rtld_errno@GOTOFF(%ecx); \
orl $-1, %eax; \
jmp L(pseudo_end);

View File

@ -2,6 +2,7 @@ clone.S
clone2.S
dl-brk.S
dl-static.c
has_cpuclock.c
ioperm.c
ldd-rewrite.sed
__start_context.S

View File

@ -1,4 +1,4 @@
/* Copyright (C) 2000, 2001, 2003 Free Software Foundation, Inc.
/* Copyright (C) 2000, 2001, 2003, 2004 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
@ -24,6 +24,9 @@
#include <fcntl.h>
#include "has_cpuclock.c"
int
clock_getcpuclockid (pid_t pid, clockid_t *clock_id)
{
@ -31,30 +34,9 @@ clock_getcpuclockid (pid_t pid, clockid_t *clock_id)
if (pid != 0 && pid != getpid ())
return EPERM;
static int itc_usable;
int retval = ENOENT;
if (__builtin_expect (itc_usable == 0, 0))
{
int newval = 1;
int fd = open ("/proc/sal/itc_drift", O_RDONLY);
if (__builtin_expect (fd != -1, 1))
{
char buf[16];
/* We expect the file to contain a single digit followed by
a newline. If the format changes we better not rely on
the file content. */
if (read (fd, buf, sizeof buf) != 2 || buf[0] != '0'
|| buf[1] != '\n')
newval = -1;
close (fd);
}
itc_usable = newval;
}
if (itc_usable > 0)
if (has_cpuclock () > 0)
{
/* Store the number. */
*clock_id = CLOCK_PROCESS_CPUTIME_ID;

View File

@ -0,0 +1,52 @@
/* Copyright (C) 2000, 2001, 2003, 2004 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
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
The GNU C Library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, write to the Free
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
02111-1307 USA. */
#include <errno.h>
#include <fcntl.h>
#include <unistd.h>
#include <sys/stat.h>
#include <sys/types.h>
static int itc_usable;
static int
has_cpuclock (void)
{
if (__builtin_expect (itc_usable == 0, 0))
{
int newval = 1;
int fd = open ("/proc/sal/itc_drift", O_RDONLY);
if (__builtin_expect (fd != -1, 1))
{
char buf[16];
/* We expect the file to contain a single digit followed by
a newline. If the format changes we better not rely on
the file content. */
if (read (fd, buf, sizeof buf) != 2 || buf[0] != '0'
|| buf[1] != '\n')
newval = -1;
close (fd);
}
itc_usable = newval;
}
return itc_usable;
}

View File

@ -0,0 +1,45 @@
/* Get file-specific information about a file. Linux version.
Copyright (C) 2003, 2004 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
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
The GNU C Library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with the GNU C Library; if not, write to the Free
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
02111-1307 USA. */
#include <assert.h>
#include <stdbool.h>
#include <stdlib.h>
#include <unistd.h>
#include "has_cpuclock.c"
static long int linux_sysconf (int name);
/* Get the value of the system variable NAME. */
long int
__sysconf (int name)
{
if (name == _SC_CPUTIME || name == _SC_THREAD_CPUTIME)
return has_cpuclock () ? 200112L : -1;
/* Everything else is handled by the more general code. */
return linux_sysconf (name);
}
/* Now the generic Linux version. */
#undef __sysconf
#define __sysconf static linux_sysconf
#include "../sysconf.c"

View File

@ -30,7 +30,7 @@ ENTRY(__syscall_error)
* be fine. Otherwise, we would have to first load the global
* pointer register from __gp.
*/
addl r2=@gprel(errno),gp
addl r2=@gprel(rtld_errno),gp
;;
st4 [r2]=r8
mov r8=-1

View File

@ -98,7 +98,7 @@
# if RTLD_PRIVATE_ERRNO
# define SYSCALL_ERROR_HANDLER \
SYSCALL_ERROR_LABEL: \
lea (errno, %pc), %a0; \
lea (rtld_errno, %pc), %a0; \
neg.l %d0; \
move.l %d0, (%a0); \
move.l &-1, %d0; \

View File

@ -82,7 +82,7 @@ ENTRY(__syscall_error)
st %r2,0(%r1)
lhi %r2,-1
br %r14
1: .long errno - 0b
1: .long rtld_errno - 0b
# elif USE___THREAD
# ifndef NOT_IN_libc
# define SYSCALL_ERROR_ERRNO __libc_errno

View File

@ -97,7 +97,7 @@
st %r2,0(%r1); \
lhi %r2,-1; \
br %r14; \
2: .long errno-1b
2: .long rtld_errno-1b
# elif defined _LIBC_REENTRANT
# if USE___THREAD
# ifndef NOT_IN_libc

View File

@ -74,7 +74,7 @@ ENTRY(__syscall_error)
#endif
#else
# if RTLD_PRIVATE_ERRNO
larl %r1,errno
larl %r1,rtld_errno
lcr %r2,%r2
st %r2,0(%r1)
lghi %r2,-1
@ -100,7 +100,7 @@ ENTRY(__syscall_error)
lcr %r2,%r2
st %r2,0(%r1)
lghi %r2,-1
br %r14
br %r14
# else
stmg %r13,%r15,104(%r15)
cfi_offset (%r15,-40)

View File

@ -101,7 +101,7 @@
# if RTLD_PRIVATE_ERRNO
# define SYSCALL_ERROR_LABEL 0f
# define SYSCALL_ERROR_HANDLER \
0: larl %r1,errno; \
0: larl %r1,rtld_errno; \
lcr %r2,%r2; \
st %r2,0(%r1); \
lghi %r2,-1; \

View File

@ -1,5 +1,5 @@
/* Copyright (C) 1992, 1993, 1995, 1996, 1997, 1998, 1999, 2000, 2002,
2003, 2004 Free Software Foundation, Inc.
/* Copyright (C) 1992,1993,1995,1996,1997,1998,1999,2000,2002,2003,2004
Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper, <drepper@gnu.ai.mit.edu>, August 1995.
Changed by Kaz Kojima, <kkojima@rr.iij4u.or.jp>.
@ -109,7 +109,7 @@
mov _IMM1,r0; \
.align 2; \
0: .long _GLOBAL_OFFSET_TABLE_; \
1: .long errno@GOTOFF
1: .long rtld_errno@GOTOFF
# elif defined _LIBC_REENTRANT

View File

@ -83,7 +83,7 @@ SYSCALL_ERROR_HANDLER_ENTRY(__syscall_error_handler) \
sethi %hi(_GLOBAL_OFFSET_TABLE_-4), %l7; \
call __sparc_get_pic_l7; \
add %l7, %lo(_GLOBAL_OFFSET_TABLE_+4), %l7; \
ld [%l7 + errno], %l0; \
ld [%l7 + rtld_errno], %l0; \
st %i0, [%l0]; \
jmpl %i7+8, %g0; \
restore %g0, -1, %o0; \

View File

@ -118,7 +118,7 @@
#elif RTLD_PRIVATE_ERRNO
# define SYSCALL_ERROR_HANDLER \
0: \
leaq errno(%rip), %rcx; \
leaq rtld_errno(%rip), %rcx; \
xorq %rdx, %rdx; \
subq %rax, %rdx; \
movl %edx, (%rcx); \

View File

@ -67,7 +67,7 @@ notb:
# endif
#else
# if RTLD_PRIVATE_ERRNO
leaq errno(%rip), %rcx
leaq rtld_errno(%rip), %rcx
movl %eax, (%rcx)
# elif !defined _LIBC_REENTRANT
movq C_SYMBOL_NAME(errno)@GOTPCREL(%rip), %rcx