mirror of
https://sourceware.org/git/glibc.git
synced 2025-07-29 11:41:21 +03:00
sysconf on Linux/ia64 reported outdate versions for some options
The code is also cleaned up to avoid inefficiencies.
This commit is contained in:
@ -1,5 +1,12 @@
|
|||||||
2011-05-15 Ulrich Drepper <drepper@gmail.com>
|
2011-05-15 Ulrich Drepper <drepper@gmail.com>
|
||||||
|
|
||||||
|
[BZ #10157]
|
||||||
|
* sysdeps/unix/sysv/linux/sysconf.c (__sysconf): Split out CPUTIME
|
||||||
|
tests into ...
|
||||||
|
(has_cpuclock): ...this. New function.
|
||||||
|
* sysdeps/unix/sysv/linux/ia64/sysconf.c: Just define HAS_CPUCLOCK
|
||||||
|
macro here based on has_cpuclock code.
|
||||||
|
|
||||||
[BZ #10149]
|
[BZ #10149]
|
||||||
* sysdeps/unix/sysv/linux/dl-osinfo.h (_dl_setup_stack_chk_guard):
|
* sysdeps/unix/sysv/linux/dl-osinfo.h (_dl_setup_stack_chk_guard):
|
||||||
First byte (not low byte) is now always NUL.
|
First byte (not low byte) is now always NUL.
|
||||||
|
14
NEWS
14
NEWS
@ -9,13 +9,13 @@ Version 2.14
|
|||||||
|
|
||||||
* The following bugs are resolved with this release:
|
* The following bugs are resolved with this release:
|
||||||
|
|
||||||
386, 9809, 10149, 11257, 11258, 11487, 11532, 11578, 11653, 11668, 11724,
|
386, 9809, 10149, 10157, 11257, 11258, 11487, 11532, 11578, 11653, 11668,
|
||||||
11901, 11945, 11947, 11952, 12052, 12083, 12158, 12178, 12200, 12346,
|
11724, 11901, 11945, 11947, 11952, 12052, 12083, 12158, 12178, 12200,
|
||||||
12393, 12420, 12432, 12445, 12449, 12453, 12454, 12460, 12469, 12489,
|
12346, 12393, 12420, 12432, 12445, 12449, 12453, 12454, 12460, 12469,
|
||||||
12509, 12510, 12511, 12518, 12527, 12541, 12545, 12551, 12582, 12583,
|
12489, 12509, 12510, 12511, 12518, 12527, 12541, 12545, 12551, 12582,
|
||||||
12587, 12597, 12601, 12611, 12625, 12626, 12631, 12650, 12653, 12655,
|
12583, 12587, 12597, 12601, 12611, 12625, 12626, 12631, 12650, 12653,
|
||||||
12660, 12681, 12685, 12711, 12713, 12714, 12717, 12723, 12724, 12734,
|
12655, 12660, 12681, 12685, 12711, 12713, 12714, 12717, 12723, 12724,
|
||||||
12738
|
12734, 12738
|
||||||
|
|
||||||
* The RPC implementation in libc is obsoleted. Old programs keep working
|
* The RPC implementation in libc is obsoleted. Old programs keep working
|
||||||
but new programs cannot be linked with the routines in libc anymore.
|
but new programs cannot be linked with the routines in libc anymore.
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/* Get file-specific information about a file. Linux version.
|
/* Get file-specific information about a file. Linux/ia64 version.
|
||||||
Copyright (C) 2003, 2004 Free Software Foundation, Inc.
|
Copyright (C) 2003, 2004, 2011 Free Software Foundation, Inc.
|
||||||
This file is part of the GNU C Library.
|
This file is part of the GNU C Library.
|
||||||
|
|
||||||
The GNU C Library is free software; you can redistribute it and/or
|
The GNU C Library is free software; you can redistribute it and/or
|
||||||
@ -24,22 +24,8 @@
|
|||||||
|
|
||||||
|
|
||||||
#include "has_cpuclock.c"
|
#include "has_cpuclock.c"
|
||||||
|
#define HAS_CPUCLOCK() (has_cpuclock () ? _POSIX_VERSION : -1)
|
||||||
|
|
||||||
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. */
|
/* Now the generic Linux version. */
|
||||||
#undef __sysconf
|
|
||||||
#define __sysconf static linux_sysconf
|
|
||||||
#include "../sysconf.c"
|
#include "../sysconf.c"
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/* Get file-specific information about a file. Linux version.
|
/* Get file-specific information about a file. Linux version.
|
||||||
Copyright (C) 2003, 2004, 2006, 2008, 2009 Free Software Foundation, Inc.
|
Copyright (C) 2003,2004,2006 2008,2009,2011 Free Software Foundation, Inc.
|
||||||
This file is part of the GNU C Library.
|
This file is part of the GNU C Library.
|
||||||
|
|
||||||
The GNU C Library is free software; you can redistribute it and/or
|
The GNU C Library is free software; you can redistribute it and/or
|
||||||
@ -35,6 +35,34 @@
|
|||||||
static long int posix_sysconf (int name);
|
static long int posix_sysconf (int name);
|
||||||
|
|
||||||
|
|
||||||
|
#ifndef HAS_CPUCLOCK
|
||||||
|
static long int
|
||||||
|
has_cpuclock (void)
|
||||||
|
{
|
||||||
|
# if defined __NR_clock_getres || HP_TIMING_AVAIL
|
||||||
|
/* If we have HP_TIMING, we will fall back on that if the system
|
||||||
|
call does not work, so we support it either way. */
|
||||||
|
# if !HP_TIMING_AVAIL
|
||||||
|
/* Check using the clock_getres system call. */
|
||||||
|
struct timespec ts;
|
||||||
|
INTERNAL_SYSCALL_DECL (err);
|
||||||
|
int r = INTERNAL_SYSCALL (clock_getres, err, 2,
|
||||||
|
(name == _SC_CPUTIME
|
||||||
|
? CLOCK_PROCESS_CPUTIME_ID
|
||||||
|
: CLOCK_THREAD_CPUTIME_ID),
|
||||||
|
&ts);
|
||||||
|
if (INTERNAL_SYSCALL_ERROR_P (r, err))
|
||||||
|
return -1;
|
||||||
|
# endif
|
||||||
|
return _POSIX_VERSION;
|
||||||
|
# else
|
||||||
|
return -1;
|
||||||
|
# endif
|
||||||
|
}
|
||||||
|
# define HAS_CPUCLOCK() has_cpuclock ()
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
/* Get the value of the system variable NAME. */
|
/* Get the value of the system variable NAME. */
|
||||||
long int
|
long int
|
||||||
__sysconf (int name)
|
__sysconf (int name)
|
||||||
@ -56,27 +84,9 @@ __sysconf (int name)
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined __NR_clock_getres || HP_TIMING_AVAIL
|
|
||||||
case _SC_CPUTIME:
|
case _SC_CPUTIME:
|
||||||
case _SC_THREAD_CPUTIME:
|
case _SC_THREAD_CPUTIME:
|
||||||
{
|
return HAS_CPUCLOCK ();
|
||||||
/* If we have HP_TIMING, we will fall back on that if the system
|
|
||||||
call does not work, so we support it either way. */
|
|
||||||
# if !HP_TIMING_AVAIL
|
|
||||||
/* Check using the clock_getres system call. */
|
|
||||||
struct timespec ts;
|
|
||||||
INTERNAL_SYSCALL_DECL (err);
|
|
||||||
int r = INTERNAL_SYSCALL (clock_getres, err, 2,
|
|
||||||
(name == _SC_CPUTIME
|
|
||||||
? CLOCK_PROCESS_CPUTIME_ID
|
|
||||||
: CLOCK_THREAD_CPUTIME_ID),
|
|
||||||
&ts);
|
|
||||||
if (INTERNAL_SYSCALL_ERROR_P (r, err))
|
|
||||||
return -1;
|
|
||||||
# endif
|
|
||||||
return _POSIX_VERSION;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
case _SC_ARG_MAX:
|
case _SC_ARG_MAX:
|
||||||
#if __LINUX_KERNEL_VERSION < 0x020617
|
#if __LINUX_KERNEL_VERSION < 0x020617
|
||||||
|
Reference in New Issue
Block a user