mirror of
https://sourceware.org/git/glibc.git
synced 2025-01-05 01:00:14 +00:00
Update.
* sysdeps/unix/sysv/linux/i386/get_clockfreq.c (__get_clockfreq): Handle kernels which report only three digits after the decimal point. Reported by Van Okamura <van.okamura@oracle.com>.
This commit is contained in:
parent
ddad941ea4
commit
0160829281
@ -1,5 +1,9 @@
|
|||||||
2001-04-17 Ulrich Drepper <drepper@redhat.com>
|
2001-04-17 Ulrich Drepper <drepper@redhat.com>
|
||||||
|
|
||||||
|
* sysdeps/unix/sysv/linux/i386/get_clockfreq.c (__get_clockfreq):
|
||||||
|
Handle kernels which report only three digits after the decimal point.
|
||||||
|
Reported by Van Okamura <van.okamura@oracle.com>.
|
||||||
|
|
||||||
* sysdeps/alpha/fpu/libm-test-ulps: Adjust error values for atan2f.
|
* sysdeps/alpha/fpu/libm-test-ulps: Adjust error values for atan2f.
|
||||||
|
|
||||||
2001-04-17 David S. Miller <davem@redhat.com>
|
2001-04-17 David S. Miller <davem@redhat.com>
|
||||||
|
@ -770,8 +770,8 @@ idouble: 1
|
|||||||
ifloat: 2
|
ifloat: 2
|
||||||
|
|
||||||
Function: "atan2":
|
Function: "atan2":
|
||||||
float: 3
|
float: 4
|
||||||
ifloat: 3
|
ifloat: 4
|
||||||
|
|
||||||
Function: "atanh":
|
Function: "atanh":
|
||||||
double: 1
|
double: 1
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/* Get frequency of the system processor. i386/Linux version.
|
/* Get frequency of the system processor. i386/Linux version.
|
||||||
Copyright (C) 2000 Free Software Foundation, Inc.
|
Copyright (C) 2000, 2001 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
|
||||||
@ -30,6 +30,8 @@ __get_clockfreq (void)
|
|||||||
/* We read the information from the /proc filesystem. It contains at
|
/* We read the information from the /proc filesystem. It contains at
|
||||||
least one line like
|
least one line like
|
||||||
cpu MHz : 497.840237
|
cpu MHz : 497.840237
|
||||||
|
or also
|
||||||
|
cpu MHz : 497.841
|
||||||
We search for this line and convert the number in an integer. */
|
We search for this line and convert the number in an integer. */
|
||||||
static unsigned long long int result;
|
static unsigned long long int result;
|
||||||
int fd;
|
int fd;
|
||||||
@ -54,6 +56,8 @@ __get_clockfreq (void)
|
|||||||
if (__builtin_expect (mhz != NULL, 1))
|
if (__builtin_expect (mhz != NULL, 1))
|
||||||
{
|
{
|
||||||
char *endp = buf + n;
|
char *endp = buf + n;
|
||||||
|
int seen_decpoint = 0;
|
||||||
|
int ndigits = 0;
|
||||||
|
|
||||||
/* Search for the beginning of the string. */
|
/* Search for the beginning of the string. */
|
||||||
while (mhz < endp && (*mhz < '0' || *mhz > '9') && *mhz != '\n')
|
while (mhz < endp && (*mhz < '0' || *mhz > '9') && *mhz != '\n')
|
||||||
@ -65,10 +69,18 @@ __get_clockfreq (void)
|
|||||||
{
|
{
|
||||||
result *= 10;
|
result *= 10;
|
||||||
result += *mhz - '0';
|
result += *mhz - '0';
|
||||||
|
if (seen_decpoint)
|
||||||
|
++ndigits;
|
||||||
}
|
}
|
||||||
|
else if (*mhz == '.')
|
||||||
|
seen_decpoint = 1;
|
||||||
|
|
||||||
++mhz;
|
++mhz;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Compensate for missing digits at the end. */
|
||||||
|
while (ndigits++ < 6)
|
||||||
|
result *= 10;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user