* 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>
|
2000-11-03 Ulrich Drepper <drepper@redhat.com>
|
||||||
|
|
||||||
* posix/Versions: Export __sysconf.
|
* posix/Versions: Export __sysconf.
|
||||||
|
|
|
@ -183,10 +183,6 @@ ifeq (hurd, $(subdir))
|
||||||
sysdep_routines += cthreads
|
sysdep_routines += cthreads
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ifeq (posix, $(subdir))
|
|
||||||
sysdep_routines += clk_tck
|
|
||||||
endif
|
|
||||||
|
|
||||||
ifeq ($(subdir),sunrpc)
|
ifeq ($(subdir),sunrpc)
|
||||||
sysdep_headers += nfs/nfs.h
|
sysdep_headers += nfs/nfs.h
|
||||||
endif
|
endif
|
||||||
|
|
|
@ -3,10 +3,6 @@ libc {
|
||||||
# functions with a weak definition in the dynamic linker
|
# functions with a weak definition in the dynamic linker
|
||||||
__getcwd; __mmap;
|
__getcwd; __mmap;
|
||||||
}
|
}
|
||||||
GLIBC_2.1.1 {
|
|
||||||
# functions used in inline functions or macros
|
|
||||||
__libc_clk_tck;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
ld {
|
ld {
|
||||||
|
|
|
@ -35,10 +35,10 @@
|
||||||
|
|
||||||
# ifndef __STRICT_ANSI__
|
# ifndef __STRICT_ANSI__
|
||||||
/* Even though CLOCKS_PER_SEC has such a strange value CLK_TCK
|
/* Even though CLOCKS_PER_SEC has such a strange value CLK_TCK
|
||||||
presents the real value for clock ticks per second for the system.
|
presents the real value for clock ticks per second for the system. */
|
||||||
This value is determined at runtime. */
|
# include <bits/types.h>
|
||||||
# define CLK_TCK __libc_clk_tck()
|
extern long int __sysconf (int);
|
||||||
extern int __libc_clk_tck (void) __attribute__ ((__const__));
|
# define CLK_TCK ((__clock_t) __sysconf (2)) /* 2 is _SC_CLK_TCK */
|
||||||
# endif
|
# endif
|
||||||
|
|
||||||
# ifdef __USE_POSIX199309
|
# ifdef __USE_POSIX199309
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/* Return run-time value of CLK_TCK for Hurd.
|
/* 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.
|
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
|
||||||
|
@ -20,11 +20,17 @@
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#include <time.h>
|
#include <time.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
|
|
||||||
#include <mach.h>
|
#include <mach.h>
|
||||||
#include <mach/host_info.h>
|
#include <mach/host_info.h>
|
||||||
|
|
||||||
|
#ifndef SYSTEM_CLK_TCK
|
||||||
|
# define SYSTEM_CLK_TCK 100
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* Return frequency of times(). */
|
||||||
int
|
int
|
||||||
__libc_clk_tck ()
|
__getclktck ()
|
||||||
{
|
{
|
||||||
struct host_sched_info hsi;
|
struct host_sched_info hsi;
|
||||||
mach_msg_type_number_t count;
|
mach_msg_type_number_t count;
|
||||||
|
@ -34,7 +40,16 @@ __libc_clk_tck ()
|
||||||
err = __host_info (__mach_task_self (), HOST_SCHED_INFO,
|
err = __host_info (__mach_task_self (), HOST_SCHED_INFO,
|
||||||
(host_info_t) &hsi, &count);
|
(host_info_t) &hsi, &count);
|
||||||
if (err)
|
if (err)
|
||||||
return 100;
|
return SYSTEM_CLK_TCK;
|
||||||
|
|
||||||
return hsi.min_quantum;
|
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__
|
# ifndef __STRICT_ANSI__
|
||||||
/* Even though CLOCKS_PER_SEC has such a strange value CLK_TCK
|
/* Even though CLOCKS_PER_SEC has such a strange value CLK_TCK
|
||||||
presents the real value for clock ticks per second for the system.
|
presents the real value for clock ticks per second for the system. */
|
||||||
This value is determined at runtime. */
|
# include <bits/types.h>
|
||||||
# define CLK_TCK __libc_clk_tck()
|
extern long int __sysconf (int);
|
||||||
extern int __libc_clk_tck (void) __attribute__ ((__const__));
|
# define CLK_TCK ((__clock_t) __sysconf (2)) /* 2 is _SC_CLK_TCK */
|
||||||
# endif
|
# endif
|
||||||
|
|
||||||
# ifdef __USE_POSIX199309
|
# ifdef __USE_POSIX199309
|
||||||
|
|
|
@ -42,7 +42,7 @@ quantize_timeval (struct timeval *tv)
|
||||||
static time_t quantum = -1;
|
static time_t quantum = -1;
|
||||||
|
|
||||||
if (quantum == -1)
|
if (quantum == -1)
|
||||||
quantum = 1000000 / __libc_clk_tck ();
|
quantum = 1000000 / __getclktck ();
|
||||||
|
|
||||||
tv->tv_usec = ((tv->tv_usec + (quantum - 1)) / quantum) * quantum;
|
tv->tv_usec = ((tv->tv_usec + (quantum - 1)) / quantum) * quantum;
|
||||||
if (tv->tv_usec >= 1000000)
|
if (tv->tv_usec >= 1000000)
|
||||||
|
|
Loading…
Reference in New Issue