mirror of
https://sourceware.org/git/glibc.git
synced 2024-11-11 07:40:05 +00:00
* sysdeps/mach/hurd/Versions [libc] (GLIBC_2.1.1): Remove __libc_clk_tck. * sysdeps/mach/hurd/Makefile [$(subdir)==posix] (sysdep_routines): Remove clk_tck. * sysdeps/mach/hurd/clk_tck.c: Removed. * sysdeps/mach/hurd/getclktck.c: New file. * sysdeps/mach/hurd/setitimer.c (quantize_timeval): Use __getclktck instead of __libc_clk_tck. * sysdeps/mach/hurd/bits/time.h: Use __sysconf for CLK_TCK instead of __libc_clk_tck. * sysdeps/mach/hurd/i386/bits/time.h: Likewise.
2000-11-04 Mark Kettenis <kettenis@gnu.org> * sysdeps/mach/hurd/Versions [libc] (GLIBC_2.1.1): Remove __libc_clk_tck. * sysdeps/mach/hurd/Makefile [$(subdir)==posix] (sysdep_routines): Remove clk_tck. * sysdeps/mach/hurd/clk_tck.c: Removed. * sysdeps/mach/hurd/getclktck.c: New file. * sysdeps/mach/hurd/setitimer.c (quantize_timeval): Use __getclktck instead of __libc_clk_tck. * sysdeps/mach/hurd/bits/time.h: Use __sysconf for CLK_TCK instead of __libc_clk_tck. * sysdeps/mach/hurd/i386/bits/time.h: Likewise.
This commit is contained in:
parent
d2830ba4cc
commit
f3975fff5c
14
ChangeLog
14
ChangeLog
@ -1,3 +1,17 @@
|
||||
2000-11-04 Mark Kettenis <kettenis@gnu.org>
|
||||
|
||||
* sysdeps/mach/hurd/Versions [libc] (GLIBC_2.1.1): Remove
|
||||
__libc_clk_tck.
|
||||
* sysdeps/mach/hurd/Makefile [$(subdir)==posix] (sysdep_routines):
|
||||
Remove clk_tck.
|
||||
* sysdeps/mach/hurd/clk_tck.c: Removed.
|
||||
* sysdeps/mach/hurd/getclktck.c: New file.
|
||||
* sysdeps/mach/hurd/setitimer.c (quantize_timeval): Use
|
||||
__getclktck instead of __libc_clk_tck.
|
||||
* sysdeps/mach/hurd/bits/time.h: Use __sysconf for CLK_TCK instead
|
||||
of __libc_clk_tck.
|
||||
* sysdeps/mach/hurd/i386/bits/time.h: Likewise.
|
||||
|
||||
2000-11-03 Ulrich Drepper <drepper@redhat.com>
|
||||
|
||||
* posix/Versions: Export __sysconf.
|
||||
|
@ -183,10 +183,6 @@ ifeq (hurd, $(subdir))
|
||||
sysdep_routines += cthreads
|
||||
endif
|
||||
|
||||
ifeq (posix, $(subdir))
|
||||
sysdep_routines += clk_tck
|
||||
endif
|
||||
|
||||
ifeq ($(subdir),sunrpc)
|
||||
sysdep_headers += nfs/nfs.h
|
||||
endif
|
||||
|
@ -3,10 +3,6 @@ libc {
|
||||
# functions with a weak definition in the dynamic linker
|
||||
__getcwd; __mmap;
|
||||
}
|
||||
GLIBC_2.1.1 {
|
||||
# functions used in inline functions or macros
|
||||
__libc_clk_tck;
|
||||
}
|
||||
}
|
||||
|
||||
ld {
|
||||
|
@ -35,10 +35,10 @@
|
||||
|
||||
# ifndef __STRICT_ANSI__
|
||||
/* Even though CLOCKS_PER_SEC has such a strange value CLK_TCK
|
||||
presents the real value for clock ticks per second for the system.
|
||||
This value is determined at runtime. */
|
||||
# define CLK_TCK __libc_clk_tck()
|
||||
extern int __libc_clk_tck (void) __attribute__ ((__const__));
|
||||
presents the real value for clock ticks per second for the system. */
|
||||
# include <bits/types.h>
|
||||
extern long int __sysconf (int);
|
||||
# define CLK_TCK ((__clock_t) __sysconf (2)) /* 2 is _SC_CLK_TCK */
|
||||
# endif
|
||||
|
||||
# ifdef __USE_POSIX199309
|
||||
|
@ -1,5 +1,5 @@
|
||||
/* Return run-time value of CLK_TCK for Hurd.
|
||||
Copyright (C) 1999 Free Software Foundation, Inc.
|
||||
Copyright (C) 1999, 2000 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
|
||||
@ -20,11 +20,17 @@
|
||||
#include <errno.h>
|
||||
#include <time.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include <mach.h>
|
||||
#include <mach/host_info.h>
|
||||
|
||||
#ifndef SYSTEM_CLK_TCK
|
||||
# define SYSTEM_CLK_TCK 100
|
||||
#endif
|
||||
|
||||
/* Return frequency of times(). */
|
||||
int
|
||||
__libc_clk_tck ()
|
||||
__getclktck ()
|
||||
{
|
||||
struct host_sched_info hsi;
|
||||
mach_msg_type_number_t count;
|
||||
@ -34,7 +40,16 @@ __libc_clk_tck ()
|
||||
err = __host_info (__mach_task_self (), HOST_SCHED_INFO,
|
||||
(host_info_t) &hsi, &count);
|
||||
if (err)
|
||||
return 100;
|
||||
return SYSTEM_CLK_TCK;
|
||||
|
||||
return hsi.min_quantum;
|
||||
}
|
||||
|
||||
/* Before glibc 2.2, the Hurd actually did this differently, so we
|
||||
need to keep a compatibility symbol. */
|
||||
|
||||
#include <shlib-compat.h>
|
||||
|
||||
#if SHLIB_COMPAT (libc, GLIBC_2_1_1, GLIBC_2_2)
|
||||
compat_symbol (libc, __getclktck, __libc_clk_tck, GLIBC_2_1_1);
|
||||
#endif
|
@ -35,10 +35,10 @@
|
||||
|
||||
# ifndef __STRICT_ANSI__
|
||||
/* Even though CLOCKS_PER_SEC has such a strange value CLK_TCK
|
||||
presents the real value for clock ticks per second for the system.
|
||||
This value is determined at runtime. */
|
||||
# define CLK_TCK __libc_clk_tck()
|
||||
extern int __libc_clk_tck (void) __attribute__ ((__const__));
|
||||
presents the real value for clock ticks per second for the system. */
|
||||
# include <bits/types.h>
|
||||
extern long int __sysconf (int);
|
||||
# define CLK_TCK ((__clock_t) __sysconf (2)) /* 2 is _SC_CLK_TCK */
|
||||
# endif
|
||||
|
||||
# ifdef __USE_POSIX199309
|
||||
|
@ -42,7 +42,7 @@ quantize_timeval (struct timeval *tv)
|
||||
static time_t quantum = -1;
|
||||
|
||||
if (quantum == -1)
|
||||
quantum = 1000000 / __libc_clk_tck ();
|
||||
quantum = 1000000 / __getclktck ();
|
||||
|
||||
tv->tv_usec = ((tv->tv_usec + (quantum - 1)) / quantum) * quantum;
|
||||
if (tv->tv_usec >= 1000000)
|
||||
|
Loading…
Reference in New Issue
Block a user