* string/bits/string2.h (__strcpy_small): Fix a typo.
+1999-07-31 Ulrich Drepper <drepper@cygnus.com>
+
+ * sysdeps/i386/fpu/e_pow.S: Use addl %esp instead of pop.
+ * sysdeps/i386/fpu/e_powf.S: Likewise.
+ * sysdeps/i386/fpu/e_powl.S: Likewise. [PR libc/1213].
+
+ * sysdeps/generic/e_lgammal_r.c: Set *signgam to zero.
+ * sysdeps/generic/e_gammal_r.c: Likewise. [PR libc/1212].
+
+1999-07-30 Andreas Schwab <schwab@suse.de>
+
+ * sysdeps/unix/sysv/linux/getsysstats.c (GET_NPROCS_PARSER): New
+ definition.
+ (__get_nprocs): Use it.
+ (__get_nprocs_conf): Define as separate function if
+ GET_NPROCS_CONF_PARSER is defined.
+ * sysdeps/unix/sysv/linux/alpha/getsysstats.c: New file.
+
+ * include/sys/sysinfo.h: New file.
+ * sysdeps/generic/sys/sysinfo.h: Remove declaration of internal
+ interface.
+ * sysdeps/unix/sysv/linux/sys/sysinfo.h: Likewise.
+
+1999-07-30 Andreas Schwab <schwab@suse.de>
+
+ * Makerules: Put sysd-versions and Versions.all on
+ postclean-generated instead of common-generated.
+
+1999-07-29 Andreas Jaeger <aj@arthur.rhein-neckar.de>
+
+ * manual/time.texi (Basic CPU Time): Note that clock_t can wrap
+ around and CLOCKS_PER_SEC is 1e6.
+
+1999-07-29 Andreas Schwab <schwab@suse.de>
+
+ * misc/efgcvt.c (NDIGIT_MAX): Provide precomputed constants for
+ all floating point formats supported by gcc. Error out for
+ unhandled precisions.
+ * misc/efgcvt_r.c (NDIGIT_MAX): Likewise.
+ * misc/qefgcvt.c (NDIGIT_MAX): Likewise.
+ * misc/qefgcvt_r.c (NDIGIT_MAX): Likewise.
+
+1999-07-29 Ulrich Drepper <drepper@cygnus.com>
+
+ * sysdeps/generic/setenv.c: Move setenv code in new function
+ __add_to_environ. Add new parameter specifying already
+ constructed string for the environment.
+ (setenv): Call __add_to_environ with new parameter set to NULL.
+ (unsetenv): Really test all elements for duplicated name. Missed those
+ cases where the two are following each other.
+ * sysdeps/generic/putenv.c: Use __add_to_environ instead of setenv.
+ * include/stdlib.h: Add prototype of __add_to_environ.
+ * stdlib/tst-environ.c: New file.
+ * stdlib/Makefile (tests): Add tst-environ.
+
+ * sysdeps/i386/bits/string.h (__memset_cc): Fix typo in last patch.
+
+ * nis/nss_nis/nis-initgroups.c (_nss_nis_initgroups): Correct size
+ argument in realloc call.
+ * nis/nss_compat/compat-initgroups.c (_nss_compat_initgroups):
+ Likewise.
+ Reported by Danny Braniss <danny@cs.huji.ac.il>.
+
1999-07-28 Ulrich Drepper <drepper@cygnus.com>
* misc/efgcvt.c: Use IEEE 854 formula to compute the number of digits
ifeq ($(versioning),yes)
-include $(common-objpfx)sysd-versions
$(addprefix $(common-objpfx),$(version-maps)): $(common-objpfx)sysd-versions
-common-generated += $(version-maps) sysd-versions Versions.all
+common-generated += $(version-maps)
+postclean-generated += sysd-versions Versions.all
ifndef avoid-generated
ifneq ($(sysd-versions-subdirs),$(all-subdirs) $(config-sysdirs))
extern char *__realpath __P ((__const char *__name, char *__resolved));
extern int __ptsname_r __P ((int __fd, char *__buf, size_t __buflen));
extern int __getpt __P ((void));
+
+extern int __add_to_environ (const char *name, const char *value,
+ const char *combines, int replace);
#endif
#undef __Need_M_And_C
--- /dev/null
+#ifndef _SYS_SYSINFO_H
+#include_next <sys/sysinfo.h>
+
+/* Now we define the internal interface. */
+
+/* Return number of configured processors. */
+extern int __get_nprocs_conf __P ((void));
+
+/* Return number of available processors. */
+extern int __get_nprocs __P ((void));
+
+/* Return number of physical pages of memory in the system. */
+extern int __get_phys_pages __P ((void));
+
+/* Return number of available physical pages of memory in the system. */
+extern int __get_avphys_pages __P ((void));
+
+#endif /* sys/sysinfo.h */
such as arithmetic and printing work properly and consistently no matter
what the underlying representation is.
+Note that the clock can wrap around. On a 32bit system with
+@code{CLOCKS_PER_SEC} set to one million a wrap around happens after
+around 36 minutes.
+
@comment time.h
@comment ISO
@deftypevr Macro int CLOCKS_PER_SEC
The value of this macro is the number of clock ticks per second measured
-by the @code{clock} function.
+by the @code{clock} function. POSIX requires that this value is one
+million independend of the actual resolution.
@end deftypevr
@comment time.h
# define MAXDIG (NDIGIT_MAX + 3)
# if DBL_MANT_DIG == 53
# define NDIGIT_MAX 17
+# elif DBL_MANT_DIG == 24
+# define NDIGIT_MAX 9
+# elif DBL_MANT_DIG == 56
+# define NDIGIT_MAX 18
# else
-/* See IEEE 854 5.6, table 2 for this formula. */
+/* See IEEE 854 5.6, table 2 for this formula. Unfortunately we need a
+ compile time constant here, so we cannot use it. */
+# error "NDIGIT_MAX must be precomputed"
# define NDIGIT_MAX (lrint (ceil (M_LN2 / M_LN10 * DBL_MANT_DIG + 1.0)))
# endif
#endif
# define FLOAT_NAME_EXT
# if DBL_MANT_DIG == 53
# define NDIGIT_MAX 17
+# elif DBL_MANT_DIG == 24
+# define NDIGIT_MAX 9
+# elif DBL_MANT_DIG == 56
+# define NDIGIT_MAX 18
# else
-/* See IEEE 854 5.6, table 2 for this formula. */
+/* See IEEE 854 5.6, table 2 for this formula. Unfortunately we need a
+ compile time constant here, so we cannot use it. */
+# error "NDIGIT_MAX must be precomputed"
# define NDIGIT_MAX (lrint (ceil (M_LN2 / M_LN10 * DBL_MANT_DIG + 1.0)))
# endif
#endif
#define MAXDIG (NDIGIT_MAX + 12)
#if LDBL_MANT_DIG == 64
# define NDIGIT_MAX 21
+#elif LDBL_MANT_DIG == 53
+# define NDIGIT_MAX 17
+#elif LDBL_MANT_DIG == 113
+# define NDIGIT_MAX 36
+#elif LDBL_MANT_DIG == 56
+# define NDIGIT_MAX 18
#else
-/* See IEEE 854 5.6, table 2 for this formula. */
+/* See IEEE 854 5.6, table 2 for this formula. Unfortunately we need a
+ compile time constant here, so we cannot use it. */
+# error "NDIGIT_MAX must be precomputed"
# define NDIGIT_MAX (lrint (ceil (M_LN2 / M_LN10 * LDBL_MANT_DIG + 1.0)))
#endif
#define FLOAT_NAME_EXT l
#if LDBL_MANT_DIG == 64
# define NDIGIT_MAX 21
+#elif LDBL_MANT_DIG == 53
+# define NDIGIT_MAX 17
+#elif LDBL_MANT_DIG == 113
+# define NDIGIT_MAX 36
+#elif LDBL_MANT_DIG == 56
+# define NDIGIT_MAX 18
#else
-/* See IEEE 854 5.6, table 2 for this formula. */
+/* See IEEE 854 5.6, table 2 for this formula. Unfortunately we need a
+ compile time constant here, so we cannot use it. */
+# error "NDIGIT_MAX must be precomputed"
# define NDIGIT_MAX (lrint (ceil (M_LN2 / M_LN10 * LDBL_MANT_DIG + 1.0)))
#endif
-/* Copyright (C) 1998 Free Software Foundation, Inc.
+/* Copyright (C) 1998, 1999 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Thorsten Kukuk <kukuk@vt.uni-paderborn.de>, 1998.
if (*start == *size && limit <= 0)
{
/* Need a bigger buffer. */
- groups = realloc (groups, *size * sizeof (*groups));
+ groups = realloc (groups, 2 * *size * sizeof (*groups));
if (groups == NULL)
goto done;
*size *= 2;
-/* Copyright (C) 1998 Free Software Foundation, Inc.
+/* Copyright (C) 1998, 1999 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Thorsten Kukuk <kukuk@vt.uni-paderborn.de>, 1998.
if (*start == *size && limit <= 0)
{
/* Need a bigger buffer. */
- groups = realloc (groups, *size * sizeof (*groups));
+ groups = realloc (groups, 2 * *size * sizeof (*groups));
if (groups == NULL)
goto done;
*size *= 2;
long double
__ieee754_lgammal_r (long double x, int *signgamp)
{
+ *signgamp = 0;
fputs ("__ieee754_lgammal_r not implemented\n", stderr);
__set_errno (ENOSYS);
return 0.0;
-/* Copyright (C) 1991, 94, 95, 96, 97, 98 Free Software Foundation, Inc.
+/* Copyright (C) 1991, 94, 95, 96, 97, 98, 99 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
memcpy (name, string, name_end - string);
name[name_end - string] = '\0';
#endif
- return __setenv (name, name_end + 1, 1);
+ return __add_to_environ (name, NULL, string, 1);
}
__unsetenv (string);
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
-/* Issues:
-
- 1. putenv must not use setenv since the string provided by the user
- must be used, not a copy
-
- 2. a common function should determine the place where to insert the
- new entry and if necessary take care of extending the array
-
- 3. It must be kept track of whether an entry was inserted via putenv
- or setenv. In the former case the entry must not be put into
- the search tree since removing it could mean it will not be
- available anymore (e.g., when allocated on the stack)
-
- To handle this an array parallel to the __environ array must specify
- whether the entry was added via putenv or not
-*/
-
#if HAVE_CONFIG_H
# include <config.h>
#endif
static char **last_environ;
+/* This function is used by `setenv' and `putenv'. The difference between
+ the two functions is that for the former must create a new string which
+ is then placed in the environment, while the argument of `putenv'
+ must be used directly. This is all complicated by the fact that we try
+ to reuse values once generated for a `setenv' call since we can never
+ free the strings. */
int
-setenv (name, value, replace)
+__add_to_environ (name, value, combined, replace)
const char *name;
const char *value;
+ const char *combined;
int replace;
{
register char **ep;
register size_t size;
const size_t namelen = strlen (name);
- const size_t vallen = strlen (value) + 1;
+ const size_t vallen = value != NULL ? strlen (value) + 1 : 0;
LOCK;
return -1;
}
- /* See whether the value is already known. */
+ /* If the whole entry is given add it. */
+ if (combined != NULL)
+ /* We must not add the string to the search tree since it belongs
+ to the user. */
+ new_environ[size] = (char *) combined;
+ else
+ {
+ /* See whether the value is already known. */
#ifdef USE_TSEARCH
- new_value = alloca (namelen + 1 + vallen);
+ new_value = (char *) alloca (namelen + 1 + vallen);
# ifdef _LIBC
- __mempcpy (__mempcpy (__mempcpy (new_value, name, namelen), "=", 1),
- value, vallen);
+ __mempcpy (__mempcpy (__mempcpy (new_value, name, namelen), "=", 1),
+ value, vallen);
# else
- memcpy (new_value, name, namelen);
- new_value[namelen] = '=';
- memcpy (&new_value[namelen + 1], value, vallen);
+ memcpy (new_value, name, namelen);
+ new_value[namelen] = '=';
+ memcpy (&new_value[namelen + 1], value, vallen);
# endif
- new_environ[size] = KNOWN_VALUE (new_value);
- if (new_environ[size] == NULL)
-#endif
- {
- new_environ[size] = malloc (namelen + 1 + vallen);
+ new_environ[size] = KNOWN_VALUE (new_value);
if (new_environ[size] == NULL)
+#endif
{
- __set_errno (ENOMEM);
- UNLOCK;
- return -1;
- }
+ new_environ[size] = (char *) malloc (namelen + 1 + vallen);
+ if (new_environ[size] == NULL)
+ {
+ __set_errno (ENOMEM);
+ UNLOCK;
+ return -1;
+ }
#ifdef USE_TSEARCH
- memcpy (new_environ[size], new_value, namelen + 1 + vallen);
+ memcpy (new_environ[size], new_value, namelen + 1 + vallen);
#else
- memcpy (new_environ[size], name, namelen);
- new_environ[size][namelen] = '=';
- memcpy (&new_environ[size][namelen + 1], value, vallen);
+ memcpy (new_environ[size], name, namelen);
+ new_environ[size][namelen] = '=';
+ memcpy (&new_environ[size][namelen + 1], value, vallen);
#endif
+ /* And save the value now. We cannot do this when we remove
+ the string since then we cannot decide whether it is a
+ user string or not. */
+ STORE_VALUE (new_environ[size]);
+ }
}
if (__environ != last_environ)
}
else if (replace)
{
- char *new_value;
char *np;
- /* The existing string is too short; malloc a new one. */
+ /* Use the user string if given. */
+ if (combined != NULL)
+ np = (char *) combined;
+ else
+ {
#ifdef USE_TSEARCH
- new_value = alloca (namelen + 1 + vallen);
+ char *new_value = alloca (namelen + 1 + vallen);
# ifdef _LIBC
- __mempcpy (__mempcpy (__mempcpy (new_value, name, namelen), "=", 1),
- value, vallen);
+ __mempcpy (__mempcpy (__mempcpy (new_value, name, namelen), "=", 1),
+ value, vallen);
# else
- memcpy (new_value, name, namelen);
- new_value[namelen] = '=';
- memcpy (&new_value[namelen + 1], value, vallen);
+ memcpy (new_value, name, namelen);
+ new_value[namelen] = '=';
+ memcpy (&new_value[namelen + 1], value, vallen);
# endif
- np = KNOWN_VALUE (new_value);
- if (np == NULL)
-#endif
- {
- np = malloc (namelen + 1 + vallen);
+ np = KNOWN_VALUE (new_value);
if (np == NULL)
+#endif
{
- UNLOCK;
- return -1;
- }
+ np = malloc (namelen + 1 + vallen);
+ if (np == NULL)
+ {
+ UNLOCK;
+ return -1;
+ }
#ifdef USE_TSEARCH
- memcpy (np, new_value, namelen + 1 + vallen);
+ memcpy (np, new_value, namelen + 1 + vallen);
#else
- memcpy (np, name, namelen);
- np[namelen] = '=';
- memcpy (&np[namelen + 1], value, vallen);
+ memcpy (np, name, namelen);
+ np[namelen] = '=';
+ memcpy (&np[namelen + 1], value, vallen);
#endif
+ /* And remember the value. */
+ STORE_VALUE (np);
+ }
}
- /* Keep the old value around. */
- STORE_VALUE (*ep);
*ep = np;
}
return 0;
}
+int
+setenv (name, value, replace)
+ const char *name;
+ const char *value;
+ int replace;
+{
+ return __add_to_environ (name, value, NULL, replace);
+}
+
void
unsetenv (name)
const char *name;
LOCK;
- for (ep = __environ; *ep != NULL; ++ep)
+ ep = __environ;
+ while (*ep != NULL)
if (!strncmp (*ep, name, len) && (*ep)[len] == '=')
{
/* Found it. Remove this pointer by moving later ones back. */
char **dp = ep;
- /* Store the value so that we can reuse it later. */
- STORE_VALUE (*ep);
-
do
dp[0] = dp[1];
while (*dp++);
/* Continue the loop in case NAME appears again. */
}
+ else
+ ++ep;
UNLOCK;
}
if (__environ == last_environ && __environ != NULL)
{
- /* We allocated this environment so we can free it. Store all the
- strings. */
- char **ep = __environ;
- while (*ep != NULL)
- STORE_VALUE (*ep++);
-
+ /* We allocated this environment so we can free it. */
free (__environ);
last_environ = NULL;
}
-/* Copyright (C) 1996, 1997 Free Software Foundation, Inc.
+/* Copyright (C) 1996, 1997, 1999 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
#include <features.h>
/* Return number of configured processors. */
-extern int __get_nprocs_conf __P ((void));
extern int get_nprocs_conf __P ((void));
/* Return number of available processors. */
-extern int __get_nprocs __P ((void));
extern int get_nprocs __P ((void));
/* Return number of physical pages of memory in the system. */
-extern int __get_phys_pages __P ((void));
extern int get_phys_pages __P ((void));
/* Return number of available physical pages of memory in the system. */
-extern int __get_avphys_pages __P ((void));
extern int get_avphys_pages __P ((void));
#endif /* sys/sysinfo.h */
return __s;
case 3:
__u->__usi = __pattern;
- __u = __extension__ ((void *) __u + 1);
+ __u = __extension__ ((void *) __u + 2);
__u->__uc = __pattern;
return __s;
case 4:
ret
22: fstp %st(0)
-23: popl %eax
- popl %edx
+23: addl $8, %esp // Don't use 2 x pop
24: fldl MO(zero)
ret
ret
22: fstp %st(0)
-23: popl %eax
+23: addl $4, %esp // Don't use pop.
24: fldl MO(zero)
ret
ret
22: fstp %st(0)
-23: popl %eax
- popl %edx
+23: addl $8, %esp // Don't use 2 x pop
24: fldl MO(zero)
ret
-/* Implementation of gamma function according to ISO C.
- Copyright (C) 1997, 1999 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
- Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Library General Public License as
- published by the Free Software Foundation; either version 2 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
- Library General Public License for more details.
-
- You should have received a copy of the GNU Library General Public
- License along with the GNU C Library; see the file COPYING.LIB. If not,
- write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- Boston, MA 02111-1307, USA. */
-
#include <math.h>
-#include <math_private.h>
-
+#include <stdio.h>
+#include <errno.h>
long double
__ieee754_gammal_r (long double x, int *signgamp)
{
- /* We don't have a real gamma implementation now. We'll use lgamma
- and the exp function. But due to the required boundary
- conditions we must check some values separately. */
- u_int32_t es, hx, lx;
-
- GET_LDOUBLE_WORDS (es, hx, lx, x);
-
- if (((es & 0x7fff) | hx | lx) == 0)
- {
- /* Return value for x == 0 is NaN with invalid exception. */
- *signgamp = 0;
- return x / x;
- }
- if ((hx & 0x8000) != 0 && (hx & 0x7fff) != 0x7fff && __rintl (x) == x)
- {
- /* Return value for integer x < 0 is NaN with invalid exception. */
- *signgamp = 0;
- return (x - x) / (x - x);
- }
-
- /* XXX FIXME. */
- return __ieee754_expl (__ieee754_lgammal_r (x, signgamp));
+ *signgamp = 0;
+ fputs ("__ieee754_gammal_r not implemented\n", stderr);
+ __set_errno (ENOSYS);
+ return 0.0;
}
+
+stub_warning (__ieee754_gammal_r)
+#include <stub-tag.h>
--- /dev/null
+/* Determine various system internal values, Linux/Alpha version.
+ Copyright (C) 1999 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by Andreas Schwab <schwab@suse.de>
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public License as
+ published by the Free Software Foundation; either version 2 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
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public
+ License along with the GNU C Library; see the file COPYING.LIB. If not,
+ write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA. */
+
+
+/* We need to define a special parser for /proc/cpuinfo. */
+#define GET_NPROCS_PARSER(FP, BUFFER, RESULT) \
+ do \
+ { \
+ (RESULT) = 0; \
+ /* Find the line that contains the information about the number of \
+ active cpus. We don't have to fear extremely long lines since \
+ the kernel will not generate them. 8192 bytes are really \
+ enough. */ \
+ while (fgets_unlocked (BUFFER, sizeof (BUFFER), FP) != NULL) \
+ if (sscanf (BUFFER, "CPUs probed %*d active %d", &(RESULT)) == 1) \
+ break; \
+ } \
+ while (0)
+
+
+/* On the Alpha we can distinguish between the number of configured and
+ active cpus. */
+#define GET_NPROCS_CONF_PARSER(FP, BUFFER, RESULT) \
+ do \
+ { \
+ (RESULT) = 0; \
+ /* Find the line that contains the information about the number of \
+ probed cpus. We don't have to fear extremely long lines since \
+ the kernel will not generate them. 8192 bytes are really \
+ enough. */ \
+ while (fgets_unlocked ((BUFFER), sizeof (BUFFER), (FP)) != NULL) \
+ if (sscanf (buffer, "CPUs probed %d", &(RESULT)) == 1) \
+ break; \
+ } \
+ while (0)
+
+#include <sysdeps/unix/sysv/linux/getsysstats.c>
/* Determine various system internal values, Linux version.
- Copyright (C) 1996, 1997, 1998 Free Software Foundation, Inc.
+ Copyright (C) 1996, 1997, 1998, 1999 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1996.
But not all systems have support for the /proc filesystem. If it
is not available we simply return 1 since there is no way. */
+
+/* Other architectures use different formats for /proc/cpuinfo. This
+ provides a hook for alternative parsers. */
+#ifndef GET_NPROCS_PARSER
+# define GET_NPROCS_PARSER(FP, BUFFER, RESULT) \
+ do \
+ { \
+ (RESULT) = 0; \
+ /* Read all lines and count the lines starting with the string \
+ "processor". We don't have to fear extremely long lines since \
+ the kernel will not generate them. 8192 bytes are really \
+ enough. */ \
+ while (fgets_unlocked (BUFFER, sizeof (BUFFER), FP) != NULL) \
+ if (strncmp (BUFFER, "processor", 9) == 0) \
+ ++(RESULT); \
+ } \
+ while (0)
+#endif
+
int
__get_nprocs ()
{
fp = fopen (proc_cpuinfo, "r");
if (fp != NULL)
{
- result = 0;
- /* Read all lines and count the lines starting with the
- string "processor". We don't have to fear extremely long
- lines since the kernel will not generate them. 8192
- bytes are really enough. */
- while (fgets_unlocked (buffer, sizeof buffer, fp) != NULL)
- if (strncmp (buffer, "processor", 9) == 0)
- ++result;
-
+ GET_NPROCS_PARSER (fp, buffer, result);
fclose (fp);
}
}
}
weak_alias (__get_nprocs, get_nprocs)
+
+#ifdef GET_NPROCS_CONF_PARSER
+/* On some architectures it is possible to distinguish between configured
+ and active cpus. */
+int
+__get_nprocs_conf ()
+{
+ FILE *fp;
+ char buffer[8192];
+ char *proc_path;
+ int result = 1;
+
+ /* XXX Here will come a test for the new system call. */
+
+ /* Get mount point of proc filesystem. */
+ proc_path = get_proc_path (buffer, sizeof buffer);
+
+ /* If we haven't found an appropriate entry return 1. */
+ if (proc_path != NULL)
+ {
+ char *proc_cpuinfo = alloca (strlen (proc_path) + sizeof ("/cpuinfo"));
+ __stpcpy (__stpcpy (proc_cpuinfo, proc_path), "/cpuinfo");
+
+ fp = fopen (proc_cpuinfo, "r");
+ if (fp != NULL)
+ {
+ GET_NPROCS_CONF_PARSER (fp, buffer, result);
+ fclose (fp);
+ }
+ }
+
+ return result;
+}
+#else
/* As far as I know Linux has no separate numbers for configured and
available processors. So make the `get_nprocs_conf' function an
alias. */
strong_alias (__get_nprocs, __get_nprocs_conf)
-weak_alias (__get_nprocs, get_nprocs_conf)
-
+#endif
+weak_alias (__get_nprocs_conf, get_nprocs_conf)
/* General function to get information about memory status from proc
filesystem. */
-/* Copyright (C) 1996 Free Software Foundation, Inc.
+/* Copyright (C) 1996, 1999 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
/* Return number of configured processors. */
-extern int __get_nprocs_conf __P ((void));
extern int get_nprocs_conf __P ((void));
/* Return number of available processors. */
-extern int __get_nprocs __P ((void));
extern int get_nprocs __P ((void));
/* Return number of physical pages of memory in the system. */
-extern int __get_phys_pages __P ((void));
extern int get_phys_pages __P ((void));
/* Return number of available physical pages of memory in the system. */
-extern int __get_avphys_pages __P ((void));
extern int get_avphys_pages __P ((void));
__END_DECLS