1
0
mirror of https://sourceware.org/git/glibc.git synced 2025-07-30 22:43:12 +03:00
1997-08-29 02:36  Ulrich Drepper  <drepper@cygnus.com>

	* Makefile (version-info.h): Use ISO form for the date.

	* catgets/catgetsinfo.h: Include <bits/libc-lock.h>.
	(struct catalog_obj): Add lock field.
	(__open_catalog): Remove second parameter from prototype.
	* catgets/catgets.c (catopen): Initialize lock field.
	(catgets): Don't pass second parameter to __open_catalog.
	* catgets/gencat.c: Initialize lock field and don't pass second
	parameter to __open_catalog.
	* catgets/open_catalog.c (__open_catalog): Decide about use of
	path by examining path in struct, not based on extra argument.
	Acquire a the lock before trying to load the catalog and release
	it before returning.

	* csu/Makefile (abi-tag.h): Make sure target directory exists.

	* io/Makefile (headers): Add bits/poll.h.
	* io/sys/poll.h: Remove definitions of POLL* constants.
	Include <bits/poll.h>.
	* sysdeps/generic/bits/poll.h: New file.
	* sysdeps/unix/sysv/linux/bits/poll.h: New file.
	* sysdeps/unix/sysv/linux/m68k/bits/poll.h: New file.
	* sysdeps/unix/sysv/linux/mips/bits/poll.h: New file.
	* sysdeps/unix/sysv/linux/sparc/bits/poll.h: New file.

	* libio/fileops.c (_IO_file_read, _IO_file_write): Remove dead code.

	* malloc/obstack.c: Add casts to keep very verbose compilers on
	64bit machine quiet.

	* nss/Makefile (libnss_db.so): Find libdb.so in db2 directory.

1997-08-28 17:30  Ulrich Drepper  <drepper@cygnus.com>

	* catgets/catgets.c (catopen): Correctly determine length of string
	in NLSPATH evironment variable.  Patch by HJ Lu <hjl@gnu.ai.mit.edu>.

1997-08-27 23:19  Richard Henderson  <rth@cygnus.com>

	* sysdeps/generic/dl-sysdep.c (DL_FIND_ARG_COMPONENTS): Provide
	default macro to track down arguments from stack start.
	(_dl_sysdep_start): Use it.
	* sysdeps/unix/sysv/linux/powerpc/dl-sysdep.c: Truncate to simply
	providing a special DL_FIND_ARG_COMPONENTS and including the next
	file up the line.

	* sysdeps/powerpc/e_sqrt.c: Move contents to w_sqrt.c and provide stub.
	* sysdeps/powerpc/e_sqrtf.c: Likewise.
	* sysdeps/powerpc/s_copysignf.S: Provide empty file; symbol is with
	the double precision version.
	* sysdeps/powerpc/s_fabsf.S: Likewise.
	* sysdeps/powerpc/s_isnanf.S: Likewise.
This commit is contained in:
Ulrich Drepper
1997-08-29 01:19:12 +00:00
parent 92f1da4da0
commit 39e16978c3
36 changed files with 980 additions and 637 deletions

View File

@ -1,3 +1,58 @@
1997-08-29 02:36 Ulrich Drepper <drepper@cygnus.com>
* Makefile (version-info.h): Use ISO form for the date.
* catgets/catgetsinfo.h: Include <bits/libc-lock.h>.
(struct catalog_obj): Add lock field.
(__open_catalog): Remove second parameter from prototype.
* catgets/catgets.c (catopen): Initialize lock field.
(catgets): Don't pass second parameter to __open_catalog.
* catgets/gencat.c: Initialize lock field and don't pass second
parameter to __open_catalog.
* catgets/open_catalog.c (__open_catalog): Decide about use of
path by examining path in struct, not based on extra argument.
Acquire a the lock before trying to load the catalog and release
it before returning.
* csu/Makefile (abi-tag.h): Make sure target directory exists.
* io/Makefile (headers): Add bits/poll.h.
* io/sys/poll.h: Remove definitions of POLL* constants.
Include <bits/poll.h>.
* sysdeps/generic/bits/poll.h: New file.
* sysdeps/unix/sysv/linux/bits/poll.h: New file.
* sysdeps/unix/sysv/linux/m68k/bits/poll.h: New file.
* sysdeps/unix/sysv/linux/mips/bits/poll.h: New file.
* sysdeps/unix/sysv/linux/sparc/bits/poll.h: New file.
* libio/fileops.c (_IO_file_read, _IO_file_write): Remove dead code.
* malloc/obstack.c: Add casts to keep very verbose compilers on
64bit machine quiet.
* nss/Makefile (libnss_db.so): Find libdb.so in db2 directory.
1997-08-28 17:30 Ulrich Drepper <drepper@cygnus.com>
* catgets/catgets.c (catopen): Correctly determine length of string
in NLSPATH evironment variable. Patch by HJ Lu <hjl@gnu.ai.mit.edu>.
1997-08-27 23:19 Richard Henderson <rth@cygnus.com>
* sysdeps/generic/dl-sysdep.c (DL_FIND_ARG_COMPONENTS): Provide
default macro to track down arguments from stack start.
(_dl_sysdep_start): Use it.
* sysdeps/unix/sysv/linux/powerpc/dl-sysdep.c: Truncate to simply
providing a special DL_FIND_ARG_COMPONENTS and including the next
file up the line.
* sysdeps/powerpc/e_sqrt.c: Move contents to w_sqrt.c and provide stub.
* sysdeps/powerpc/e_sqrtf.c: Likewise.
* sysdeps/powerpc/s_copysignf.S: Provide empty file; symbol is with
the double precision version.
* sysdeps/powerpc/s_fabsf.S: Likewise.
* sysdeps/powerpc/s_isnanf.S: Likewise.
1997-08-10 19:17 Philip Blundell <Philip.Blundell@pobox.com> 1997-08-10 19:17 Philip Blundell <Philip.Blundell@pobox.com>
* nss/nss_db/db-XXX.c: Include <db_185.h> not <db.h>. Somebody * nss/nss_db/db-XXX.c: Include <db_185.h> not <db.h>. Somebody

View File

@ -146,7 +146,7 @@ all-Banner-files = $(wildcard $(addsuffix /Banner, $(subdirs)))
$(objpfx)version-info.h: $(+sysdir_pfx)config.make $(all-Banner-files) $(objpfx)version-info.h: $(+sysdir_pfx)config.make $(all-Banner-files)
(case $(config-os) in \ (case $(config-os) in \
linux*) version=`(echo -e "#include <linux/version.h>\nUTS_RELEASE"\ linux*) version=`(echo -e "#include <linux/version.h>\nUTS_RELEASE"\
| $(CC) -E -P - | \ | $(CC) -E -P - | \
sed -e 's/"\([^"]*\)".*/\1/p' -e d) 2>/dev/null`;\ sed -e 's/"\([^"]*\)".*/\1/p' -e d) 2>/dev/null`;\
if [ -z "$$version" ]; then \ if [ -z "$$version" ]; then \
if [ -r /proc/version ]; then \ if [ -r /proc/version ]; then \
@ -157,7 +157,7 @@ $(objpfx)version-info.h: $(+sysdir_pfx)config.make $(all-Banner-files)
fi; \ fi; \
fi; \ fi; \
echo -n "\"Compiled on a Linux $$version system "; \ echo -n "\"Compiled on a Linux $$version system "; \
echo "on `date +%Y/%m/%d`.\\n\"" ;; \ echo "on `date +%Y-%m-%d`.\\n\"" ;; \
*) ;; \ *) ;; \
esac; \ esac; \
files="$(all-Banner-files)"; \ files="$(all-Banner-files)"; \

38
bits/poll.h Normal file
View File

@ -0,0 +1,38 @@
/* Copyright (C) 1997 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
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. */
/* Event types that can be polled for. These bits may be set in `events'
to indicate the interesting event types; they will appear in `revents'
to indicate the status of the file descriptor. */
#define POLLIN 01 /* There is data to read. */
#define POLLPRI 02 /* There is urgent data to read. */
#define POLLOUT 04 /* Writing now will not block. */
/* Some aliases. */
#define POLLWRNORM POLLOUT
/* Event types always implicitly polled for. These bits need not be set in
`events', but they will appear in `revents' to indicate the status of
the file descriptor. */
#define POLLERR 010 /* Error condition. */
#define POLLHUP 020 /* Hung up. */
#define POLLNVAL 040 /* Invalid polling request. */
/* Canonical number of polling requests to read in at a time in poll. */
#define NPOLLFILE 30

View File

@ -87,7 +87,7 @@ catopen (const char *cat_name, int flag)
if (nlspath != NULL && *nlspath != '\0') if (nlspath != NULL && *nlspath != '\0')
{ {
/* Append the system dependent directory. */ /* Append the system dependent directory. */
size_t len = strlen (nlspath + 1 + sizeof NLSPATH); size_t len = strlen (nlspath) + 1 + sizeof NLSPATH;
char *tmp = alloca (len); char *tmp = alloca (len);
__stpcpy (__stpcpy (__stpcpy (tmp, nlspath), ":"), NLSPATH); __stpcpy (__stpcpy (__stpcpy (tmp, nlspath), ":"), NLSPATH);
@ -111,6 +111,8 @@ catopen (const char *cat_name, int flag)
result->nlspath = NULL; result->nlspath = NULL;
} }
__libc_lock_init (result->lock);
return (nl_catd) result; return (nl_catd) result;
} }
@ -130,7 +132,7 @@ catgets (nl_catd catalog_desc, int set, int message, const char *string)
catalog = (__nl_catd) catalog_desc; catalog = (__nl_catd) catalog_desc;
if (catalog->status == closed) if (catalog->status == closed)
__open_catalog (catalog, 1); __open_catalog (catalog);
if (catalog->status == nonexisting) if (catalog->status == nonexisting)
{ {

View File

@ -1,4 +1,4 @@
/* Copyright (C) 1996 Free Software Foundation, Inc. /* Copyright (C) 1996, 1997 Free Software Foundation, Inc.
This file is part of the GNU C Library. This file is part of the GNU C Library.
Contributed by Ulrich Drepper, <drepper@gnu.ai.mit.edu>. Contributed by Ulrich Drepper, <drepper@gnu.ai.mit.edu>.
@ -18,6 +18,7 @@
Boston, MA 02111-1307, USA. */ Boston, MA 02111-1307, USA. */
#include <sys/types.h> #include <sys/types.h>
#include <bits/libc-lock.h>
struct catalog_obj struct catalog_obj
@ -47,6 +48,8 @@ typedef struct catalog_info
struct catalog_obj *file_ptr; struct catalog_obj *file_ptr;
size_t file_size; size_t file_size;
__libc_lock_define (,lock);
} *__nl_catd; } *__nl_catd;
@ -56,4 +59,4 @@ typedef struct catalog_info
/* Prototypes for helper functions. */ /* Prototypes for helper functions. */
void __open_catalog (__nl_catd __catalog, int __with_path); void __open_catalog (__nl_catd __catalog);

View File

@ -988,9 +988,11 @@ read_old (struct catalog *catalog, const char *file_name)
old_cat_obj.status = closed; old_cat_obj.status = closed;
old_cat_obj.cat_name = file_name; old_cat_obj.cat_name = file_name;
old_cat_obj.nlspath = NULL;
__libc_lock_init (old_cat_obj.lock);
/* Try to open catalog, but don't look through the NLSPATH. */ /* Try to open catalog, but don't look through the NLSPATH. */
__open_catalog (&old_cat_obj, 0); __open_catalog (&old_cat_obj);
if (old_cat_obj.status != mmapped && old_cat_obj.status != malloced) if (old_cat_obj.status != mmapped && old_cat_obj.status != malloced)
if (errno == ENOENT) if (errno == ENOENT)

View File

@ -33,14 +33,22 @@
void void
__open_catalog (__nl_catd catalog, int with_path) __open_catalog (__nl_catd catalog)
{ {
int fd; int fd;
struct stat st; struct stat st;
int swapping; int swapping;
if (strchr (catalog->cat_name, '/') != NULL || !with_path) /* Make sure we are alone. */
fd = open (catalog->cat_name, O_RDONLY); __libc_lock_lock (catalog->lock);
/* Check whether there was no other thread faster. */
if (catalog->status != closed)
/* While we waited some other thread tried to open the catalog. */
goto unlock_return;
if (strchr (catalog->cat_name, '/') != NULL || catalog->nlspath == NULL)
fd = __open (catalog->cat_name, O_RDONLY);
else else
{ {
const char *run_nlspath = catalog->nlspath; const char *run_nlspath = catalog->nlspath;
@ -164,7 +172,7 @@ __open_catalog (__nl_catd catalog, int with_path)
if (fd < 0 || __fstat (fd, &st) < 0) if (fd < 0 || __fstat (fd, &st) < 0)
{ {
catalog->status = nonexisting; catalog->status = nonexisting;
return; goto unlock_return;
} }
#ifndef MAP_COPY #ifndef MAP_COPY
@ -195,7 +203,7 @@ __open_catalog (__nl_catd catalog, int with_path)
if (catalog->file_ptr == NULL) if (catalog->file_ptr == NULL)
{ {
catalog->status = nonexisting; catalog->status = nonexisting;
return; goto unlock_return;
} }
todo = st.st_size; todo = st.st_size;
/* Save read, handle partial reads. */ /* Save read, handle partial reads. */
@ -207,7 +215,7 @@ __open_catalog (__nl_catd catalog, int with_path)
{ {
free ((void *) catalog->file_ptr); free ((void *) catalog->file_ptr);
catalog->status = nonexisting; catalog->status = nonexisting;
return; goto unlock_return;
} }
todo -= now; todo -= now;
} }
@ -227,14 +235,14 @@ __open_catalog (__nl_catd catalog, int with_path)
swapping = 1; swapping = 1;
else else
{ {
/* Illegal file. Free he resources and mark catalog as not /* Illegal file. Free the resources and mark catalog as not
usable. */ usable. */
if (catalog->status == mmapped) if (catalog->status == mmapped)
__munmap ((void *) catalog->file_ptr, catalog->file_size); __munmap ((void *) catalog->file_ptr, catalog->file_size);
else else
free (catalog->file_ptr); free (catalog->file_ptr);
catalog->status = nonexisting; catalog->status = nonexisting;
return; goto unlock_return;
} }
#define SWAP(x) (swapping ? SWAPU32 (x) : (x)) #define SWAP(x) (swapping ? SWAPU32 (x) : (x))
@ -260,4 +268,8 @@ __open_catalog (__nl_catd catalog, int with_path)
catalog->strings = catalog->strings =
(const char *) &catalog->file_ptr->name_ptr[catalog->plane_size (const char *) &catalog->file_ptr->name_ptr[catalog->plane_size
* catalog->plane_depth * 3 * 2]; * catalog->plane_depth * 3 * 2];
/* Release the lock again. */
unlock_return:
__libc_lock_unlock (catalog->lock);
} }

View File

@ -126,6 +126,7 @@ $(addprefix $(objpfx),$(filter-out $(start-installed-name),$(csu-dummies))):
/ := $$/# bite me. / := $$/# bite me.
$(objpfx)abi-tag.h: $(..)abi-tags $(objpfx)abi-tag.h: $(..)abi-tags
$(make-target-directory)
rm -f $@.new rm -f $@.new
sed 's/#.*$//;/^[ ]*$$/d' $< | while read conf tag; do \ sed 's/#.*$//;/^[ ]*$$/d' $< | while read conf tag; do \
test `expr '$(config-machine)-$(config-vendor)-$(config-os)' \ test `expr '$(config-machine)-$(config-vendor)-$(config-os)' \

View File

@ -23,7 +23,7 @@ subdir := io
headers := sys/stat.h bits/stat.h sys/statfs.h bits/statfs.h sys/vfs.h \ headers := sys/stat.h bits/stat.h sys/statfs.h bits/statfs.h sys/vfs.h \
fcntl.h sys/fcntl.h bits/fcntl.h \ fcntl.h sys/fcntl.h bits/fcntl.h \
poll.h sys/poll.h \ poll.h sys/poll.h bits/poll.h \
utime.h ftw.h fts.h utime.h ftw.h fts.h
routines := \ routines := \

View File

@ -1,5 +1,5 @@
/* Compatibility definitions for System V `poll' interface. /* Compatibility definitions for System V `poll' interface.
Copyright (C) 1994, 1996 Free Software Foundation, Inc. Copyright (C) 1994, 1996, 1997 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
@ -22,6 +22,9 @@
#include <features.h> #include <features.h>
/* Get the platform dependent bits of `poll'. */
#include <bits/poll.h>
__BEGIN_DECLS __BEGIN_DECLS
/* Data structure describing a polling request. */ /* Data structure describing a polling request. */
@ -32,26 +35,6 @@ struct pollfd
short int revents; /* Types of events that actually occurred. */ short int revents; /* Types of events that actually occurred. */
}; };
/* Event types that can be polled for. These bits may be set in `events'
to indicate the interesting event types; they will appear in `revents'
to indicate the status of the file descriptor. */
#define POLLIN 01 /* There is data to read. */
#define POLLPRI 02 /* There is urgent data to read. */
#define POLLOUT 04 /* Writing now will not block. */
/* Some aliases. */
#define POLLWRNORM POLLOUT
/* Event types always implicitly polled for. These bits need not be set in
`events', but they will appear in `revents' to indicate the status of
the file descriptor. */
#define POLLERR 010 /* Error condition. */
#define POLLHUP 020 /* Hung up. */
#define POLLNVAL 040 /* Invalid polling request. */
/* Canonical number of polling requests to read in at a time in poll. */
#define NPOLLFILE 30
/* Poll the file descriptors described by the NFDS structures starting at /* Poll the file descriptors described by the NFDS structures starting at
FDS. If TIMEOUT is nonzero and not -1, allow TIMEOUT milliseconds for FDS. If TIMEOUT is nonzero and not -1, allow TIMEOUT milliseconds for

View File

@ -575,19 +575,7 @@ _IO_file_read (fp, buf, size)
void *buf; void *buf;
_IO_ssize_t size; _IO_ssize_t size;
{ {
for (;;) return _IO_read (fp->_fileno, buf, size);
{
_IO_ssize_t count = _IO_read (fp->_fileno, buf, size);
#if 0 && defined EINTR
/* We must not do this optimization since POSIX.1 explicitly
requests that the stream operations must return with the
error EINTR if this happens. There must be the possibility
that stream operations time out. --drepper */
if (count == -1 && errno == EINTR)
continue;
#endif
return count;
}
} }
_IO_pos_t _IO_pos_t
@ -626,19 +614,8 @@ _IO_file_write (f, data, n)
_IO_ssize_t count = _IO_write (f->_fileno, data, to_do); _IO_ssize_t count = _IO_write (f->_fileno, data, to_do);
if (count == EOF) if (count == EOF)
{ {
#if 0 && defined EINTR f->_flags |= _IO_ERR_SEEN;
/* We must not do this optimization since POSIX.1 explicitly break;
requests that the stream operations must return with the
error EINTR if this happens. There must be the
possibility that stream operations time out. --drepper */
if (errno == EINTR)
continue;
else
#endif
{
f->_flags |= _IO_ERR_SEEN;
break;
}
} }
to_do -= count; to_do -= count;
data = (void *) ((char *) data + count); data = (void *) ((char *) data + count);

View File

@ -156,6 +156,7 @@ db3c60025eb80244d70bf7889f058055 charmaps/T.101-G2
572baa84bd05d4b236b7e2fb211d0dfd charmaps/T.61-7BIT 572baa84bd05d4b236b7e2fb211d0dfd charmaps/T.61-7BIT
1e39e36aa7544014059b0aa8381ab051 charmaps/T.61-8BIT 1e39e36aa7544014059b0aa8381ab051 charmaps/T.61-8BIT
81c8e12a75dff4371ce82773d670cd6d charmaps/VIDEOTEX-SUPPL 81c8e12a75dff4371ce82773d670cd6d charmaps/VIDEOTEX-SUPPL
910e8174540ecba1ac61b5f27f6dc359 locales/cs_CZ
45ade09ead9fd385d58504bfc005ecab locales/da_DK 45ade09ead9fd385d58504bfc005ecab locales/da_DK
249894e0554d46d1fbdae4a5fb8cc20e locales/de_AT 249894e0554d46d1fbdae4a5fb8cc20e locales/de_AT
b3628f73e00bb655a5e96bcc2331893c locales/de_BE b3628f73e00bb655a5e96bcc2331893c locales/de_BE
@ -175,14 +176,13 @@ bda978c8b0e379d57a8599edfdb2e858 locales/fi_FI
a25300033ea6c619a4e15051f14aa65e locales/fo_FO a25300033ea6c619a4e15051f14aa65e locales/fo_FO
02ca55b19338f94530f0b60999638ed4 locales/fr_BE 02ca55b19338f94530f0b60999638ed4 locales/fr_BE
655c7b8713b9aad20014df2c27928cb7 locales/fr_CA 655c7b8713b9aad20014df2c27928cb7 locales/fr_CA
8e60885c3fda81bc7773f139657974f3 locales/fr_CA,2.13 d5bec15a74c4107a77a46fe185883574 locales/fr_CA,2.13
8a76a0e3ea2923367fdbab78a6bc67cb locales/fr_CA,2.13.orig
19403a5cd69a9ad658b173859eb022ef locales/fr_CH 19403a5cd69a9ad658b173859eb022ef locales/fr_CH
48d8981b117e72c5eb2e9c181cbd7d2b locales/fr_FR 48d8981b117e72c5eb2e9c181cbd7d2b locales/fr_FR
cc1b77cf4cdc4488a99637e730e0f57f locales/fr_LU cc1b77cf4cdc4488a99637e730e0f57f locales/fr_LU
1987b72e766038b0f475165c994d1469 locales/ga_IE 1987b72e766038b0f475165c994d1469 locales/ga_IE
be2ef06fd9a4b4def515216972fe9250 locales/gr_GR be2ef06fd9a4b4def515216972fe9250 locales/gr_GR
9e2de7fe4b41f9bad952cdc5bfd77cd4 locales/hr_HR e7ad1d62ccf958b04f018cbd96ede3b2 locales/hr_HR
7f35d03bbe29b53831674704f8b307af locales/hu_HU 7f35d03bbe29b53831674704f8b307af locales/hu_HU
1a8b95f6663b7a99703a32c6135d8896 locales/is_IS 1a8b95f6663b7a99703a32c6135d8896 locales/is_IS
47620dbc36bf3ffe04b32dd16b7aae3c locales/it_IT 47620dbc36bf3ffe04b32dd16b7aae3c locales/it_IT
@ -194,7 +194,7 @@ d5394568c45886788becf67b54bc916e locales/lt_LT
e71081f29649cfd4ac8563ae1f7932fa locales/nl_NL e71081f29649cfd4ac8563ae1f7932fa locales/nl_NL
3a0720088defd80baa0623990c6d196a locales/no_NO 3a0720088defd80baa0623990c6d196a locales/no_NO
6d1bb18d4271cd712e5dc24eec4706b9 locales/pl_PL 6d1bb18d4271cd712e5dc24eec4706b9 locales/pl_PL
b07ce7e57dda4687f2a83cd5ec79a3e0 locales/POSIX bbbcbd6f0a484ec25d8a592217a76ebb locales/POSIX
509fc74fdd394f6876358d357f955645 locales/pt_BR 509fc74fdd394f6876358d357f955645 locales/pt_BR
7c2463bcee68bccde3145642a34a8ef1 locales/pt_PT 7c2463bcee68bccde3145642a34a8ef1 locales/pt_PT
32c766f85eb82823856485e5802dce19 locales/ro_RO 32c766f85eb82823856485e5802dce19 locales/ro_RO

View File

@ -30,9 +30,9 @@ charmaps := $(filter-out $(addprefix charmaps/, CVS RCS %~), \
locales := $(filter-out $(addprefix locales/, CVS RCS %~), \ locales := $(filter-out $(addprefix locales/, CVS RCS %~), \
$(wildcard locales/*)) $(wildcard locales/*))
test-srcs := collate-test xfrm-test test-srcs := collate-test xfrm-test tst-fmon
test-input := de_DE.ISO-8859-1 da_DK.ISO-8859-1 fr_CA,2.13.ISO-8859-1 test-input := de_DE.ISO-8859-1 da_DK.ISO-8859-1 fr_CA,2.13.ISO-8859-1
fmon-input := de_DE.ISO-8859-1 en_US.ISO-8859-1
# Get $(inst_i18ndir) defined. # Get $(inst_i18ndir) defined.
include ../Makeconfig include ../Makeconfig
@ -48,6 +48,7 @@ $(inst_i18ndir)/locales/%: locales/%; $(do-install)
ifeq (no,$(cross-compiling)) ifeq (no,$(cross-compiling))
tests: $(objpfx)collate-test $(objpfx)xfrm-test tests: $(objpfx)collate-test $(objpfx)xfrm-test $(objpfx)tst-fmon
$(SHELL) -e sort-test.sh $(common-objpfx) $(test-input) $(SHELL) -e sort-test.sh $(common-objpfx) $(test-input)
$(SHELL) -e tst-fmon.sh $(common-objpfx) $(fmon-input)
endif endif

View File

@ -2,7 +2,7 @@
and and
POSIX character set descriptions POSIX character set descriptions
Ulrich Drepper Time-stamp: <1997/02/12 22:13:01 drepper> Ulrich Drepper Time-stamp: <1997/06/04 01:36:26 drepper>
drepper@cygnus.com drepper@cygnus.com
@ -34,10 +34,10 @@ desired data should happen like this:
localedef -i fr_CA -f ISO-8859-1 fr_CA localedef -i fr_CA -f ISO-8859-1 fr_CA
This will place the 6 output files in the appropriate directory where This will place the 6 output files in the appropriate directory where
the GNU libc functions can find them. Please note that you need the the GNU libc functions can find them. Please note that you need
rights to write to this directory ($(prefix)/share/locale, where permission to write to this directory ($(prefix)/share/locale, where
$(prefix) is the value you specified while configuring GNU libc). If $(prefix) is the value you specified while configuring GNU libc). If
you do not have the necessary rights, you can write the files into an you do not have the necessary permissions, you can write the files into an
arbitrary directory by giving a path including a '/' character instead arbitrary directory by giving a path including a '/' character instead
of `fr_CA'. E.g., to put the new files in a subdirectory of the of `fr_CA'. E.g., to put the new files in a subdirectory of the
current directory simply use current directory simply use
@ -48,7 +48,7 @@ How to use these data files is described in the GNU libc manual,
especially in the section describing the `setlocale' function. especially in the section describing the `setlocale' function.
The here contained files can originally be found at The files contained here were originally from
ftp://dkuug.dk/i18n/WG15-collection ftp://dkuug.dk/i18n/WG15-collection
@ -60,7 +60,7 @@ data or want to add something please contact
and and
Ulrich Drepper <drepper@cygnus.com> Ulrich Drepper <drepper@cygnus.com>
Please make sure your corrections are relativ to the originally Please make sure your corrections are relative to the originally
distributed files. Consult the CHECKSUMS file which contains the MD5 distributed files. Consult the CHECKSUMS file which contains the MD5
sums for all data files. sums for all data files.

30
localedata/fmon-de_DE.exp Normal file
View File

@ -0,0 +1,30 @@
" DM123,45"
"-DM123,45"
" DM3.456,78"
" DM123,45"
" -DM123,45"
" DM3.456,78"
" DM 123,45"
"-DM 123,45"
" DM 3.456,78"
" DM***123,45"
"-DM***123,45"
" DM*3.456,78"
" DM000123,45"
"-DM000123,45"
" DM03.456,78"
" DM 123,45"
"-DM 123,45"
" DM 3456,78"
" DM 123"
"-DM 123"
" DM 3457"
" DM 123,4500"
"-DM 123,4500"
" DM 3456,7810"
" DM 123,45 "
"(DM 123,45)"
" DM 3.456,78 "
" 123,45 "
"( 123,45)"
" 3.456,78 "

30
localedata/fmon-en_US.exp Normal file
View File

@ -0,0 +1,30 @@
" $123.45"
"-$123.45"
" $3,456.78"
" $123.45"
" -$123.45"
" $3,456.78"
" $ 123.45"
"-$ 123.45"
" $ 3,456.78"
" $***123.45"
"-$***123.45"
" $*3,456.78"
" $000123.45"
"-$000123.45"
" $03,456.78"
" $ 123.45"
"-$ 123.45"
" $ 3456.78"
" $ 123"
"-$ 123"
" $ 3457"
" $ 123.4500"
"-$ 123.4500"
" $ 3456.7810"
" $ 123.45 "
"($ 123.45)"
" $ 3,456.78 "
" 123.45 "
"( 123.45)"
" 3,456.78 "

View File

@ -2,9 +2,9 @@ escape_char /
comment_char % comment_char %
% %
% Czech Language Locale for Czech % Czech Language Locale for Czech
% Source: % Source:
% Address: U <20>koly 292 Without diactitical chars: U skoly 292 % Address: U <20>koly 292 Without diactitical chars: U skoly 292
% 783 72 Velk<6C> T<>nec 782 72 Velky Tynec % 783 72 Velk<6C> T<>nec 782 72 Velky Tynec
% Contact: Vladimir Michl % Contact: Vladimir Michl
% Email: Vladimir.Michl@upol.cz % Email: Vladimir.Michl@upol.cz
% Tel: % Tel:
@ -19,13 +19,15 @@ comment_char %
% Charset: ISO_8859-2:1987 % Charset: ISO_8859-2:1987
% Distribution and use is free, also % Distribution and use is free, also
% for commercial purposes. % for commercial purposes.
% 1997-08-20: Michael Mr<4D>ka <michael@fi.muni.cz>
% Zm<5A>ny zejm<6A>na v sekci LC_TIME. (Changes especially in LC_TIME section.)
% zpracov<6F>n<EFBFBD>: % zpracov<6F>n<EFBFBD>:
%% localedef -c -i <tento-soubor> -f "ISO_8859-2:1987" 'cs_CZ.ISO-8859-2' %% localedef -c -i <tento-soubor> -f "ISO_8859-2:1987" 'cs_CZ.ISO-8859-2'
%% pokud se poda<64><61> odstranit chyby, lze -c vynechat. %% pokud se poda<64><61> odstranit chyby, lze -c vynechat.
%% pro <20>sp<73><70>n<EFBFBD> p<>elo<6C>en<65> je t<>eba m<>t kolekci lokalizac<61> WG15collection. %% pro <20>sp<73><70>n<EFBFBD> p<>elo<6C>en<65> je t<>eba m<>t kolekci lokalizac<61> WG15collection. Tuto rozbalit do adres<65><73>e
%% Tuto rozbalit do adres<65><73>e
%% /usr/share/i18n %% /usr/share/i18n
%% Lokalizace se pak budou tvo<76>it v adres<65><73>i /usr/share/locale %% Lokalizace se pak budou tvo<76>it v adres<65><73>i /usr/share/locale
@ -42,9 +44,9 @@ comment_char %
LC_COLLATE LC_COLLATE
% Definice p<>smene ch % Definice p<>smene ch
collating-element <c-h> from "<c><h>" collating-element <ch> from "<c><h>"
collating-element <C-h> from "<C><h>" collating-element <Ch> from "<C><h>"
collating-element <C-H> from "<C><H>" collating-element <CH> from "<C><H>"
collating-symbol <CAPITAL> collating-symbol <CAPITAL>
collating-symbol <SMALL> collating-symbol <SMALL>
@ -65,11 +67,10 @@ collating-symbol <STROKE>
collating-symbol <CEDILLA> collating-symbol <CEDILLA>
collating-symbol <OGONEK> collating-symbol <OGONEK>
order_start forward;backward/ order_start forward;forward;forward;forward
;forward;position
<CAPITAL>
<SMALL> <SMALL>
<CAPITAL>
<NONE> <NONE>
<ACUTE> <ACUTE>
@ -87,7 +88,7 @@ order_start forward;backward/
<CEDILLA> <CEDILLA>
<OGONEK> <OGONEK>
% %
<NS> <NS>;<NS>;<NS>;IGNORE <NS> <NS>;<NS>;<NS>;IGNORE
<SP> IGNORE;IGNORE;IGNORE;<SP> <SP> IGNORE;IGNORE;IGNORE;<SP>
<HT> IGNORE;IGNORE;IGNORE;<HT> <HT> IGNORE;IGNORE;IGNORE;<HT>
@ -202,8 +203,8 @@ order_start forward;backward/
<OC> IGNORE;IGNORE;IGNORE;<OC> <OC> IGNORE;IGNORE;IGNORE;<OC>
<PM> IGNORE;IGNORE;IGNORE;<PM> <PM> IGNORE;IGNORE;IGNORE;<PM>
<AC> IGNORE;IGNORE;IGNORE;<AC> <AC> IGNORE;IGNORE;IGNORE;<AC>
UNDEFINED IGNORE;IGNORE;IGNORE UNDEFINED IGNORE;IGNORE;IGNORE;IGNORE
<0> <0>;<0>;IGNORE;IGNORE <0> <0>;<0>;IGNORE;IGNORE
<1> <1>;<1>;IGNORE;IGNORE <1> <1>;<1>;IGNORE;IGNORE
<2> <2>;<2>;IGNORE;IGNORE <2> <2>;<2>;IGNORE;IGNORE
@ -267,9 +268,9 @@ UNDEFINED IGNORE;IGNORE;IGNORE
<H> <H>;<NONE>;<CAPITAL>;IGNORE <H> <H>;<NONE>;<CAPITAL>;IGNORE
<h> <H>;<NONE>;<SMALL>;IGNORE <h> <H>;<NONE>;<SMALL>;IGNORE
<C-H> <C-H>;<NONE>;<CAPITAL>;IGNORE <CH> <CH>;<NONE>;<CAPITAL>;IGNORE
<C-h> <C-h>;<NONE>;<CAPITAL>;IGNORE <Ch> <Ch>;<NONE>;<CAPITAL>;IGNORE
<c-h> <c-h>;<NONE>;<SMALL>;IGNORE <ch> <ch>;<NONE>;<SMALL>;IGNORE
<I> <I>;<NONE>;<CAPITAL>;IGNORE <I> <I>;<NONE>;<CAPITAL>;IGNORE
<i> <I>;<NONE>;<SMALL>;IGNORE <i> <I>;<NONE>;<SMALL>;IGNORE
@ -385,13 +386,10 @@ END LC_COLLATE
LC_CTYPE LC_CTYPE
digit <0>;<1>;<2>;<3>;<4>;/ digit <0>;<1>;<2>;<3>;<4>;<5>;<6>;<7>;<8>;<9>
<5>;<6>;<7>;<8>;<9>
xdigit <0>;<1>;<2>;<3>;<4>;/ xdigit <0>;<1>;<2>;<3>;<4>;<5>;<6>;<7>;<8>;<9>;/
<5>;<6>;<7>;<8>;<9>;/ <a>;...;<f>;<A>;...;<F>
<a>;...;<f>;/
<A>;...;<F>
punct <!>;...;<//>;/ punct <!>;...;<//>;/
<:>;...;<At>;/ <:>;...;<At>;/
@ -406,7 +404,7 @@ blank <SP>;<HT>;<NS>
space <SP>;<LF>;<VT>;<FF>;/ space <SP>;<LF>;<VT>;<FF>;/
<CR>;<HT>;<NS> <CR>;<HT>;<NS>
cntrl <NU>;<SH>;<SX>;<EX>;<ET>;<EQ>;/ cntrl <NU>;<SH>;<SX>;<EX>;<ET>;<EQ>;/
<AK>;<BL>;<BS>;<HT>;<LF>;<VT>;/ <AK>;<BL>;<BS>;<HT>;<LF>;<VT>;/
<FF>;<CR>;<SO>;<SI>;<DL>;<D1>;/ <FF>;<CR>;<SO>;<SI>;<DL>;<D1>;/
@ -419,89 +417,6 @@ cntrl <NU>;<SH>;<SX>;<EX>;<ET>;<EQ>;/
<MW>;<SG>;<EG>;<SS>;<GC>;<SC>;/ <MW>;<SG>;<EG>;<SS>;<GC>;<SC>;/
<CI>;<ST>;<OC>;<PM>;<AC> <CI>;<ST>;<OC>;<PM>;<AC>
alpha <A>;...;<Z>;/
<A;>;/
<L//>;/
<L<>;/
<S'>;/
<S<>;/
<S,>;/
<T<>;/
<Z'>;/
<Z<>;/
<Z.>;/
<R'>;/
<A'>;/
<A/>>;/
<A(>;/
<A:>;/
<L'>;/
<C'>;/
<C,>;/
<C<>;/
<E'>;/
<E;>;/
<E:>;/
<E<>;/
<I'>;/
<I/>>;/
<D<>;/
<D//>;/
<N'>;/
<N<>;/
<O'>;/
<O/>>;/
<O">;/
<O:>;/
<R<>;/
<U0>;/
<U'>;/
<U">;/
<U:>;/
<Y'>;/
<T,>;/
<a>;...;<z>;/
<a;>;/
<l//>;/
<l<>;/
<s'>;/
<s<>;/
<s,>;/
<t<>;/
<z'>;/
<z<>;/
<z.>;/
<ss>;/
<r'>;/
<a'>;/
<a/>>;/
<a(>;/
<a:>;/
<l'>;/
<c'>;/
<c,>;/
<c<>;/
<e'>;/
<e;>;/
<e:>;/
<e<>;/
<i'>;/
<i/>>;/
<d<>;/
<d//>;/
<n'>;/
<n<>;/
<o'>;/
<o/>>;/
<o">;/
<o:>;/
<r<>;/
<u0>;/
<u'>;/
<u">;/
<u:>;/
<y'>;/
<t,>
upper <A>;...;<Z>;/ upper <A>;...;<Z>;/
<A;>;/ <A;>;/
@ -588,6 +503,89 @@ lower <a>;...;<z>;/
<y'>;/ <y'>;/
<t,> <t,>
alpha <A>;...;<Z>;/
<A;>;/
<L//>;/
<L<>;/
<S'>;/
<S<>;/
<S,>;/
<T<>;/
<Z'>;/
<Z<>;/
<Z.>;/
<R'>;/
<A'>;/
<A/>>;/
<A(>;/
<A:>;/
<L'>;/
<C'>;/
<C,>;/
<C<>;/
<E'>;/
<E;>;/
<E:>;/
<E<>;/
<I'>;/
<I/>>;/
<D<>;/
<D//>;/
<N'>;/
<N<>;/
<O'>;/
<O/>>;/
<O">;/
<O:>;/
<R<>;/
<U0>;/
<U'>;/
<U">;/
<U:>;/
<Y'>;/
<T,>;/
<a>;...;<z>;/
<a;>;/
<l//>;/
<l<>;/
<s'>;/
<s<>;/
<s,>;/
<t<>;/
<z'>;/
<z<>;/
<z.>;/
<ss>;/
<r'>;/
<a'>;/
<a/>>;/
<a(>;/
<a:>;/
<l'>;/
<c'>;/
<c,>;/
<c<>;/
<e'>;/
<e;>;/
<e:>;/
<e<>;/
<i'>;/
<i/>>;/
<d<>;/
<d//>;/
<n'>;/
<n<>;/
<o'>;/
<o/>>;/
<o">;/
<o:>;/
<r<>;/
<u0>;/
<u'>;/
<u">;/
<u:>;/
<y'>;/
<t,>
toupper (<a>,<A>);(<b>,<B>);(<c>,<C>);(<d>,<D>);(<e>,<E>);(<f>,<F>);/ toupper (<a>,<A>);(<b>,<B>);(<c>,<C>);(<d>,<D>);(<e>,<E>);(<f>,<F>);/
(<g>,<G>);(<h>,<H>);(<i>,<I>);(<j>,<J>);(<k>,<K>);(<l>,<L>);/ (<g>,<G>);(<h>,<H>);(<i>,<I>);(<j>,<J>);(<k>,<K>);(<l>,<L>);/
@ -687,7 +685,7 @@ END LC_CTYPE
%% ekvivalenty yes/no %% ekvivalenty yes/no
%% ------------------------- %% -------------------------
LC_MESSAGES LC_MESSAGES
yesexpr "<<(><a><A><y><Y><)/>><.><*>" yesexpr "<<(><a><A><y><Y><)/>><.><*>"
noexpr "<<(><n><N><)/>><.><*>" noexpr "<<(><n><N><)/>><.><*>"
@ -734,6 +732,7 @@ END LC_NUMERIC
LC_TIME LC_TIME
abday "<N><e>";/ abday "<N><e>";/
"<P><o>";/ "<P><o>";/
"<U'><t>";/ "<U'><t>";/
@ -750,18 +749,22 @@ day "<N><e><d><e<><l><e>";/
"<P><a'><t><e><k>";/ "<P><a'><t><e><k>";/
"<S><o><b><o><t><a>" "<S><o><b><o><t><a>"
abmon "<L><e><d>";/ %abmon "<L><e><d>";"<U'><n><o>";"<B><r<><e>";"<D><u><b>";"<K><v><e<>";/
"<U'><n><o>";/ % "<C<><e><r>";"<C<><n><c>";"<S><r><p>";"<Z><a'><r<>";"<R<><i'><j>";/
"<B><r<><e>";/ % "<L><i><s>";"<P><r><o>"
"<D><u><b>";/ % Ob<4F>v<EFBFBD>m se, <20>e <20>e<EFBFBD>tina <20><>dn<64> zkratky pro m<>s<EFBFBD>ce nezn<7A> :-)
"<K><v><e<>";/ abmon "<L><e><d><e><n>";/
"<C<><e><r>";/ "<U'><n><o><r>";/
"<C<><n><c>";/ "<B><r<><e><z><e><n>";/
"<S><r><p>";/ "<D><u><b><e><n>";/
"<Z><a'><r<>";/ "<K><v><e<><t><e><n>";/
"<R<><i'><j>";/ "<C<><e><r><v><e><n>";/
"<L><i><s>";/ "<C<><e><r><v><e><n><e><c>";/
"<P><r><o>" "<S><r><p><e><n>";/
"<Z><a'><r<><i'>";/
"<R<><i'><j><e><n>";/
"<L><i><s><t><o><p><a><d>";/
"<P><r><o><s><i><n><e><c>"
mon "<L><e><d><e><n>";/ mon "<L><e><d><e><n>";/
"<U'><n><o><r>";/ "<U'><n><o><r>";/
@ -777,33 +780,16 @@ mon "<L><e><d><e><n>";/
"<P><r><o><s><i><n><e><c>" "<P><r><o><s><i><n><e><c>"
d_t_fmt "<%><a><SP><%><d><.><SP><%><B><SP><%><Y><SP><%><H><:><%><M><:><%><S><SP><%><Z>" d_t_fmt "<%><a><SP><%><e><.><SP><%><B><SP><%><Y><,><SP><%><H><:><%><M><:><%><S><SP><%><Z>"
%d_t_fmt "<%><d><.><%><m><.><%><Y><SP><%><T><SP><%><Z>"
d_fmt "<%><d><.><%><m><.><%><Y>" d_fmt "<%><d><.><%><m><.><%><Y>"
%d_fmt "<%><d><.><%><m><.><%><Y>"
t_fmt "<%><H><:><%><M><:><%><S>" t_fmt "<%><H><:><%><M><:><%><S>"
%t_fmt "<%><T>"
t_fmt_ampm "<%><I><:><%><M><:><%><S>" t_fmt_ampm "<%><I><:><%><M><:><%><S>"
%t_fmt_ampm ""
%am_pm "am";"pm"
am_pm "";"" am_pm "";""
% Zde nev<65>m, co n<>sleduj<75>c<EFBFBD> polo<6C>ky znamenaj<61>
% V p<><70>pad<61> pot<6F>eby pros<6F>m opravte
%era "<%><Y>"
%era_year "<%><y>"
%alt_digits "<0>";"<1>";"<2>";"<3>";"<4>";/
% "<5>";"<6>";"<7>";"<8>"
%era_d_fmt "<%><e><SP><%><B><SP><%><Y>"
END LC_TIME END LC_TIME
%% END OF LOCALIZATION FILE for cs_CZ.ISO-8859-2 %% END OF LOCALIZATION FILE for cs_CZ.ISO-8859-2

View File

@ -35,5 +35,5 @@ done
exit $status exit $status
# Local Variables: # Local Variables:
# mode:ksh # mode:shell-script
# End: # End:

65
localedata/tst-fmon.c Normal file
View File

@ -0,0 +1,65 @@
#include <monetary.h>
#include <stdio.h>
#include <locale.h>
static int
check (const char *fmt, double n)
{
int result;
char buf[1000];
result = strfmon (buf, sizeof buf, fmt, n) == -1;
printf ("\"%s\"\n", buf);
return result;
}
int
main (void)
{
int result = 0;
setlocale (LC_ALL, "");
result |= check ("%n", 123.45);
result |= check ("%n", -123.45);
result |= check ("%n", 3456.781);
result |= check ("%11n", 123.45);
result |= check ("%11n", -123.45);
result |= check ("%11n", 3456.781);
result |= check ("%#5n", 123.45);
result |= check ("%#5n", -123.45);
result |= check ("%#5n", 3456.781);
result |= check ("%=*#5n", 123.45);
result |= check ("%=*#5n", -123.45);
result |= check ("%=*#5n", 3456.781);
result |= check ("%=0#5n", 123.45);
result |= check ("%=0#5n", -123.45);
result |= check ("%=0#5n", 3456.781);
result |= check ("%^#5n", 123.45);
result |= check ("%^#5n", -123.45);
result |= check ("%^#5n", 3456.781);
result |= check ("%^#5.0n", 123.45);
result |= check ("%^#5.0n", -123.45);
result |= check ("%^#5.0n", 3456.781);
result |= check ("%^#5.4n", 123.45);
result |= check ("%^#5.4n", -123.45);
result |= check ("%^#5.4n", 3456.781);
result |= check ("%(#5n", 123.45);
result |= check ("%(#5n", -123.45);
result |= check ("%(#5n", 3456.781);
result |= check ("%!(#5n", 123.45);
result |= check ("%!(#5n", -123.45);
result |= check ("%!(#5n", 3456.781);
return result;
}

32
localedata/tst-fmon.sh Executable file
View File

@ -0,0 +1,32 @@
#! /bin/sh
common_objpfx=$1; shift
lang=$*
here=`pwd`
# Generate data files.
for l in $lang; do
cns=`echo $l | sed 's/\(.*\)[.][^.]*/\1/'`
cn=locales/$cns
fn=charmaps/`echo $l | sed 's/.*[.]\([^.]*\)/\1/'`
LD_LIBRARY_PATH=$common_objpfx I18NPATH=./locales ${common_objpfx}elf/ld.so \
${common_objpfx}locale/localedef --quiet -i $cn -f $fn \
${common_objpfx}localedata/$cns
done
# Run the tests.
for l in $lang; do
cns=`echo $l | sed 's/\(.*\)[.][^.]*/\1/'`
LOCPATH=$common_objpfx/localedata LC_ALL=$cns \
LD_LIBRARY_PATH=$common_objpfx $common_objpfx/elf/ld.so \
$common_objpfx/localedata/tst-fmon \
> $common_objpfx/localedata/fmon-$cns.out || status=1
cmp -s fmon-$cns.exp $common_objpfx/localedata/fmon-$cns.out || status=1
done
exit $status
# Local Variables:
# mode:shell-script
# End:

View File

@ -162,7 +162,7 @@ _obstack_begin (h, size, alignment, chunkfun, freefun)
register struct _obstack_chunk *chunk; /* points to new chunk */ register struct _obstack_chunk *chunk; /* points to new chunk */
if (alignment == 0) if (alignment == 0)
alignment = DEFAULT_ALIGNMENT; alignment = (int) DEFAULT_ALIGNMENT;
if (size == 0) if (size == 0)
/* Default size is what GNU malloc can fit in a 4096-byte block. */ /* Default size is what GNU malloc can fit in a 4096-byte block. */
{ {
@ -221,7 +221,7 @@ _obstack_begin_1 (h, size, alignment, chunkfun, freefun, arg)
register struct _obstack_chunk *chunk; /* points to new chunk */ register struct _obstack_chunk *chunk; /* points to new chunk */
if (alignment == 0) if (alignment == 0)
alignment = DEFAULT_ALIGNMENT; alignment = (int) DEFAULT_ALIGNMENT;
if (size == 0) if (size == 0)
/* Default size is what GNU malloc can fit in a 4096-byte block. */ /* Default size is what GNU malloc can fit in a 4096-byte block. */
{ {
@ -278,9 +278,9 @@ _obstack_newchunk (h, length)
register struct _obstack_chunk *old_chunk = h->chunk; register struct _obstack_chunk *old_chunk = h->chunk;
register struct _obstack_chunk *new_chunk; register struct _obstack_chunk *new_chunk;
register long new_size; register long new_size;
register int obj_size = h->next_free - h->object_base; register long obj_size = h->next_free - h->object_base;
register int i; register long i;
int already; long already;
/* Compute size for new chunk. */ /* Compute size for new chunk. */
new_size = (obj_size + length) + (obj_size >> 3) + 100; new_size = (obj_size + length) + (obj_size >> 3) + 100;

View File

@ -70,7 +70,7 @@ endif
include ../Rules include ../Rules
$(objpfx)libnss_db.so: $(common-objpfx)db/libdb.so $(objpfx)libnss_files.so $(objpfx)libnss_db.so: $(common-objpfx)db2/libdb.so $(objpfx)libnss_files.so
$(libnss_db-routines:%=$(objpfx)%.c): $(objpfx)db-%.c: nss_files/files-%.c $(libnss_db-routines:%=$(objpfx)%.c): $(objpfx)db-%.c: nss_files/files-%.c
@rm -f $@.new @rm -f $@.new

View File

@ -0,0 +1,38 @@
/* Copyright (C) 1997 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
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. */
/* Event types that can be polled for. These bits may be set in `events'
to indicate the interesting event types; they will appear in `revents'
to indicate the status of the file descriptor. */
#define POLLIN 01 /* There is data to read. */
#define POLLPRI 02 /* There is urgent data to read. */
#define POLLOUT 04 /* Writing now will not block. */
/* Some aliases. */
#define POLLWRNORM POLLOUT
/* Event types always implicitly polled for. These bits need not be set in
`events', but they will appear in `revents' to indicate the status of
the file descriptor. */
#define POLLERR 010 /* Error condition. */
#define POLLHUP 020 /* Hung up. */
#define POLLNVAL 040 /* Invalid polling request. */
/* Canonical number of polling requests to read in at a time in poll. */
#define NPOLLFILE 30

View File

@ -45,6 +45,21 @@ int __libc_multiple_libcs; /* Defining this here avoids the inclusion
of init-first. */ of init-first. */
static ElfW(auxv_t) *_dl_auxv; static ElfW(auxv_t) *_dl_auxv;
#ifndef DL_FIND_ARG_COMPONENTS
#define DL_FIND_ARG_COMPONENTS(cookie, argc, argv, envp, auxp) \
do { \
void **_tmp; \
(argc) = *(long *) cookie; \
(argv) = (char **) cookie + 1; \
(envp) = (argv) + (argc) + 1; \
for (_tmp = (void **) (envp); *_tmp; ++_tmp) \
continue; \
(auxp) = (void *) ++_tmp; \
} while (0)
#endif
ElfW(Addr) ElfW(Addr)
_dl_sysdep_start (void **start_argptr, _dl_sysdep_start (void **start_argptr,
void (*dl_main) (const ElfW(Phdr) *phdr, ElfW(Word) phnum, void (*dl_main) (const ElfW(Phdr) *phdr, ElfW(Word) phnum,
@ -60,21 +75,15 @@ _dl_sysdep_start (void **start_argptr,
gid_t egid = 0; gid_t egid = 0;
unsigned int seen; unsigned int seen;
DL_FIND_ARG_COMPONENTS (start_argptr, _dl_argc, _dl_argv, _environ, _dl_auxv);
user_entry = (ElfW(Addr)) &ENTRY_POINT; user_entry = (ElfW(Addr)) &ENTRY_POINT;
_dl_argc = *(long *) start_argptr;
_dl_argv = (char **) start_argptr + 1;
_environ = &_dl_argv[_dl_argc + 1];
_dl_platform = NULL; /* Default to nothing known about the platform. */ _dl_platform = NULL; /* Default to nothing known about the platform. */
start_argptr = (void **) _environ;
while (*start_argptr)
++start_argptr;
seen = 0; seen = 0;
#define M(type) (1 << (type)) #define M(type) (1 << (type))
for (av = _dl_auxv = (void *) ++start_argptr; for (av = _dl_auxv; av->a_type != AT_NULL; seen |= M ((++av)->a_type))
av->a_type != AT_NULL;
seen |= M ((++av)->a_type))
switch (av->a_type) switch (av->a_type)
{ {
case AT_PHDR: case AT_PHDR:

View File

@ -1,141 +1 @@
/* Single-precision floating point square root. /* __ieee754_sqrt is in w_sqrt.c */
Copyright (C) 1997 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
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 <fenv_libc.h>
#include <inttypes.h>
static const double almost_half = 0.5000000000000001; /* 0.5 + 2^-53 */
static const uint32_t a_nan = 0x7fc00000;
static const uint32_t a_inf = 0x7f800000;
static const float two108 = 3.245185536584267269e+32;
static const float twom54 = 5.551115123125782702e-17;
extern const float __t_sqrt[1024];
/* The method is based on a description in
Computation of elementary functions on the IBM RISC System/6000 processor,
P. W. Markstein, IBM J. Res. Develop, 34(1) 1990.
Basically, it consists of two interleaved Newton-Rhapson approximations,
one to find the actual square root, and one to find its reciprocal
without the expense of a division operation. The tricky bit here
is the use of the POWER/PowerPC multiply-add operation to get the
required accuracy with high speed.
The argument reduction works by a combination of table lookup to
obtain the initial guesses, and some careful modification of the
generated guesses (which mostly runs on the integer unit, while the
Newton-Rhapson is running on the FPU). */
double
__sqrt(double x)
{
const float inf = *(const float *)&a_inf;
/* x = f_wash(x); *//* This ensures only one exception for SNaN. */
if (x > 0)
{
if (x != inf)
{
/* Variables named starting with 's' exist in the
argument-reduced space, so that 2 > sx >= 0.5,
1.41... > sg >= 0.70.., 0.70.. >= sy > 0.35... .
Variables named ending with 'i' are integer versions of
floating-point values. */
double sx; /* The value of which we're trying to find the
square root. */
double sg,g; /* Guess of the square root of x. */
double sd,d; /* Difference between the square of the guess and x. */
double sy; /* Estimate of 1/2g (overestimated by 1ulp). */
double sy2; /* 2*sy */
double e; /* Difference between y*g and 1/2 (se = e * fsy). */
double shx; /* == sx * fsg */
double fsg; /* sg*fsg == g. */
fenv_t fe; /* Saved floating-point environment (stores rounding
mode and whether the inexact exception is
enabled). */
uint32_t xi0, xi1, sxi, fsgi;
const float *t_sqrt;
fe = fegetenv_register();
EXTRACT_WORDS (xi0,xi1,x);
relax_fenv_state();
sxi = xi0 & 0x3fffffff | 0x3fe00000;
INSERT_WORDS (sx, sxi, xi1);
t_sqrt = __t_sqrt + (xi0 >> 52-32-8-1 & 0x3fe);
sg = t_sqrt[0];
sy = t_sqrt[1];
/* Here we have three Newton-Rhapson iterations each of a
division and a square root and the remainder of the
argument reduction, all interleaved. */
sd = -(sg*sg - sx);
fsgi = xi0 + 0x40000000 >> 1 & 0x7ff00000;
sy2 = sy + sy;
sg = sy*sd + sg; /* 16-bit approximation to sqrt(sx). */
INSERT_WORDS (fsg, fsgi, 0);
e = -(sy*sg - almost_half);
sd = -(sg*sg - sx);
if ((xi0 & 0x7ff00000) == 0)
goto denorm;
sy = sy + e*sy2;
sg = sg + sy*sd; /* 32-bit approximation to sqrt(sx). */
sy2 = sy + sy;
e = -(sy*sg - almost_half);
sd = -(sg*sg - sx);
sy = sy + e*sy2;
shx = sx * fsg;
sg = sg + sy*sd; /* 64-bit approximation to sqrt(sx),
but perhaps rounded incorrectly. */
sy2 = sy + sy;
g = sg * fsg;
e = -(sy*sg - almost_half);
d = -(g*sg - shx);
sy = sy + e*sy2;
fesetenv_register (fe);
return g + sy*d;
denorm:
/* For denormalised numbers, we normalise, calculate the
square root, and return an adjusted result. */
fesetenv_register (fe);
return __sqrt(x * two108) * twom54;
}
}
else if (x < 0)
{
#ifdef FE_INVALID_SQRT
feraiseexcept (FE_INVALID_SQRT);
/* For some reason, some PowerPC processors don't implement
FE_INVALID_SQRT. I guess no-one ever thought they'd be
used for square roots... :-) */
if (!fetestexcept (FE_INVALID))
#endif
feraiseexcept (FE_INVALID);
#ifndef _IEEE_LIBM
if (_LIB_VERSION != _IEEE_)
x = __kernel_standard(x,x,26);
else
#endif
x = *(const float*)&a_nan;
}
return f_wash(x);
}
weak_alias (__sqrt, sqrt)
/* Strictly, this is wrong, but the only places where _ieee754_sqrt is
used will not pass in a negative result. */
strong_alias(__sqrt,__ieee754_sqrt)

View File

@ -1,136 +1 @@
/* Single-precision floating point square root. /* __ieee754_sqrtf is in w_sqrtf.c */
Copyright (C) 1997 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
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 <fenv_libc.h>
#include <inttypes.h>
static const float almost_half = 0.50000006; /* 0.5 + 2^-24 */
static const uint32_t a_nan = 0x7fc00000;
static const uint32_t a_inf = 0x7f800000;
static const float two48 = 281474976710656.0;
static const float twom24 = 5.9604644775390625e-8;
extern const float __t_sqrt[1024];
/* The method is based on a description in
Computation of elementary functions on the IBM RISC System/6000 processor,
P. W. Markstein, IBM J. Res. Develop, 34(1) 1990.
Basically, it consists of two interleaved Newton-Rhapson approximations,
one to find the actual square root, and one to find its reciprocal
without the expense of a division operation. The tricky bit here
is the use of the POWER/PowerPC multiply-add operation to get the
required accuracy with high speed.
The argument reduction works by a combination of table lookup to
obtain the initial guesses, and some careful modification of the
generated guesses (which mostly runs on the integer unit, while the
Newton-Rhapson is running on the FPU). */
float
__sqrtf(float x)
{
const float inf = *(const float *)&a_inf;
/* x = f_washf(x); *//* This ensures only one exception for SNaN. */
if (x > 0)
{
if (x != inf)
{
/* Variables named starting with 's' exist in the
argument-reduced space, so that 2 > sx >= 0.5,
1.41... > sg >= 0.70.., 0.70.. >= sy > 0.35... .
Variables named ending with 'i' are integer versions of
floating-point values. */
float sx; /* The value of which we're trying to find the square
root. */
float sg,g; /* Guess of the square root of x. */
float sd,d; /* Difference between the square of the guess and x. */
float sy; /* Estimate of 1/2g (overestimated by 1ulp). */
float sy2; /* 2*sy */
float e; /* Difference between y*g and 1/2 (note that e==se). */
float shx; /* == sx * fsg */
float fsg; /* sg*fsg == g. */
fenv_t fe; /* Saved floating-point environment (stores rounding
mode and whether the inexact exception is
enabled). */
uint32_t xi, sxi, fsgi;
const float *t_sqrt;
GET_FLOAT_WORD (xi, x);
fe = fegetenv_register ();
relax_fenv_state ();
sxi = xi & 0x3fffffff | 0x3f000000;
SET_FLOAT_WORD (sx, sxi);
t_sqrt = __t_sqrt + (xi >> 23-8-1 & 0x3fe);
sg = t_sqrt[0];
sy = t_sqrt[1];
/* Here we have three Newton-Rhapson iterations each of a
division and a square root and the remainder of the
argument reduction, all interleaved. */
sd = -(sg*sg - sx);
fsgi = xi + 0x40000000 >> 1 & 0x7f800000;
sy2 = sy + sy;
sg = sy*sd + sg; /* 16-bit approximation to sqrt(sx). */
e = -(sy*sg - almost_half);
SET_FLOAT_WORD (fsg, fsgi);
sd = -(sg*sg - sx);
sy = sy + e*sy2;
if ((xi & 0x7f800000) == 0)
goto denorm;
shx = sx * fsg;
sg = sg + sy*sd; /* 32-bit approximation to sqrt(sx),
but perhaps rounded incorrectly. */
sy2 = sy + sy;
g = sg * fsg;
e = -(sy*sg - almost_half);
d = -(g*sg - shx);
sy = sy + e*sy2;
fesetenv_register (fe);
return g + sy*d;
denorm:
/* For denormalised numbers, we normalise, calculate the
square root, and return an adjusted result. */
fesetenv_register (fe);
return __sqrtf(x * two48) * twom24;
}
}
else if (x < 0)
{
#ifdef FE_INVALID_SQRT
feraiseexcept (FE_INVALID_SQRT);
/* For some reason, some PowerPC processors don't implement
FE_INVALID_SQRT. I guess no-one ever thought they'd be
used for square roots... :-) */
if (!fetestexcept (FE_INVALID))
#endif
feraiseexcept (FE_INVALID);
#ifndef _IEEE_LIBM
if (_LIB_VERSION != _IEEE_)
x = __kernel_standard(x,x,126);
else
#endif
x = *(const float*)&a_nan;
}
return f_washf(x);
}
weak_alias (__sqrtf, sqrtf)
/* Strictly, this is wrong, but the only places where _ieee754_sqrt is
used will not pass in a negative result. */
strong_alias(__sqrtf,__ieee754_sqrtf)

View File

@ -0,0 +1 @@
/* __copysignf is in s_copysign.S */

View File

@ -0,0 +1 @@
/* __fabsf is in s_fabs.S */

View File

@ -0,0 +1 @@
/* __isnanf is in s_isnan.c */

141
sysdeps/powerpc/w_sqrt.c Normal file
View File

@ -0,0 +1,141 @@
/* Single-precision floating point square root.
Copyright (C) 1997 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
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 <fenv_libc.h>
#include <inttypes.h>
static const double almost_half = 0.5000000000000001; /* 0.5 + 2^-53 */
static const uint32_t a_nan = 0x7fc00000;
static const uint32_t a_inf = 0x7f800000;
static const float two108 = 3.245185536584267269e+32;
static const float twom54 = 5.551115123125782702e-17;
extern const float __t_sqrt[1024];
/* The method is based on a description in
Computation of elementary functions on the IBM RISC System/6000 processor,
P. W. Markstein, IBM J. Res. Develop, 34(1) 1990.
Basically, it consists of two interleaved Newton-Rhapson approximations,
one to find the actual square root, and one to find its reciprocal
without the expense of a division operation. The tricky bit here
is the use of the POWER/PowerPC multiply-add operation to get the
required accuracy with high speed.
The argument reduction works by a combination of table lookup to
obtain the initial guesses, and some careful modification of the
generated guesses (which mostly runs on the integer unit, while the
Newton-Rhapson is running on the FPU). */
double
__sqrt(double x)
{
const float inf = *(const float *)&a_inf;
/* x = f_wash(x); *//* This ensures only one exception for SNaN. */
if (x > 0)
{
if (x != inf)
{
/* Variables named starting with 's' exist in the
argument-reduced space, so that 2 > sx >= 0.5,
1.41... > sg >= 0.70.., 0.70.. >= sy > 0.35... .
Variables named ending with 'i' are integer versions of
floating-point values. */
double sx; /* The value of which we're trying to find the
square root. */
double sg,g; /* Guess of the square root of x. */
double sd,d; /* Difference between the square of the guess and x. */
double sy; /* Estimate of 1/2g (overestimated by 1ulp). */
double sy2; /* 2*sy */
double e; /* Difference between y*g and 1/2 (se = e * fsy). */
double shx; /* == sx * fsg */
double fsg; /* sg*fsg == g. */
fenv_t fe; /* Saved floating-point environment (stores rounding
mode and whether the inexact exception is
enabled). */
uint32_t xi0, xi1, sxi, fsgi;
const float *t_sqrt;
fe = fegetenv_register();
EXTRACT_WORDS (xi0,xi1,x);
relax_fenv_state();
sxi = xi0 & 0x3fffffff | 0x3fe00000;
INSERT_WORDS (sx, sxi, xi1);
t_sqrt = __t_sqrt + (xi0 >> 52-32-8-1 & 0x3fe);
sg = t_sqrt[0];
sy = t_sqrt[1];
/* Here we have three Newton-Rhapson iterations each of a
division and a square root and the remainder of the
argument reduction, all interleaved. */
sd = -(sg*sg - sx);
fsgi = xi0 + 0x40000000 >> 1 & 0x7ff00000;
sy2 = sy + sy;
sg = sy*sd + sg; /* 16-bit approximation to sqrt(sx). */
INSERT_WORDS (fsg, fsgi, 0);
e = -(sy*sg - almost_half);
sd = -(sg*sg - sx);
if ((xi0 & 0x7ff00000) == 0)
goto denorm;
sy = sy + e*sy2;
sg = sg + sy*sd; /* 32-bit approximation to sqrt(sx). */
sy2 = sy + sy;
e = -(sy*sg - almost_half);
sd = -(sg*sg - sx);
sy = sy + e*sy2;
shx = sx * fsg;
sg = sg + sy*sd; /* 64-bit approximation to sqrt(sx),
but perhaps rounded incorrectly. */
sy2 = sy + sy;
g = sg * fsg;
e = -(sy*sg - almost_half);
d = -(g*sg - shx);
sy = sy + e*sy2;
fesetenv_register (fe);
return g + sy*d;
denorm:
/* For denormalised numbers, we normalise, calculate the
square root, and return an adjusted result. */
fesetenv_register (fe);
return __sqrt(x * two108) * twom54;
}
}
else if (x < 0)
{
#ifdef FE_INVALID_SQRT
feraiseexcept (FE_INVALID_SQRT);
/* For some reason, some PowerPC processors don't implement
FE_INVALID_SQRT. I guess no-one ever thought they'd be
used for square roots... :-) */
if (!fetestexcept (FE_INVALID))
#endif
feraiseexcept (FE_INVALID);
#ifndef _IEEE_LIBM
if (_LIB_VERSION != _IEEE_)
x = __kernel_standard(x,x,26);
else
#endif
x = *(const float*)&a_nan;
}
return f_wash(x);
}
weak_alias (__sqrt, sqrt)
/* Strictly, this is wrong, but the only places where _ieee754_sqrt is
used will not pass in a negative result. */
strong_alias(__sqrt,__ieee754_sqrt)

136
sysdeps/powerpc/w_sqrtf.c Normal file
View File

@ -0,0 +1,136 @@
/* Single-precision floating point square root.
Copyright (C) 1997 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
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 <fenv_libc.h>
#include <inttypes.h>
static const float almost_half = 0.50000006; /* 0.5 + 2^-24 */
static const uint32_t a_nan = 0x7fc00000;
static const uint32_t a_inf = 0x7f800000;
static const float two48 = 281474976710656.0;
static const float twom24 = 5.9604644775390625e-8;
extern const float __t_sqrt[1024];
/* The method is based on a description in
Computation of elementary functions on the IBM RISC System/6000 processor,
P. W. Markstein, IBM J. Res. Develop, 34(1) 1990.
Basically, it consists of two interleaved Newton-Rhapson approximations,
one to find the actual square root, and one to find its reciprocal
without the expense of a division operation. The tricky bit here
is the use of the POWER/PowerPC multiply-add operation to get the
required accuracy with high speed.
The argument reduction works by a combination of table lookup to
obtain the initial guesses, and some careful modification of the
generated guesses (which mostly runs on the integer unit, while the
Newton-Rhapson is running on the FPU). */
float
__sqrtf(float x)
{
const float inf = *(const float *)&a_inf;
/* x = f_washf(x); *//* This ensures only one exception for SNaN. */
if (x > 0)
{
if (x != inf)
{
/* Variables named starting with 's' exist in the
argument-reduced space, so that 2 > sx >= 0.5,
1.41... > sg >= 0.70.., 0.70.. >= sy > 0.35... .
Variables named ending with 'i' are integer versions of
floating-point values. */
float sx; /* The value of which we're trying to find the square
root. */
float sg,g; /* Guess of the square root of x. */
float sd,d; /* Difference between the square of the guess and x. */
float sy; /* Estimate of 1/2g (overestimated by 1ulp). */
float sy2; /* 2*sy */
float e; /* Difference between y*g and 1/2 (note that e==se). */
float shx; /* == sx * fsg */
float fsg; /* sg*fsg == g. */
fenv_t fe; /* Saved floating-point environment (stores rounding
mode and whether the inexact exception is
enabled). */
uint32_t xi, sxi, fsgi;
const float *t_sqrt;
GET_FLOAT_WORD (xi, x);
fe = fegetenv_register ();
relax_fenv_state ();
sxi = xi & 0x3fffffff | 0x3f000000;
SET_FLOAT_WORD (sx, sxi);
t_sqrt = __t_sqrt + (xi >> 23-8-1 & 0x3fe);
sg = t_sqrt[0];
sy = t_sqrt[1];
/* Here we have three Newton-Rhapson iterations each of a
division and a square root and the remainder of the
argument reduction, all interleaved. */
sd = -(sg*sg - sx);
fsgi = xi + 0x40000000 >> 1 & 0x7f800000;
sy2 = sy + sy;
sg = sy*sd + sg; /* 16-bit approximation to sqrt(sx). */
e = -(sy*sg - almost_half);
SET_FLOAT_WORD (fsg, fsgi);
sd = -(sg*sg - sx);
sy = sy + e*sy2;
if ((xi & 0x7f800000) == 0)
goto denorm;
shx = sx * fsg;
sg = sg + sy*sd; /* 32-bit approximation to sqrt(sx),
but perhaps rounded incorrectly. */
sy2 = sy + sy;
g = sg * fsg;
e = -(sy*sg - almost_half);
d = -(g*sg - shx);
sy = sy + e*sy2;
fesetenv_register (fe);
return g + sy*d;
denorm:
/* For denormalised numbers, we normalise, calculate the
square root, and return an adjusted result. */
fesetenv_register (fe);
return __sqrtf(x * two48) * twom24;
}
}
else if (x < 0)
{
#ifdef FE_INVALID_SQRT
feraiseexcept (FE_INVALID_SQRT);
/* For some reason, some PowerPC processors don't implement
FE_INVALID_SQRT. I guess no-one ever thought they'd be
used for square roots... :-) */
if (!fetestexcept (FE_INVALID))
#endif
feraiseexcept (FE_INVALID);
#ifndef _IEEE_LIBM
if (_LIB_VERSION != _IEEE_)
x = __kernel_standard(x,x,126);
else
#endif
x = *(const float*)&a_nan;
}
return f_washf(x);
}
weak_alias (__sqrtf, sqrtf)
/* Strictly, this is wrong, but the only places where _ieee754_sqrt is
used will not pass in a negative result. */
strong_alias(__sqrtf,__ieee754_sqrtf)

View File

@ -0,0 +1,48 @@
/* Copyright (C) 1997 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
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. */
/* Event types that can be polled for. These bits may be set in `events'
to indicate the interesting event types; they will appear in `revents'
to indicate the status of the file descriptor. */
#define POLLIN 0x001 /* There is data to read. */
#define POLLPRI 0x002 /* There is urgent data to read. */
#define POLLOUT 0x004 /* Writing now will not block. */
#ifdef __USE_XOPEN
/* These values are defined in XPG4.2. */
# define POLLRDNORM 0x040 /* Normal data may be read. */
# define POLLRDBAND 0x080 /* Priority data may be read. */
# define POLLWRNORM 0x100 /* Writing now will not block. */
# define POLLWRBAND 0x200 /* Priority data may be written. */
#endif
#ifdef __USE_GNU
/* This is an extension for Linux. */
# define POLLMSG 0x400
#endif
/* Event types always implicitly polled for. These bits need not be set in
`events', but they will appear in `revents' to indicate the status of
the file descriptor. */
#define POLLERR 0x008 /* Error condition. */
#define POLLHUP 0x010 /* Hung up. */
#define POLLNVAL 0x020 /* Invalid polling request. */
/* Canonical number of polling requests to read in at a time in poll. */
#define NPOLLFILE 30

View File

@ -0,0 +1,43 @@
/* Copyright (C) 1997 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
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. */
/* Event types that can be polled for. These bits may be set in `events'
to indicate the interesting event types; they will appear in `revents'
to indicate the status of the file descriptor. */
#define POLLIN 0x001 /* There is data to read. */
#define POLLPRI 0x002 /* There is urgent data to read. */
#define POLLOUT 0x004 /* Writing now will not block. */
#ifdef __USE_XOPEN
/* These values are defined in XPG4.2. */
# define POLLRDNORM 0x040 /* Normal data may be read. */
# define POLLRDBAND 0x080 /* Priority data may be read. */
# define POLLWRNORM POLLOUT /* Writing now will not block. */
# define POLLWRBAND 0x100 /* Priority data may be written. */
#endif
/* Event types always implicitly polled for. These bits need not be set in
`events', but they will appear in `revents' to indicate the status of
the file descriptor. */
#define POLLERR 0x008 /* Error condition. */
#define POLLHUP 0x010 /* Hung up. */
#define POLLNVAL 0x020 /* Invalid polling request. */
/* Canonical number of polling requests to read in at a time in poll. */
#define NPOLLFILE 30

View File

@ -0,0 +1,48 @@
/* Copyright (C) 1997 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
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. */
/* Event types that can be polled for. These bits may be set in `events'
to indicate the interesting event types; they will appear in `revents'
to indicate the status of the file descriptor. */
#define POLLIN 0x001 /* There is data to read. */
#define POLLPRI 0x002 /* There is urgent data to read. */
#define POLLOUT 0x004 /* Writing now will not block. */
#ifdef __USE_XOPEN
/* These values are defined in XPG4.2. */
# define POLLRDNORM 0x040 /* Normal data may be read. */
# define POLLRDBAND 0x080 /* Priority data may be read. */
# define POLLWRNORM POLLOUT /* Writing now will not block. */
# define POLLWRBAND 0x100 /* Priority data may be written. */
#endif
#ifdef __USE_GNU
/* This is an extension for Linux. */
# define POLLMSG 0x400
#endif
/* Event types always implicitly polled for. These bits need not be set in
`events', but they will appear in `revents' to indicate the status of
the file descriptor. */
#define POLLERR 0x008 /* Error condition. */
#define POLLHUP 0x010 /* Hung up. */
#define POLLNVAL 0x020 /* Invalid polling request. */
/* Canonical number of polling requests to read in at a time in poll. */
#define NPOLLFILE 30

View File

@ -17,135 +17,27 @@
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */ Boston, MA 02111-1307, USA. */
#include <elf.h>
#include <sys/types.h> /* The PowerPC's auxiliary argument block gets aligned to a 16-byte
#include <sys/stat.h> boundary. This is history and impossible to change compatibly. */
#include <sys/mman.h>
#include <fcntl.h> #define DL_FIND_ARG_COMPONENTS(cookie, argc, argv, envp, auxp) \
#include <link.h> do { \
#include <unistd.h> void **_tmp; \
(argc) = *(long *) cookie; \
(argv) = (char **) cookie + 1; \
(envp) = (argv) + (argc) + 1; \
for (_tmp = (void **) (envp); *_tmp; ++_tmp) \
continue; \
if (*_tmp == 0 && ((size_t)_tmp & 0xf) != 0) \
{ \
size_t _test = (size_t)_tmp; \
_test = _test + 0xf & ~0xf; \
if (*(long *)_test == AT_PHDR) \
_tmp = (void **)_test; \
} \
(auxp) = (void *) _tmp; \
} while (0)
extern int _dl_argc; #include <sysdeps/unix/sysv/linux/dl-sysdep.c>
extern char **_dl_argv;
extern char **_environ;
extern size_t _dl_pagesize;
extern void _end;
extern void _start (void);
int __libc_enable_secure;
int __libc_multiple_libcs; /* Defining this here avoids the inclusion
of init-first. */
ElfW(Addr)
_dl_sysdep_start (void **start_argptr,
void (*dl_main) (const ElfW(Phdr) *phdr, ElfW(Word) phnum,
ElfW(Addr) *user_entry))
{
const ElfW(Phdr) *phdr = NULL;
ElfW(Word) phnum = 0;
ElfW(Addr) user_entry;
ElfW(auxv_t) *av;
uid_t uid = 0;
uid_t euid = 0;
gid_t gid = 0;
gid_t egid = 0;
unsigned int seen;
user_entry = (ElfW(Addr)) &_start;
_dl_argc = *(long *) start_argptr;
_dl_argv = (char **) start_argptr + 1;
_environ = &_dl_argv[_dl_argc + 1];
start_argptr = (void **) _environ;
while (*start_argptr)
++start_argptr;
++start_argptr;
if (*start_argptr == 0 &&
((unsigned)(char *)start_argptr & 0xF) != 0)
{
unsigned test_sap = (int)(char *)start_argptr;
test_sap = test_sap + 0xF & ~0xF;
if (*(long *)(char *)test_sap == AT_PHDR)
start_argptr = (void **)(char *)test_sap;
}
seen = 0;
#define M(type) (1 << (type))
for (av = (void *) start_argptr;
av->a_type != AT_NULL;
seen |= M ((++av)->a_type))
switch (av->a_type)
{
case AT_PHDR:
phdr = av->a_un.a_ptr;
break;
case AT_PHNUM:
phnum = av->a_un.a_val;
break;
case AT_PAGESZ:
_dl_pagesize = av->a_un.a_val;
break;
case AT_ENTRY:
user_entry = av->a_un.a_val;
break;
case AT_UID:
uid = av->a_un.a_val;
break;
case AT_GID:
gid = av->a_un.a_val;
break;
case AT_EUID:
euid = av->a_un.a_val;
break;
case AT_EGID:
egid = av->a_un.a_val;
break;
}
/* Linux doesn't provide us with any of these values on the stack
when the dynamic linker is run directly as a program. */
#define SEE(UID, uid) if ((seen & M (AT_##UID)) == 0) uid = __get##uid ()
SEE (UID, uid);
SEE (GID, gid);
SEE (EUID, euid);
SEE (EGID, egid);
__libc_enable_secure = uid != euid || gid != egid;
__brk (0); /* Initialize the break. */
if (__sbrk (0) == &_end)
{
/* The dynamic linker was run as a program, and so the initial break
starts just after our bss, at &_end. The malloc in dl-minimal.c
will consume the rest of this page, so tell the kernel to move the
break up that far. When the user program examines its break, it
will see this new value and not clobber our data. */
size_t pg = __getpagesize ();
__sbrk (pg - ((&_end - (void *) 0) & pg));
__sbrk (pg - ((&_end - (void *) 0) & (pg - 1)));
}
(*dl_main) (phdr, phnum, &user_entry);
return user_entry;
}
void
_dl_sysdep_start_cleanup (void)
{
}
#ifndef MAP_ANON
/* This is only needed if the system doesn't support MAP_ANON. */
int
_dl_sysdep_open_zero_fill (void)
{
return __open ("/dev/zero", O_RDONLY);
}
#endif

View File

@ -0,0 +1,43 @@
/* Copyright (C) 1997 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
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. */
/* Event types that can be polled for. These bits may be set in `events'
to indicate the interesting event types; they will appear in `revents'
to indicate the status of the file descriptor. */
#define POLLIN 0x001 /* There is data to read. */
#define POLLPRI 0x002 /* There is urgent data to read. */
#define POLLOUT 0x004 /* Writing now will not block. */
#ifdef __USE_XOPEN
/* These values are defined in XPG4.2. */
# define POLLRDNORM 0x040 /* Normal data may be read. */
# define POLLRDBAND 0x080 /* Priority data may be read. */
# define POLLWRNORM POLLOUT /* Writing now will not block. */
# define POLLWRBAND 0x100 /* Priority data may be written. */
#endif
/* Event types always implicitly polled for. These bits need not be set in
`events', but they will appear in `revents' to indicate the status of
the file descriptor. */
#define POLLERR 0x008 /* Error condition. */
#define POLLHUP 0x010 /* Hung up. */
#define POLLNVAL 0x020 /* Invalid polling request. */
/* Canonical number of polling requests to read in at a time in poll. */
#define NPOLLFILE 30