mirror of
git://sourceware.org/git/glibc.git
synced 2026-09-08 23:58:31 +08:00
Compare commits
126
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
7e165c9059 | ||
|
|
d4fff052ce | ||
|
|
22c4356832 | ||
|
|
6f69fa17e5 | ||
|
|
a23087343b | ||
|
|
ba2ccfa167 | ||
|
|
71c5289b0f | ||
|
|
1893ec6a38 | ||
|
|
e2f8a38f47 | ||
|
|
e16db41ba6 | ||
|
|
13babeb0d3 | ||
|
|
c424f2da59 | ||
|
|
cac34d519a | ||
|
|
b47d1816eb | ||
|
|
8fbe82ee26 | ||
|
|
dd23f3b0d6 | ||
|
|
3365152cb0 | ||
|
|
4b3769bc7c | ||
|
|
cf2b29bfe0 | ||
|
|
98e994340a | ||
|
|
f4a0465b69 | ||
|
|
1908c08641 | ||
|
|
31d7822815 | ||
|
|
9b5225b600 | ||
|
|
f13f1b26e4 | ||
|
|
967578d96c | ||
|
|
421dcdf3a9 | ||
|
|
87a5e8a7a4 | ||
|
|
a2a3fc55fd | ||
|
|
02f25bd59b | ||
|
|
c7b0194ac3 | ||
|
|
885ba00117 | ||
|
|
3cfcebc885 | ||
|
|
2047317f3b | ||
|
|
ac7c207f14 | ||
|
|
a18be620a1 | ||
|
|
177f9d5cd4 | ||
|
|
afc1d235b7 | ||
|
|
c293f9bc63 | ||
|
|
24ea71e942 | ||
|
|
79df061031 | ||
|
|
375676b1b6 | ||
|
|
94f1773041 | ||
|
|
77055d99e4 | ||
|
|
fb63ae13d0 | ||
|
|
44a09a3306 | ||
|
|
579749498e | ||
|
|
52cff2eeb6 | ||
|
|
94f8647f1c | ||
|
|
88f4537c77 | ||
|
|
32fff90d82 | ||
|
|
00aec83a30 | ||
|
|
ff046934fd | ||
|
|
31f43cffe0 | ||
|
|
4c2d948abe | ||
|
|
c5cb336b87 | ||
|
|
8d7899fbb6 | ||
|
|
bca9fd93a8 | ||
|
|
9f3168cf9a | ||
|
|
24a09ef771 | ||
|
|
f0427c13e4 | ||
|
|
347415b76e | ||
|
|
ff407b13b9 | ||
|
|
265ede2a16 | ||
|
|
1bdf7624dc | ||
|
|
95a5089d2f | ||
|
|
760f9f4cd0 | ||
|
|
3a1db3bf88 | ||
|
|
0b7f4318c0 | ||
|
|
3316c605ba | ||
|
|
aa8ecd3c01 | ||
|
|
d35ffac1c7 | ||
|
|
b1f911a801 | ||
|
|
5b2cfa7797 | ||
|
|
3967ae2f20 | ||
|
|
3a7c62f09a | ||
|
|
571286fe50 | ||
|
|
28b5b97f16 | ||
|
|
4db14580ca | ||
|
|
379091f89d | ||
|
|
a6a5f54f28 | ||
|
|
a06faff6c1 | ||
|
|
e3d3d6c990 | ||
|
|
00926c6660 | ||
|
|
2f54e18d8b | ||
|
|
eb3b8b2ea7 | ||
|
|
731640fc24 | ||
|
|
1f574fe0be | ||
|
|
1b4d62a18d | ||
|
|
ce328bf180 | ||
|
|
58f6951944 | ||
|
|
450867ffea | ||
|
|
992b2c400b | ||
|
|
6145c5ea69 | ||
|
|
e3f24cf1bf | ||
|
|
1217a671f4 | ||
|
|
8814d1a72e | ||
|
|
d730f1d27c | ||
|
|
2e12a92961 | ||
|
|
4f72518358 | ||
|
|
655fe31070 | ||
|
|
9652be3de8 | ||
|
|
7434ccadbb | ||
|
|
795fbc9aa1 | ||
|
|
00de59a632 | ||
|
|
7cc27f440c | ||
|
|
6952e59e25 | ||
|
|
1228ed5cd5 | ||
|
|
c0e4567461 | ||
|
|
19361cb768 | ||
|
|
56552e4257 | ||
|
|
831372e7c1 | ||
|
|
bdf289b222 | ||
|
|
33a934a3ab | ||
|
|
5b82669229 | ||
|
|
9d187dd4ad | ||
|
|
8d57beeab1 | ||
|
|
1ef32c3dc4 | ||
|
|
fd26970f33 | ||
|
|
f9c53d1159 | ||
|
|
9381196a94 | ||
|
|
0c5ecdc449 | ||
|
|
5290baf06c | ||
|
|
b51c27c032 | ||
|
|
038ebe2459 | ||
|
|
f94d25d4ee |
+5
-1
@@ -4,7 +4,7 @@
|
||||
TODO COPYING* AUTHORS copyr-* copying.*
|
||||
glibc-*
|
||||
|
||||
configparms
|
||||
configparms
|
||||
|
||||
sun[43]* i[345]86* hp300*
|
||||
|
||||
@@ -13,3 +13,7 @@ ieeetest hppa-sysdeps regex
|
||||
gpl2lgpl.sed
|
||||
distinfo
|
||||
distinfo
|
||||
|
||||
crypt
|
||||
linuxthreads
|
||||
localedata
|
||||
|
||||
+10547
File diff suppressed because it is too large
Load Diff
@@ -74,6 +74,9 @@ please let me know.
|
||||
|
||||
[Q20] ``How can I compile gcc 2.7.2.1 from the gcc source code using
|
||||
glibc 2.x?
|
||||
|
||||
[Q21] ``On Linux I've got problems with the declarations in Linux
|
||||
kernel headers.''
|
||||
|
||||
~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~
|
||||
[Q1] ``What systems does the GNU C Library run on?''
|
||||
@@ -260,7 +263,7 @@ incompatibilities:
|
||||
|
||||
* swapon(): the interface of this function didn't changed, but the
|
||||
prototype is in a separate header file <sys/swap.h>. For the additional
|
||||
argument of of swapon() you should use the SWAP_* constants from
|
||||
argument of swapon() you should use the SWAP_* constants from
|
||||
<linux/swap.h>, which get defined when <sys/swap.h> is included.
|
||||
|
||||
* errno: If a program uses variable "errno", then it _must_ include header
|
||||
@@ -298,6 +301,13 @@ incompatibilities:
|
||||
a separate library libresolv. If you find some symbols starting with
|
||||
`res_*' undefined simply add -lresolv to your call of the linker.
|
||||
|
||||
* the `signal' function's behaviour corresponds to the BSD semantic and
|
||||
not the SysV semantic as it was in libc-5. The interface on all GNU
|
||||
systems shall be the same and BSD is the semantic of choice. To use
|
||||
the SysV behaviour simply use `sysv_signal'. The major difference is
|
||||
that the SysV implementation sets the SA_ONESHOT flag and so the handler
|
||||
gets removed after the first call.
|
||||
|
||||
|
||||
~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~
|
||||
[Q10] ``Why does getlogin() always return NULL on my Linux box?''
|
||||
@@ -365,10 +375,10 @@ catalog files to the XPG4 form:
|
||||
[Q13] ``How do I configure GNU libc so that the essential libraries
|
||||
like libc.so go into /lib and the other into /usr/lib?''
|
||||
|
||||
[A13] {UD} Like all other GNU packages GNU libc is configured to use a
|
||||
base directory and install all files relative to this. If you intend
|
||||
to really use GNU libc on your system this base directory is /usr. I.e.,
|
||||
you run
|
||||
[A13] {UD,AJ} Like all other GNU packages GNU libc is configured to
|
||||
use a base directory and install all files relative to this. If you
|
||||
intend to really use GNU libc on your system this base directory is
|
||||
/usr. I.e., you run
|
||||
configure --prefix=/usr <other_options>
|
||||
|
||||
Some systems like Linux have a filesystem standard which makes a
|
||||
@@ -378,10 +388,10 @@ located on the same disk partition as /. The /usr subtree might be
|
||||
found on another partition/disk.
|
||||
|
||||
To install the essential libraries which come with GNU libc in /lib
|
||||
one must explicitly tell this. Autoconf has no option for this so you
|
||||
have to use the file where all user supplied additional information
|
||||
should go in: `configparms' (see the `INSTALL' file). For Linux the
|
||||
`configparms' file should contain:
|
||||
one must explicitly tell this (except on Linux, see below). Autoconf
|
||||
has no option for this so you have to use the file where all user
|
||||
supplied additional information should go in: `configparms' (see the
|
||||
`INSTALL' file). Therefore the `configparms' file should contain:
|
||||
|
||||
slibdir=/lib
|
||||
sysconfdir=/etc
|
||||
@@ -390,6 +400,10 @@ The first line specifies the directory for the essential libraries,
|
||||
the second line the directory for file which are by tradition placed
|
||||
in a directory named /etc.
|
||||
|
||||
No rule without an exception: If you configure for Linux with
|
||||
--prefix=/usr, then slibdir and sysconfdir will automatically be
|
||||
defined as stated above.
|
||||
|
||||
|
||||
~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~
|
||||
[Q14] ``When linking with the new libc I get unresolved symbols
|
||||
@@ -534,7 +548,7 @@ a different name: ld-linux.so.2. So you have to replace
|
||||
by
|
||||
%{!dynamic-linker:-dynamic-linker=/home/gnu/lib/ld.so.1}
|
||||
|
||||
in the above example specs file ti make it work for other systems.
|
||||
in the above example specs file to make it work for other systems.
|
||||
|
||||
Future versions of GCC will automatically provide the correct specs.
|
||||
|
||||
@@ -594,9 +608,25 @@ is very tricky to compile gcc 2.7.2.1 using glibc 2.x. You have to
|
||||
build it manually or with one pass only. You also have to use the
|
||||
specs file in this FAQ while compiling gcc.
|
||||
|
||||
A pre-compiled binary version of gcc 2.7.2.1 linked with glibc 2.x for
|
||||
Linux/x86 is available in the same directory at the glibc 2.x source
|
||||
code ftp sites.
|
||||
|
||||
~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~
|
||||
[Q21] ``On Linux I've got problems with the declarations in Linux
|
||||
kernel headers.''
|
||||
|
||||
[A21] {UD,AJ} On Linux, the use of kernel headers is reduced to a very
|
||||
minimum. Besides giving Linus the possibility to change the headers
|
||||
more freely it has another reason: user level programs now do not
|
||||
always use the same types like the kernel does.
|
||||
|
||||
I.e., the libc abstracts the use of types. E.g., the sigset_t type is
|
||||
in the kernel 32 or 64 bits wide. In glibc it is 1024 bits wide, in
|
||||
preparation for future development. The reasons are obvious: we don't
|
||||
want to have a new major release when the Linux kernel gets these
|
||||
functionality. Consult the headers for more information about the changes.
|
||||
|
||||
Therefore you shouldn't include Linux kernel header files directly if
|
||||
glibc has defined a replacement. Otherwise you might get undefined
|
||||
results because of type conflicts.
|
||||
|
||||
|
||||
~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~
|
||||
@@ -606,6 +636,7 @@ Answers were given by:
|
||||
{DMT} David Mosberger-Tang, <davidm@AZStarNet.com>
|
||||
{RM} Roland McGrath, <roland@gnu.ai.mit.edu>
|
||||
{HJL} H.J. Lu, <hjl@gnu.ai.mit.edu>
|
||||
{AJ} Andreas Jaeger, <aj@arthur.pfalz.de>
|
||||
|
||||
Local Variables:
|
||||
mode:text
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
# Copyright (C) 1991, 92, 93, 94, 95, 96 Free Software Foundation, Inc.
|
||||
# Copyright (C) 1991, 92, 93, 94, 95, 96, 97 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
|
||||
@@ -12,9 +12,9 @@
|
||||
# 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., 675 Mass Ave,
|
||||
# Cambridge, MA 02139, USA.
|
||||
# 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.
|
||||
|
||||
dist:
|
||||
|
||||
@@ -47,9 +47,6 @@ subdirs := $(filter-out $(add-ons),$(subdirs))
|
||||
# Make sure both stdio and libio get in, whichever is in use.
|
||||
subdirs += stdio libio
|
||||
|
||||
# The same must be true for the malloc directories.
|
||||
subdirs += malloc new-malloc
|
||||
|
||||
sysdep-Subdir-files := $(wildcard $(addsuffix /Subdirs,$(sysdep_dirs)))
|
||||
ifdef sysdep-Subdir-files
|
||||
subdirs := $(sort $(subdirs) \
|
||||
@@ -190,7 +187,6 @@ endef
|
||||
configure: configure.in aclocal.m4; $(autoconf-it)
|
||||
%/configure: %/configure.in aclocal.m4; $(autoconf-it)
|
||||
|
||||
.PHONY: dist
|
||||
dist: $(tardir).tar.gz
|
||||
|
||||
subdir_dist: dist.tar
|
||||
@@ -217,7 +213,7 @@ $(dist-subdirs):
|
||||
$(MAKE) -C $(patsubst dist-%,%,$@) dist
|
||||
|
||||
# This is here instead of in Makefile so it can use $(release) and $(version).
|
||||
README: README.template version.c
|
||||
README: README.template version.h
|
||||
-rm -f $@
|
||||
sed -e 's/RELEASE/$(release)/' -e 's/VERSION/$(version)/' < $< > $@
|
||||
# Make it unwritable so I won't change it by mistake.
|
||||
|
||||
@@ -84,17 +84,22 @@ sources += $(foreach lib,$(extra-libs),$($(lib)-routines:=.c))
|
||||
|
||||
# All different versions of $(sources), preserving the configured sysdep
|
||||
# directory order.
|
||||
# Files that are found in the current directory cannot occur in
|
||||
# sysdep directories, so don't bother searching them.
|
||||
sysdep-sources := $(filter-out $(wildcard $(sources)), $(sources))
|
||||
all-sources = $(wildcard $(sort $(sources) $(sources:.c=.S) $(sources:.c=.s) \
|
||||
$(others:=.c) $(tests:=.c))) \
|
||||
$(foreach dir,$(all-dirs),\
|
||||
$(wildcard \
|
||||
$(addprefix $(dir)/,\
|
||||
$(sort $(sources) $(sources:.c=.S) \
|
||||
$(sources:.c=.s)))))
|
||||
$(sort $(sysdep-sources) \
|
||||
$(sysdep-sources:.c=.S) \
|
||||
$(sysdep-sources:.c=.s)))))
|
||||
|
||||
sysdep-headers := $(filter-out $(wildcard $(headers)), $(headers))
|
||||
all-headers = $(wildcard $(headers)) \
|
||||
$(foreach dir,$(all-dirs),\
|
||||
$(wildcard $(addprefix $(dir)/,$(headers))))
|
||||
$(wildcard $(addprefix $(dir)/,$(sysdep-headers))))
|
||||
|
||||
tags_sources := $(strip $(tags_sources))
|
||||
|
||||
|
||||
+59
-8
@@ -1,4 +1,4 @@
|
||||
# Copyright (C) 1991, 92, 93, 94, 95, 96 Free Software Foundation, Inc.
|
||||
# Copyright (C) 1991, 92, 93, 94, 95, 96, 97 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
|
||||
@@ -12,9 +12,9 @@
|
||||
# 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., 675 Mass Ave,
|
||||
# Cambridge, MA 02139, USA.
|
||||
# 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.
|
||||
|
||||
#
|
||||
# Makefile configuration options for the GNU C library.
|
||||
@@ -91,12 +91,13 @@ export full-config-sysdirs := $(full-config-sysdirs)
|
||||
# changes and so config.status would be run every time; the dependence of
|
||||
# config.make should suffice to force regeneration and re-exec, and the new
|
||||
# image will notice if config.h changed.
|
||||
$(common-objpfx)config.make: $(common-objpfx)config.status $(..)config.h.in
|
||||
$(common-objpfx)config.make: $(common-objpfx)config.status \
|
||||
$(..)config.make.in $(..)config.h.in
|
||||
cd $(<D); $(SHELL) $(<F)
|
||||
|
||||
# Find all the sysdeps configure fragments, to make sure we re-run
|
||||
# configure when any of them changes.
|
||||
$(common-objpfx)config.status: $(..)configure \
|
||||
$(common-objpfx)config.status: $(..)version.h $(..)configure \
|
||||
$(foreach dir,$(full-config-sysdirs),\
|
||||
$(wildcard \
|
||||
$(dir)/Implies) \
|
||||
@@ -146,11 +147,13 @@ endif
|
||||
ifndef libdir
|
||||
libdir = $(exec_prefix)/lib
|
||||
endif
|
||||
inst_libdir = $(install_root)$(libdir)
|
||||
|
||||
# Where to install the shared library and dynamic linker.
|
||||
ifndef slibdir
|
||||
slibdir = $(exec_prefix)/lib
|
||||
endif
|
||||
inst_slibdir = $(install_root)$(slibdir)
|
||||
|
||||
# Prefix to put on files installed in $(libdir). For libraries `libNAME.a',
|
||||
# the prefix is spliced between `lib' and the name, so the linker switch
|
||||
@@ -164,50 +167,64 @@ endif
|
||||
ifndef includedir
|
||||
includedir = $(exec_prefix)/include
|
||||
endif
|
||||
inst_includedir = $(install_root)$(includedir)
|
||||
|
||||
# Where to install machine-independent data files.
|
||||
# These are the timezone database, and the locale database.
|
||||
ifndef datadir
|
||||
datadir = $(prefix)/share
|
||||
endif
|
||||
inst_datadir = $(install_root)$(datadir)
|
||||
|
||||
# Where to install the timezone data files (which are machine-independent).
|
||||
ifndef zonedir
|
||||
zonedir = $(datadir)/zoneinfo
|
||||
endif
|
||||
inst_zonedir = $(install_root)$(zonedir)
|
||||
|
||||
# Where to install the locale and message catalog data files (which are
|
||||
# machine-independent).
|
||||
ifndef localedir
|
||||
localedir = $(datadir)/locale
|
||||
endif
|
||||
inst_localedir = $(install_root)$(localedir)
|
||||
|
||||
# Where to install the locale charmap source files.
|
||||
ifndef i18ndir
|
||||
i18ndir = $(datadir)/i18n
|
||||
endif
|
||||
inst_i18ndir = $(install_root)$(i18ndir)
|
||||
|
||||
|
||||
# Where to install programs.
|
||||
ifndef bindir
|
||||
bindir = $(exec_prefix)/bin
|
||||
endif
|
||||
inst_bindir = $(install_root)$(bindir)
|
||||
|
||||
# Where to install administrative programs.
|
||||
ifndef rootsbindir
|
||||
rootsbindir = $(exec_prefix)/sbin
|
||||
endif
|
||||
inst_rootsbindir = $(install_root)$(rootsbindir)
|
||||
|
||||
ifndef sbindir
|
||||
sbindir = $(exec_prefix)/sbin
|
||||
endif
|
||||
inst_sbindir = $(install_root)$(sbindir)
|
||||
|
||||
# Where to install the Info files.
|
||||
ifndef infodir
|
||||
infodir = $(prefix)/info
|
||||
endif
|
||||
inst_infodir = $(install_root)$(infodir)
|
||||
|
||||
# Where to install default configuration files. These include the local
|
||||
# timezone specification and network data base files.
|
||||
ifndef sysconfdir
|
||||
sysconfdir = $(prefix)/etc
|
||||
endif
|
||||
inst_sysconfdir = $(install_root)$(sysconfdir)
|
||||
|
||||
# What timezone should be the installed default (e.g., US/Eastern).
|
||||
# Run `make -C time echo-zonenames' to see a list of available zone names.
|
||||
@@ -223,6 +240,7 @@ endif
|
||||
# localizing the configuration data elsewhere.
|
||||
ifndef localtime-file
|
||||
localtime-file = $(sysconfdir)/localtime
|
||||
inst_localtime-file = $(install_root)$(localtime-file)
|
||||
endif
|
||||
|
||||
# What to use for leap second specifications in compiling the default
|
||||
@@ -421,7 +439,7 @@ ifdef CFLAGS
|
||||
endif # CFLAGS
|
||||
endif # +cflags
|
||||
|
||||
# If none of the above worked, default to "-g".
|
||||
# If none of the above worked, default to "-g -O".
|
||||
ifeq "$(strip $(+cflags))" ""
|
||||
+cflags := $(default_cflags)
|
||||
endif # $(+cflags) == ""
|
||||
@@ -464,13 +482,14 @@ endif
|
||||
# to pass different flags for each flavor.
|
||||
libtypes = $(foreach o,$(object-suffixes),$(libtype$o))
|
||||
object-suffixes := .o
|
||||
all-object-suffixes := .o .so .po .go
|
||||
libtype.o := lib%.a
|
||||
ifeq (yes,$(build-shared))
|
||||
# Under --enable-shared, we will build a shared library of PIC objects.
|
||||
# The PIC object files are named foo.so.
|
||||
object-suffixes += .so
|
||||
CPPFLAGS-.so = -DPIC
|
||||
CFLAGS-.so = -fPIC
|
||||
CFLAGS-.so = -fPIC -fno-common
|
||||
libtype.so := lib%_pic.a
|
||||
endif
|
||||
ifeq (yes,$(build-profile))
|
||||
@@ -549,6 +568,34 @@ $(common-objpfx)soversions.mk: $(..)shlib-versions $(..)Makeconfig \
|
||||
# Get $(version) defined with the release version number.
|
||||
-include $(common-objpfx)version.mk
|
||||
|
||||
# Generate the header containing the names of all shared libraries.
|
||||
# We use a stamp file to avoid uncessary recompilations.
|
||||
before-compile += $(common-objpfx)gnu/lib-names.h
|
||||
$(common-objpfx)gnu/lib-names.h: $(common-objpfx)gnu/lib-names.stmp
|
||||
$(common-objpfx)gnu/lib-names.stmp: $(common-objpfx)soversions.mk
|
||||
$(make-target-directory)
|
||||
@rm -f ${@:stmp=T} $@
|
||||
(echo '/* This file is automatically generated.';\
|
||||
echo ' It defines macros to allow user program to find the shared';\
|
||||
echo ' library files which come as part of GNU libc. */';\
|
||||
echo '#ifndef __GNU_LIB_NAMES_H'; \
|
||||
echo '#define __GNU_LIB_NAMES_H 1'; \
|
||||
echo; \
|
||||
(libs='$(all-sonames)';\
|
||||
for l in $$libs; do \
|
||||
upname=`echo $$l | sed 's/[.]so.*//' | \
|
||||
tr 'abcdefghijklmnopqrstuvwxyz-' \
|
||||
'ABCDEFGHIJKLMNOPQRSTUVWXYZ_'`; \
|
||||
echo "#define $${upname}_SO \"$$l\""; \
|
||||
done;) | sort; \
|
||||
echo; \
|
||||
echo '#endif /* gnu/lib-names.h */';) > ${@:stmp=T}
|
||||
if test -r ${@:stmp=h} && cmp -s ${@:stmp=h} ${@:stmp=T}; \
|
||||
then rm -f ${@:stmp=T}; \
|
||||
else mv -f ${@:stmp=T} ${@:stmp=h}; fi
|
||||
touch $@
|
||||
|
||||
common-generated += gnu/lib-names.h gnu/lib-names.stmp
|
||||
|
||||
# The name under which the run-time dynamic linker is installed.
|
||||
# We are currently going for the convention that `/lib/ld.so.1'
|
||||
@@ -561,6 +608,10 @@ rtld-installed-name = ld.so.1
|
||||
endif
|
||||
endif
|
||||
|
||||
ifndef rtld-version-installed-name
|
||||
rtld-version-installed-name = ld-$(version).so
|
||||
endif
|
||||
|
||||
endif # build-shared
|
||||
|
||||
endif # Makeconfig not yet included
|
||||
|
||||
@@ -38,7 +38,6 @@ endef
|
||||
|
||||
configure: configure.in aclocal.m4; $(autoconf-it)
|
||||
%/configure: %/configure.in aclocal.m4; $(autoconf-it)
|
||||
config.status: configure version.h; $(SHELL) ./config.status --recheck
|
||||
|
||||
include Makeconfig
|
||||
|
||||
@@ -53,7 +52,7 @@ endif
|
||||
|
||||
# These are the subdirectories containing the library source.
|
||||
subdirs = csu assert ctype db locale intl catgets math setjmp signal stdlib \
|
||||
stdio-common $(stdio) $(malloc) string wcsmbs time dirent grp pwd \
|
||||
stdio-common $(stdio) malloc string wcsmbs time dirent grp pwd \
|
||||
posix io termios resource misc login socket sysvipc gmon gnulib \
|
||||
wctype manual shadow md5-crypt nss $(sysdep-subdirs) po \
|
||||
$(add-ons) elf
|
||||
@@ -86,17 +85,18 @@ subdirs := $(filter mach,$(subdirs)) $(filter hurd,$(subdirs)) \
|
||||
headers := errno.h sys/errno.h errnos.h limits.h values.h \
|
||||
features.h gnu-versions.h libc-lock.h xopen_lim.h
|
||||
aux = sysdep $(libc-init) version
|
||||
before-compile = $(objpfx)version-info.h
|
||||
before-compile += $(objpfx)version-info.h
|
||||
|
||||
echo-headers: subdir_echo-headers
|
||||
|
||||
# What to install.
|
||||
install-others = $(includedir)/gnu/stubs.h
|
||||
ifeq (yes,$(build-shared))
|
||||
install-others += $(includedir)/gnu/lib-names.h
|
||||
endif
|
||||
install-others = $(inst_includedir)/gnu/stubs.h
|
||||
install-bin = glibcbug
|
||||
|
||||
ifeq (yes,$(build-shared))
|
||||
install-others += $(inst_includedir)/gnu/lib-names.h
|
||||
endif
|
||||
|
||||
ifeq (yes,$(gnu-ld))
|
||||
libc-init = set-init
|
||||
else
|
||||
@@ -113,6 +113,16 @@ include Makerules
|
||||
# Install from subdirectories too.
|
||||
install: subdir_install
|
||||
|
||||
# Create linkfs for shared libraries using the `ldconfig' program is possible.
|
||||
# Ignore the error if we cannot update /etc/ld.so.cache.
|
||||
ifeq (no,$(cross-compiling))
|
||||
ifeq (yes,$(build-shared))
|
||||
install:
|
||||
-test ! -x $(common-objpfx)elf/ldconfig || \
|
||||
$(common-objpfx)elf/ldconfig -d $(inst_slibdir) $(inst_libdir)
|
||||
endif
|
||||
endif
|
||||
|
||||
# Build subdirectory lib objects.
|
||||
lib-noranlib: subdir_lib
|
||||
|
||||
@@ -170,7 +180,7 @@ subdir-stubs := $(foreach dir,$(subdirs),$(common-objpfx)stub-$(dir))
|
||||
# iterates over all the subdirs; subdir_install in each subdir depends on
|
||||
# the subdir's stubs file. Having more direct dependencies would result in
|
||||
# extra iterations over the list for subdirs and many recursive makes.
|
||||
$(includedir)/gnu/stubs.h: subdir_install
|
||||
$(inst_includedir)/gnu/stubs.h: subdir_install
|
||||
@rm -f $(objpfx)stubs.h
|
||||
(echo '/* This file is automatically generated.';\
|
||||
echo ' It defines a symbol `__stub_FUNCTION'\'' for each function';\
|
||||
@@ -184,39 +194,21 @@ $(includedir)/gnu/stubs.h: subdir_install
|
||||
|
||||
ifeq (yes,$(build-shared))
|
||||
|
||||
# Like gnu/stubs.h the gnu/lib-names.h header is not used while building the
|
||||
# libc itself. So we generate it while installing.
|
||||
$(includedir)/gnu/lib-names.h: $(common-objpfx)soversions.mk
|
||||
@rm -f $(objpfx)lib-names.h
|
||||
(echo '/* This file is automatically generated.';\
|
||||
echo ' It defines macros to allow user program to find the shared';\
|
||||
echo ' library files which come as part of GNU libc. */';\
|
||||
echo '#ifndef __GNU_LIB_NAMES_H'; \
|
||||
echo '#define __GNU_LIB_NAMES_H 1'; \
|
||||
echo; \
|
||||
(libs='$(all-sonames)';\
|
||||
for l in $$libs; do \
|
||||
upname=`echo $$l | sed 's/[.]so.*//' | \
|
||||
tr '[:lower:]-' '[:upper:]_'`; \
|
||||
echo "#define $${upname}_SO $$l"; \
|
||||
done;) | sort; \
|
||||
echo; \
|
||||
echo '#endif /* gnu/lib-names.h */';) > $(objpfx)lib-names.h
|
||||
if test -r $@ && cmp -s $(objpfx)lib-names.h $@; \
|
||||
$(inst_includedir)/gnu/lib-names.h: $(common-objpfx)gnu/lib-names.h
|
||||
if test -r $@ && cmp -s $< $@; \
|
||||
then echo 'gnu/lib-names.h unchanged'; \
|
||||
else $(INSTALL_DATA) $(objpfx)lib-names.h $@; fi
|
||||
rm -f $(objpfx)lib-names.h
|
||||
else $(INSTALL_DATA) $< $@; fi
|
||||
endif
|
||||
|
||||
# The `glibcbug' script contains the version number and it shall be rebuild
|
||||
# whenever this changes or the `glibcbug.in' file.
|
||||
glibcbug: glibcbug.in config.status
|
||||
CONFIG_FILES=$@ CONFIG_HEADERS= $(SHELL) ./config.status
|
||||
$(objpfx)glibcbug: $(common-objpfx)config.status glibcbug.in
|
||||
cd $(<D); CONFIG_FILES=$(@F) CONFIG_HEADERS= $(SHELL) $(<F)
|
||||
|
||||
# This makes the Info or DVI file of the documentation from the Texinfo source.
|
||||
.PHONY: info dvi
|
||||
info dvi:
|
||||
$(MAKE) -C manual $@
|
||||
$(MAKE) $(PARALLELMFLAGS) -C manual $@
|
||||
|
||||
# This makes all the subdirectory targets.
|
||||
|
||||
@@ -230,7 +222,7 @@ all-subdirs-targets := $(foreach dir,$(subdirs),\
|
||||
# The action for each of those is to cd into the directory and make the
|
||||
# target there.
|
||||
$(all-subdirs-targets):
|
||||
$(MAKE) -C $(@D) $(@F)
|
||||
$(MAKE) $(PARALLELMFLAGS) -C $(@D) $(@F)
|
||||
|
||||
.PHONY: $(+subdir_targets) $(all-subdirs-targets)
|
||||
|
||||
@@ -296,12 +288,13 @@ distribute := README INSTALL FAQ NOTES NEWS PROJECTS \
|
||||
config.h.in config.make.in config-name.in Makefile.in \
|
||||
autolock.sh rellns-sh munch-tmpl.c munch.awk interp.c \
|
||||
sysdep.h set-hooks.h libc-symbols.h version.h shlib-versions \
|
||||
rpm/Makefile rpm/template rpm/rpmrc nsswitch.h netgroup.h
|
||||
rpm/Makefile rpm/template rpm/rpmrc nsswitch.h netgroup.h \
|
||||
mcheck.h glibcbug.in
|
||||
|
||||
distribute := $(strip $(distribute))
|
||||
generated := $(generated) stubs.h version-info.h
|
||||
|
||||
README: README.template version.c ; # Make-dist should update README.
|
||||
README: README.template version.h ; # Make-dist should update README.
|
||||
|
||||
define format-me
|
||||
@rm -f $@
|
||||
@@ -312,4 +305,10 @@ INSTALL: manual/maint.texi; $(format-me)
|
||||
NOTES: manual/creature.texi; $(format-me)
|
||||
|
||||
rpm/%: subdir_distinfo
|
||||
$(MAKE) -C $(@D) subdirs='$(subdirs)' $(@F)
|
||||
$(MAKE) $(PARALLELMFLAGS) -C $(@D) subdirs='$(subdirs)' $(@F)
|
||||
|
||||
# This is a special goal for people making binary distributions. Normally
|
||||
# everybody uses the DES based crypt library but for the distribution we
|
||||
# need the only-MD5 based one as well.
|
||||
md5-crypt/libmd5crypt:
|
||||
$(MAKE) $(PARALLELMFLAGS) -C $(@D) $(@F)
|
||||
|
||||
+4
-1
@@ -2,5 +2,8 @@
|
||||
|
||||
srcdir = @srcdir@
|
||||
|
||||
# Uncomment the line below if you want to do parallel build.
|
||||
# PARALLELMFLAGS = -j 4
|
||||
|
||||
all .DEFAULT:
|
||||
$(MAKE) -C $(srcdir) objdir=`pwd` $@
|
||||
$(MAKE) PARALLELMFLAGS="$(PARALLELMFLAGS)" -C $(srcdir) objdir=`pwd` $@
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
# Copyright (C) 1991, 92, 93, 94, 95, 96 Free Software Foundation, Inc.
|
||||
# Copyright (C) 1991, 92, 93, 94, 95, 96, 97 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
|
||||
@@ -26,7 +26,7 @@ This makefile requires GNU Make.
|
||||
endif
|
||||
|
||||
REQUIRED_MAKE_VERSION = 3.74
|
||||
REAL_MAKE_VERSION = $(shell echo "$(MAKE_VERSION)" | sed 's/ .*//')
|
||||
REAL_MAKE_VERSION = $(firstword $(MAKE_VERSION))
|
||||
|
||||
ifneq ($(REQUIRED_MAKE_VERSION), \
|
||||
$(firstword $(sort $(REAL_MAKE_VERSION) $(REQUIRED_MAKE_VERSION))))
|
||||
@@ -238,7 +238,7 @@ $(+sysdir_pfx)sysd-rules: $(+sysdir_pfx)config.make $(..)Makerules \
|
||||
/*) dir=$$sysdir ;; \
|
||||
*) dir="\$$(..)$$sysdir" ;; \
|
||||
esac; \
|
||||
for o in $(object-suffixes); do \
|
||||
for o in $(all-object-suffixes); do \
|
||||
$(open-check-inhibit-asm) \
|
||||
echo "\$$(objpfx)%$$o: $$dir/%.S \$$(before-compile); \
|
||||
\$$(compile-command.S)"; \
|
||||
@@ -292,7 +292,8 @@ define +make-deps
|
||||
$(make-target-directory)
|
||||
-@rm -f $@
|
||||
$(+mkdep) $< $(CPPFLAGS) $($(<:$*.%=%)-CPPFLAGS) | \
|
||||
sed -e 's,$(subst .,\.,$*)\.o,$(foreach o,$(object-suffixes),$(@:.d=$o)) $@,' \
|
||||
sed \
|
||||
-e 's,$(subst .,\.,$*)\.o,$(foreach o,$(all-object-suffixes),$(@:.d=$o)) $@,' \
|
||||
$(sed-remove-objpfx) > $(@:.d=.T)
|
||||
mv -f $(@:.d=.T) $@
|
||||
endef
|
||||
@@ -338,12 +339,16 @@ $(LINK.o) -shared -o $@ $(sysdep-LDFLAGS) $(config-LDFLAGS) \
|
||||
-L$(subst :, -L,$(rpath-link)) -Wl,-rpath-link=$(rpath-link) \
|
||||
-Wl,--whole-archive $^ $(no-whole-archive) \
|
||||
$(LDLIBS-$(@F:lib%.so=%).so)
|
||||
test -z "$($(@F)-version)" || \
|
||||
(rm -f $@$($(@F)-version); $(LN_S) $(@F) $@$($(@F)-version))
|
||||
endef
|
||||
|
||||
# Don't try to use -lc when making libc.so itself.
|
||||
# Also omits crti.o and crtn.o, which we do not want
|
||||
# since we define our own `.init' section specially.
|
||||
LDFLAGS-c.so = -nostdlib -nostartfiles
|
||||
# But we still want to link libc.so against -lgcc.
|
||||
LDLIBS-c.so = -lgcc
|
||||
# Give libc.so an entry point and make it directly runnable itself.
|
||||
LDFLAGS-c.so += -e __libc_main
|
||||
# Use our own special initializer and finalizer files for libc.so.
|
||||
@@ -351,12 +356,6 @@ $(common-objpfx)libc.so: $(elfobjdir)/soinit.so \
|
||||
$(common-objpfx)libc_pic.a \
|
||||
$(elfobjdir)/sofini.so $(elfobjdir)/ld.so
|
||||
$(build-shlib)
|
||||
|
||||
ifdef libc.so-version
|
||||
$(common-objpfx)libc.so$(libc.so-version): $(common-objpfx)libc.so
|
||||
rm -f $@
|
||||
ln -s $(<F) $@ || ln $< $@
|
||||
endif
|
||||
endif
|
||||
|
||||
# Some files must not be compiled with the exception handler mechanism
|
||||
@@ -567,11 +566,11 @@ endef
|
||||
# to install everything it changes.
|
||||
ifdef objects
|
||||
installed-libcs := $(foreach o,$(object-suffixes),\
|
||||
$(libdir)/$(patsubst %,$(libtype$o),\
|
||||
$(libprefix)$(libc-name)))
|
||||
$(inst_libdir)/$(patsubst %,$(libtype$o),\
|
||||
$(libprefix)$(libc-name)))
|
||||
installed-libcs := $(filter-out %_pic.a,$(installed-libcs))
|
||||
install: $(installed-libcs)
|
||||
$(installed-libcs): $(libdir)/lib$(libprefix)%: lib
|
||||
$(installed-libcs): $(inst_libdir)/lib$(libprefix)%: lib
|
||||
$(make-target-directory)
|
||||
$(INSTALL_DATA) $(common-objpfx)lib$(*:$(libc-name)%=c%) $@
|
||||
# Running ranlib after installing makes the __.SYMDEF time stamp up to
|
||||
@@ -589,15 +588,15 @@ install-lib.so := $(filter %.so,$(install-lib:%_pic.a=%.so))
|
||||
install-lib := $(filter-out %.so %_pic.a,$(install-lib))
|
||||
ifeq (yes,$(build-shared))
|
||||
|
||||
install-lib-nosubdir: $(install-lib.so:%=$(libdir)/%)
|
||||
install-lib-nosubdir: $(install-lib.so:%=$(inst_libdir)/%)
|
||||
|
||||
# Find which .so's have versions.
|
||||
versioned := $(strip $(foreach so,$(install-lib.so),\
|
||||
$(patsubst %,$(so),$($(so)-version))))
|
||||
|
||||
# Install all the unversioned shared libraries.
|
||||
$(addprefix $(slibdir)/,$(filter-out $(versioned),$(install-lib.so))): \
|
||||
$(slibdir)/%.so: $(objpfx)%.so; $(do-install-program)
|
||||
$(addprefix $(inst_slibdir)/, $(filter-out $(versioned),$(install-lib.so))): \
|
||||
$(inst_slibdir)/%.so: $(objpfx)%.so; $(do-install-program)
|
||||
|
||||
ifneq ($(findstring -s,$(LN_S)),)
|
||||
define make-link
|
||||
@@ -614,25 +613,40 @@ mv -f $@.new $@
|
||||
endef
|
||||
endif
|
||||
|
||||
# XXX The following will have to be changed when `ldconfig' is available.
|
||||
ifneq (yes,$(cross-compiling))
|
||||
ifeq (yes,$(has-ldconfig))
|
||||
define make-shlib-link
|
||||
@:
|
||||
endef
|
||||
endif
|
||||
endif
|
||||
ifndef make-shlib-link
|
||||
define make-shlib-link
|
||||
$(make-link)
|
||||
endef
|
||||
endif
|
||||
|
||||
ifdef libc.so-version
|
||||
# For a library specified to be version N, install three files:
|
||||
# libc.so -> libc.so.N (e.g. libc.so.6)
|
||||
# libc.so.6 -> libc-VERSION.so (e.g. libc-1.10.so)
|
||||
|
||||
$(slibdir)/libc.so$(libc.so-version): $(slibdir)/libc-$(version).so
|
||||
$(make-link)
|
||||
$(slibdir)/libc-$(version).so: $(common-objpfx)libc.so; $(do-install-program)
|
||||
install: $(slibdir)/libc.so$(libc.so-version)
|
||||
$(inst_slibdir)/libc.so$(libc.so-version): $(inst_slibdir)/libc-$(version).so
|
||||
$(make-shlib-link)
|
||||
$(inst_slibdir)/libc-$(version).so: $(common-objpfx)libc.so
|
||||
$(do-install-program)
|
||||
install: $(inst_slibdir)/libc.so$(libc.so-version)
|
||||
|
||||
ifndef subdir
|
||||
# What we install as libc.so for programs to link against is in fact a
|
||||
# link script. It contains references for the various libraries we need.
|
||||
# The libc.so object is not complete since some functions are only defined
|
||||
# in libc.a and the dynamic linker is an etra object.
|
||||
install: $(libdir)/libc.so
|
||||
$(libdir)/libc.so: $(common-objpfx)libc.so$(libc.so-version) \
|
||||
$(elfobjdir)/$(rtld-installed-name) \
|
||||
$(libdir)/lib$(libc-name).a
|
||||
install: $(inst_libdir)/libc.so
|
||||
$(inst_libdir)/libc.so: $(common-objpfx)libc.so$(libc.so-version) \
|
||||
$(elfobjdir)/$(rtld-installed-name) \
|
||||
$(inst_libdir)/lib$(libc-name).a
|
||||
(echo '/* GNU ld script';\
|
||||
echo ' Use the shared library, but some functions are only in';\
|
||||
echo ' the static library, so try that secondarily.'; \
|
||||
@@ -645,8 +659,9 @@ $(libdir)/libc.so: $(common-objpfx)libc.so$(libc.so-version) \
|
||||
endif
|
||||
|
||||
else
|
||||
install: $(slibdir)/libc.so
|
||||
$(slibdir)/libc.so: $(common-objpfx)libc.so; $(do-install-program)
|
||||
install: $(inst_slibdir)/libc.so
|
||||
$(inst_slibdir)/libc.so: $(common-objpfx)libc.so
|
||||
$(do-install-program)
|
||||
endif
|
||||
|
||||
|
||||
@@ -654,7 +669,7 @@ ifneq (,$(versioned))
|
||||
# Produce three sets of rules as above for all the smaller versioned libraries.
|
||||
|
||||
define o-iterator-doit
|
||||
$(libdir)/$o: $(slibdir)/$o$($o-version); $$(make-link)
|
||||
$(inst_libdir)/$o: $(inst_slibdir)/$o$($o-version); $$(make-link)
|
||||
endef
|
||||
object-suffixes-left := $(versioned)
|
||||
include $(o-iterator)
|
||||
@@ -670,26 +685,28 @@ include $(o-iterator)
|
||||
|
||||
ifeq (,$($(subdir)-version))
|
||||
define o-iterator-doit
|
||||
$(slibdir)/$o$($o-version): $(slibdir)/$(o:.so=)-$(version).so; $$(make-link)
|
||||
$(inst_slibdir)/$o$($o-version): $(inst_slibdir)/$(o:.so=)-$(version).so;
|
||||
$$(make-shlib-link)
|
||||
endef
|
||||
object-suffixes-left := $(versioned)
|
||||
include $(o-iterator)
|
||||
|
||||
define o-iterator-doit
|
||||
$(slibdir)/$(o:.so=)-$(version).so: $(objpfx)$o; $$(do-install-program)
|
||||
$(inst_slibdir)/$(o:.so=)-$(version).so: $(objpfx)$o; $$(do-install-program)
|
||||
endef
|
||||
object-suffixes-left := $(versioned)
|
||||
include $(o-iterator)
|
||||
else
|
||||
define o-iterator-doit
|
||||
$(slibdir)/$o$($o-version): $(slibdir)/$(o:.so=)-$($(subdir)-version).so;
|
||||
$$(make-link)
|
||||
$(inst_slibdir)/$o$($o-version): \
|
||||
$(inst_slibdir)/$(o:.so=)-$($(subdir)-version).so;
|
||||
$$(make-shlib-link)
|
||||
endef
|
||||
object-suffixes-left := $(versioned)
|
||||
include $(o-iterator)
|
||||
|
||||
define o-iterator-doit
|
||||
$(slibdir)/$(o:.so=)-$($(subdir)-version).so: $(objpfx)$o;
|
||||
$(inst_slibdir)/$(o:.so=)-$($(subdir)-version).so: $(objpfx)$o;
|
||||
$$(do-install-program)
|
||||
endef
|
||||
object-suffixes-left := $(versioned)
|
||||
@@ -705,54 +722,62 @@ endef
|
||||
|
||||
so-versions := $(sort $(foreach so,$(install-lib.so),.so$($(so)-version)))
|
||||
$(foreach v,$(so-versions),\
|
||||
$(slibdir)/lib$(libprefix)%$v): $(common-objpfx)lib%.so
|
||||
$(inst_slibdir)/lib$(libprefix)%$v): $(common-objpfx)lib%.so
|
||||
$(do-install-so)
|
||||
$(foreach v,$(so-versions),\
|
||||
$(slibdir)/$(libprefix)%$v): $(common-objpfx)%.so
|
||||
$(inst_slibdir)/$(libprefix)%$v): $(common-objpfx)%.so
|
||||
$(do-install-so)
|
||||
endif
|
||||
|
||||
ifdef install-bin
|
||||
$(addprefix $(bindir)/,$(install-bin)): $(bindir)/%: $(objpfx)%
|
||||
$(addprefix $(inst_bindir)/,$(install-bin)): $(inst_bindir)/%: $(objpfx)%
|
||||
$(do-install-program)
|
||||
endif
|
||||
ifdef install-rootsbin
|
||||
$(addprefix $(inst_rootsbindir)/,$(install-rootsbin)):
|
||||
$(inst_rootsbindir)/%: $(objpfx)%
|
||||
$(do-install-program)
|
||||
endif
|
||||
ifdef install-sbin
|
||||
$(addprefix $(sbindir)/,$(install-sbin)): $(sbindir)/%: $(objpfx)%
|
||||
$(addprefix $(inst_sbindir)/,$(install-sbin)): $(inst_sbindir)/%: $(objpfx)%
|
||||
$(do-install-program)
|
||||
endif
|
||||
ifdef install-lib
|
||||
install-lib.a := $(filter lib%.a,$(install-lib))
|
||||
install-lib-non.a := $(filter-out lib%.a,$(install-lib))
|
||||
ifdef install-lib-non.a
|
||||
$(addprefix $(libdir)/$(libprefix),$(install-lib-non.a)): \
|
||||
$(libdir)/$(libprefix)%: $(objpfx)%
|
||||
$(addprefix $(inst_libdir)/$(libprefix),$(install-lib-non.a)): \
|
||||
$(inst_libdir)/$(libprefix)%: $(objpfx)%
|
||||
$(do-install)
|
||||
endif
|
||||
ifdef install-lib.a
|
||||
$(install-lib.a:lib%.a=$(libdir)/lib$(libprefix)%.a): \
|
||||
$(libdir)/lib$(libprefix)%.a: $(objpfx)lib%.a
|
||||
$(install-lib.a:lib%.a=$(inst_libdir)/lib$(libprefix)%.a): \
|
||||
$(inst_libdir)/lib$(libprefix)%.a: $(objpfx)lib%.a
|
||||
$(do-install)
|
||||
$(patsubst %,$(RANLIB) $@,$(filter-out $(non-lib.a),$(<F)))
|
||||
endif
|
||||
endif
|
||||
ifdef install-data
|
||||
$(addprefix $(datadir)/,$(install-data)): $(datadir)/%: %;$(do-install)
|
||||
$(addprefix $(inst_datadir)/,$(install-data)): $(inst_datadir)/%: %;
|
||||
$(do-install)
|
||||
endif
|
||||
headers := $(strip $(headers))
|
||||
ifdef headers
|
||||
$(addprefix $(includedir)/,$(headers)): \
|
||||
$(includedir)/%: %;$(do-install)
|
||||
$(addprefix $(inst_includedir)/,$(headers)): $(inst_includedir)/%: %;
|
||||
$(do-install)
|
||||
endif # headers
|
||||
|
||||
.PHONY: install-bin-nosubdir install-sbin-nosubdir install-lib-nosubdir \
|
||||
install-data-nosubdir install-headers-nosubdir
|
||||
install-bin-nosubdir: $(addprefix $(bindir)/,$(install-bin))
|
||||
install-sbin-nosubdir: $(addprefix $(sbindir)/,$(install-sbin))
|
||||
install-lib-nosubdir: $(addprefix $(libdir)/,\
|
||||
.PHONY: install-bin-nosubdir install-rootsbin-nosubdir install-sbin-nosubdir \
|
||||
install-lib-nosubdir install-data-nosubdir install-headers-nosubdir
|
||||
install-bin-nosubdir: $(addprefix $(inst_bindir)/,$(install-bin))
|
||||
install-rootsbin-nosubdir: \
|
||||
$(addprefix $(inst_rootsbindir)/,$(install-rootsbin))
|
||||
install-sbin-nosubdir: $(addprefix $(inst_sbindir)/,$(install-sbin))
|
||||
install-lib-nosubdir: $(addprefix $(inst_libdir)/,\
|
||||
$(patsubst lib%.a,lib$(libprefix)%.a,$(install-lib.a)) \
|
||||
$(addprefix $(libprefix),$(install-lib-non.a)))
|
||||
install-data-nosubdir: $(addprefix $(datadir)/,$(install-data))
|
||||
install-headers-nosubdir: $(addprefix $(includedir)/,$(headers))
|
||||
install-data-nosubdir: $(addprefix $(inst_datadir)/,$(install-data))
|
||||
install-headers-nosubdir: $(addprefix $(inst_includedir)/,$(headers))
|
||||
install-others-nosubdir: $(install-others)
|
||||
|
||||
# We need all the `-nosubdir' targets so that `install' in the parent
|
||||
@@ -764,7 +789,8 @@ install-%:: install-%-nosubdir ;
|
||||
.PHONY: install install-no-libc.a-nosubdir
|
||||
install-no-libc.a-nosubdir: install-headers-nosubdir install-data-nosubdir\
|
||||
install-bin-nosubdir install-lib-nosubdir \
|
||||
install-others-nosubdir install-sbin-nosubdir
|
||||
install-others-nosubdir install-rootsbin-nosubdir \
|
||||
install-sbin-nosubdir
|
||||
install: install-no-libc.a-nosubdir
|
||||
|
||||
# Command to compile $< in $(objdir) using the native libraries.
|
||||
@@ -781,7 +807,7 @@ $(BUILD_CC) $(BUILD_CFLAGS) $(<:$(common-objpfx)%=$(..)%) -o $(..)$(@F)
|
||||
endef
|
||||
|
||||
# We always want to use configuration definitions.
|
||||
BUILD_CFLAGS = -include $(..)config.h
|
||||
BUILD_CFLAGS = -include $(common-objpfx)config.h
|
||||
|
||||
# Support the GNU standard name for this target.
|
||||
.PHONY: check
|
||||
@@ -823,6 +849,7 @@ endef
|
||||
# Also remove the dependencies and generated source files.
|
||||
common-clean: common-mostlyclean
|
||||
-rm -f $(addprefix $(objpfx),$(generated)) $(+depfiles)
|
||||
-rm -fr $(addprefix $(objpfx),$(generated-dirs))
|
||||
-rm -f $(addprefix $(common-objpfx),$(common-generated))
|
||||
-rm -f $(common-objpfx)distinfo-$(subdir)
|
||||
|
||||
|
||||
@@ -1,9 +1,30 @@
|
||||
GNU C Library NEWS -- history of user-visible changes. 25 August 1996
|
||||
GNU C Library NEWS -- history of user-visible changes. 26 January 1997
|
||||
|
||||
Copyright (C) 1992, 93, 94, 95, 96 Free Software Foundation, Inc.
|
||||
Copyright (C) 1992, 93, 94, 95, 96, 97 Free Software Foundation, Inc.
|
||||
See the end for copying conditions.
|
||||
|
||||
Please send GNU C library bug reports to bug-glibc@prep.ai.mit.edu.
|
||||
Please send GNU C library bug reports using the `glibcbug' script to
|
||||
<bugs@gnu.ai.mit.edu>. Questions and suggestions should be send to
|
||||
<bug-glibc@prep.ai.mit.edu>.
|
||||
|
||||
Version 2.0.2
|
||||
|
||||
* more bug fixes
|
||||
|
||||
* add atoll function
|
||||
|
||||
* fix complex problems in Berkeley DB code
|
||||
|
||||
Version 2.0.1
|
||||
|
||||
* fixed lots of header problems (especially Linux/GNU specific)
|
||||
|
||||
* dynamic loader preserves all registers
|
||||
|
||||
* Roland McGrath provided support for handling of auxiliary objects in
|
||||
the ELF dynamic loader.
|
||||
|
||||
* support for parallel builds is improved
|
||||
|
||||
Version 2.0
|
||||
|
||||
@@ -34,7 +55,9 @@ Version 2.0
|
||||
are enabled, the new library `-ldl' is available for arbitrary run-time
|
||||
loading of shared objects; its interface is defined in <dlfcn.h>. The
|
||||
new header file <link.h> gives access to the internals of the run-time
|
||||
dynamic linker, `ld.so'.
|
||||
dynamic linker, `ld.so'. The shell script `ldd' is similar to the
|
||||
application of same name on other systems and it provides information
|
||||
about dynamically linked binaries.
|
||||
|
||||
* The C library now provides the run-time support code for profiling
|
||||
executables compiled with `-pg'. Programs can control the profiling code
|
||||
@@ -43,18 +66,22 @@ Version 2.0
|
||||
the support for this file format was contributed by David Mosberger-Tang.
|
||||
|
||||
* The math code has been replaced with a math library based on fdlibm from
|
||||
Sun, and modified by JT Conklin with i387 support and by Ian Taylor with
|
||||
`float' functions. The math functions now reside in a separate library,
|
||||
so programs using them will need to use `-lm' their linking commands.
|
||||
Sun, and modified by JT Conklin and Ulrich Drepper with i387 support, by
|
||||
Ian Taylor with `float' functions and by Ulrich Drepper with `long double'
|
||||
functions. The math functions now reside in a separate library, so
|
||||
programs using them will need to use `-lm' their linking commands.
|
||||
|
||||
* John C. Bowman contributed optimized ix87 assembler inline functions.
|
||||
|
||||
* Ulrich Drepper has contributed support for an `/etc/nsswitch.conf'
|
||||
mechanism similar to that found in Solaris 2. This is now used for the
|
||||
group, passwd, hosts, networks, services, protocols, and rpc databases.
|
||||
The `nsswitch.conf' file controls what services are used for each
|
||||
individual database. This works by loading shared libraries with names
|
||||
specified in `nsswitch.conf', so service modules can be changed or added at
|
||||
any time without even relinking any program. A future release of the
|
||||
separate NYS package will provide NIS/YP and NIS+ modules for this interface.
|
||||
group, passwd, hosts, networks, services, protocols, rpc, ethers,
|
||||
shadow, netgroup, publickey, and alias databases. The `nsswitch.conf'
|
||||
file controls what services are used for each individual database. This
|
||||
works by loading shared libraries with names specified in `nsswitch.conf',
|
||||
so service modules can be changed or added at any time without even
|
||||
relinking any program. Currently there are the file, db, and NIS based
|
||||
NSS services available.
|
||||
|
||||
* The new functions `strtoq' and `strtouq' parse integer values from
|
||||
strings, like `strtol' and `strtoul', but they return `long long int' and
|
||||
@@ -69,13 +96,25 @@ Version 2.0
|
||||
`strtod', `strtof', and `strtold'. These new functions are perfectly
|
||||
accurate, and much faster than the old ones.
|
||||
|
||||
* The implementation of the POSIX locale model was completely rewritten by
|
||||
Ulrich Drepper. This includes the new programs `localedef' and `locale'
|
||||
to compile the POSIX locale definition.
|
||||
|
||||
* The former dummy implementations of the strcoll and strxfrm function are
|
||||
now replaced by fully functional code contributed by Ulrich Drepper. The
|
||||
collation information comes from the POSIX locale definitions.
|
||||
|
||||
* The new header <langinfo.h> defines an interface for accessing
|
||||
various locale-dependent data (using the locale chosen with `setlocale').
|
||||
|
||||
* Ulrich Drepper has contributed a new suite of functions for operation on
|
||||
wide-character and multibyte-character strings, in <wcstr.h> and <mbstr.h>;
|
||||
wide-character and multibyte-character strings, in <wchar.h>;
|
||||
and classification and case conversion of wide characters, in <wctype.h>.
|
||||
These new functions are intended to conform to the ISO C specification.
|
||||
These new functions are conforming to the ISO C, Amendement 1 specification.
|
||||
|
||||
* There is now a second implementation of the standard I/O library available.
|
||||
It comes from GNU libg++ as was written by Per Bothner, heavily modified
|
||||
by Hongjiu Lu and made thread safe by Ulrich Drepper.
|
||||
|
||||
* You can now use positional parameter specifications in format strings
|
||||
for the `printf' and `scanf' families of functions. For example,
|
||||
@@ -104,7 +143,9 @@ Version 2.0
|
||||
* The new header file <fts.h> and suite of functions simplify programs that
|
||||
operate on directory trees. This code comes from 4.4 BSD.
|
||||
|
||||
* The resolver code has been updated from the BIND 4.9.5-T4B release.
|
||||
* The resolver code has been updated from the BIND 4.9.5-P1 release.
|
||||
Parts of the code were heavily modified by Ulrich Drepper to fit in the
|
||||
NSS scheme used in glibc.
|
||||
|
||||
* The new function `malloc_find_object_address' finds the starting address
|
||||
of a malloc'd block, given any address within the block;
|
||||
@@ -132,7 +173,9 @@ Version 2.0
|
||||
|
||||
* The new functions `ecvt', `fcvt', and `gcvt' provide an obsolete interface
|
||||
for formatting floating-point numbers. They are provided only for
|
||||
compatibility; new programs should use `sprintf' instead.
|
||||
compatibility; new programs should use `sprintf' instead. There are
|
||||
also equivalent function for the `long double' floating-point type and
|
||||
all functions also exist in a reentrant form.
|
||||
|
||||
* The new auxiliary library `-lutil' from 4.4 BSD contains various
|
||||
functions for maintaining the login-record files (primarily of use to
|
||||
@@ -156,13 +199,17 @@ Version 2.0
|
||||
|
||||
* Ulrich Drepper has updated the Linux-specific code, based largely
|
||||
on work done in Hongjiu Lu's version of GNU libc for Linux.
|
||||
The GNU library now supports Linux versions 1.3.29 and later,
|
||||
using the ELF object file format (i[345]86-*-linux).
|
||||
The GNU library now supports Linux versions 2.0.10 and later,
|
||||
using the ELF object file format (i[3456]86-*-linux).
|
||||
|
||||
* Andreas Schwab has ported the C library to Linux/m68k (m68k-*-linux).
|
||||
|
||||
* David Mosberger-Tang has ported the C library to Linux/Alpha (alpha-*-linux).
|
||||
Richard Henderson contributed the dynamic linking support for ELF/Alpha.
|
||||
* David Mosberger-Tang and Richard Henderson have ported the C library
|
||||
to Linux/Alpha (alpha-*-linux). Richard Henderson contributed the
|
||||
dynamic linking support for ELF/Alpha.
|
||||
|
||||
* Richard Henderson contributed several Alpha optimized assembler function
|
||||
for arithmetic and string handling.
|
||||
|
||||
* Ulrich Drepper has contributed a new set of message catalog functions to
|
||||
support multiple languages using the <libintl.h> interface, for use with
|
||||
@@ -199,6 +246,7 @@ Version 2.0
|
||||
POSIX.2 `glob' function to do ~ and {...} expansion.
|
||||
|
||||
* New function `unsetenv' complements `setenv' for compatibility with 4.4 BSD.
|
||||
`clearenv' which is used in POSIX.9 is also available.
|
||||
|
||||
* New function `getsid' returns session ID number on systems that support it.
|
||||
|
||||
@@ -212,7 +260,9 @@ Version 2.0
|
||||
space from `alloca' instead of dynamic heap space from `malloc'.
|
||||
|
||||
* New function `strnlen' is like `strlen' but searches only a given maximum
|
||||
number of characters for the null terminator.
|
||||
number of characters for the null terminator. `stpncpy', `strndup' and
|
||||
`strndupa' are similar variants for the `stpcpy', `strdup' and `strdupa'
|
||||
function.
|
||||
|
||||
* New function `statfs' in header <sys/statfs.h>.
|
||||
|
||||
@@ -222,6 +272,46 @@ Version 2.0
|
||||
|
||||
* A new suite of functions in <utmp.h> handle all the details of reading
|
||||
and writing the utmp file.
|
||||
|
||||
* An implementation of the NIS/YP(tm) based NSS service was contributed by
|
||||
Thorsten Kukuk.
|
||||
|
||||
* Paul Eggert and Ulrich Drepper modified the `strftime' function to be
|
||||
completely POSIX compliant and also implemented the extended functionality
|
||||
to handle alternate digit representation and alternate era date formats.
|
||||
|
||||
* Ulrich Drepper provided an implementation of the `strptime' function
|
||||
defined in XPG4.2 which transforms a string into a `struct tm' value.
|
||||
|
||||
* Paul Eggert provided the tzselect shell script as part of the timezone
|
||||
code. The shell script makes it easy to select the correct timezone
|
||||
specification.
|
||||
|
||||
* The implementation of the malloc family of functions is completely replaced
|
||||
by a new implementation by Doug Lea with many improvements by Wolfram Gloger.
|
||||
The implementation uses the mmap function (if available) and it is
|
||||
optimized for the use in multi threaded programs.
|
||||
|
||||
* Ulrich Drepper contributed a MD5 "encryption" for the crypt family of
|
||||
functions. This new functionality is usable by specifying a special
|
||||
salt string and it is compatible with implementation on *BSD systems.
|
||||
|
||||
* Lots of functions from the XPG4.2 standard were added by Ulrich Drepper:
|
||||
`getsubopt' to handle second level command line options, `bsd_signal'
|
||||
to access BSD style `signal' functionality, the obsolete `regexp' style
|
||||
expression matcher.
|
||||
|
||||
* the `lchown' function is available on system which support this
|
||||
functionality.
|
||||
|
||||
* The implementation of the shadow password handling function was contributed
|
||||
by Ulrich Drepper.
|
||||
|
||||
* David Mosberger-Tang changed the SunRPC implementation to be 64bit safe.
|
||||
|
||||
* POSIX.1g support was added. The <sys/select.h> header is available,
|
||||
`isfdtype' and `pselect' are implemented. Craig Metz contributed an
|
||||
implementation of `getaddrinfo'.
|
||||
|
||||
Version 1.09
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
Open jobs for finishing GNU libc:
|
||||
---------------------------------
|
||||
Status: October 1996
|
||||
Status: January 1997
|
||||
|
||||
If you have time and talent to take over any of the jobs below please
|
||||
contact <bug-glibc@prep.ai.mit.edu>
|
||||
@@ -10,6 +10,8 @@ contact <bug-glibc@prep.ai.mit.edu>
|
||||
[ 1] Port to new platforms or test current version on formerly supported
|
||||
platforms.
|
||||
|
||||
**** See http://www.gnu.org/software/libc/porting.html for more details.
|
||||
|
||||
|
||||
[ 2] Test compliance with standards. If you have access to recent
|
||||
standards (IEEE, ISO, ANSI, X/Open, ...) and/or test suites you
|
||||
@@ -31,6 +33,8 @@ contact <bug-glibc@prep.ai.mit.edu>
|
||||
|
||||
Implementation idea: use some functions from bash.
|
||||
|
||||
**** Somebody is working on this. Help may or may not be appreciated.
|
||||
|
||||
|
||||
[ 5] Write `long double' versions of the math functions. This should be
|
||||
done in collaboration with the NetBSD and FreeBSD people.
|
||||
@@ -83,5 +87,15 @@ contact <bug-glibc@prep.ai.mit.edu>
|
||||
[11] Rewrite utmp/wtmp functions to use database functions. This is much
|
||||
better than the normal flat file format.
|
||||
|
||||
Please contact bug-glibc@prep.ai.mit.edu before starting to avoid
|
||||
duplicated work.
|
||||
**** There are plans for a new approach to this problem. Please contact
|
||||
bug-glibc@prep.ai.mit.edu before starting to work.)
|
||||
|
||||
|
||||
[12] Several more or less small functions have to be written:
|
||||
|
||||
+ tcgetid() and waitid() from XPG4.2
|
||||
+ grantpt(), ptsname(), unlockpt() from XPG4.2
|
||||
+ getdate() from XPG4.2
|
||||
+ fmtmsg() from SVID
|
||||
|
||||
More information are available on request.
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
This directory contains the version 1.96 test release of the GNU C Library.
|
||||
This directory contains the version 2.0.1 test release of the GNU C Library.
|
||||
Many bugs have been fixed since the last release.
|
||||
Some bugs surely remain.
|
||||
|
||||
@@ -6,9 +6,9 @@ As of this release, the GNU C library is known to run on the following
|
||||
configurations:
|
||||
|
||||
*-*-gnu GNU Hurd
|
||||
i[3456]86-*-linux Linux-2.0 on Intel
|
||||
m68k-*-linux Linux-2.0 on Motorola 680x0
|
||||
alpha-*-linux Linux-2.0 on DEC Alpha
|
||||
i[3456]86-*-linux-gnu Linux-2.0 on Intel
|
||||
m68k-*-linux-gnu Linux-2.0 on Motorola 680x0
|
||||
alpha-*-linux-gnu Linux-2.0 on DEC Alpha
|
||||
|
||||
|
||||
Former releases of this library (version 1.09.1 and perhaps earlier
|
||||
@@ -39,38 +39,50 @@ versions) used to run on the following configurations:
|
||||
Whether this is still true for this release is unknown. Porting the
|
||||
library is not hard. If you are interested in doing a port, please
|
||||
get on the mailing list by sending electronic mail to
|
||||
bug-glibc-request@prep.ai.mit.edu.
|
||||
<bug-glibc-request@prep.ai.mit.edu>.
|
||||
|
||||
The GNU C library now includes Michael Glad's Ultra Fast Crypt, which
|
||||
provides the Unix `crypt' function, plus some other entry points.
|
||||
Because of the United States export restriction on DES implementations,
|
||||
we are distributing this code separately from the rest of the C
|
||||
library. There is an extra distribution tar file just for crypt; it is
|
||||
called `glibc-1.96-crypt.tar.gz'. You can just unpack the crypt
|
||||
called `glibc-crypt-2.0.1.tar.gz'. You can just unpack the crypt
|
||||
distribution along with the rest of the C library and build; you can
|
||||
also build the library without getting crypt. Users outside the USA
|
||||
can get the crypt distribution via anonymous FTP from ftp.uni-c.dk
|
||||
[129.142.6.74], or another archive site outside the USA. Archive
|
||||
can get the crypt distribution via anonymous FTP from ftp.ifi.uio.no
|
||||
[129.240.64.21], or another archive site outside the USA. Archive
|
||||
maintainers are encouraged to copy this distribution to their archives
|
||||
outside the USA. Please get it from ftp.uni-c.dk; transferring this
|
||||
outside the USA. Please get it from ftp.ifi.uio.no; transferring this
|
||||
distribution from prep.ai.mit.edu (or any other site in the USA) to a
|
||||
site outside the USA is in violation of US export laws.
|
||||
|
||||
Beside the separate crypt tar file there are some more add-ons which can be
|
||||
used together with GNU libc. They are designed in a way to ease the
|
||||
installation by integrating them in the libc source tree. Simply get the
|
||||
add-ons you need and use the --enable-add-ons option of the `configure'
|
||||
script to tell where the add-ons are found. Please read the FAQ file for
|
||||
more details.
|
||||
|
||||
See the file INSTALL to find out how to configure, build, install, and port
|
||||
the GNU C library.
|
||||
the GNU C library. You might also consider reading the WWW pages for the
|
||||
GNU libc at http://www.gnu.org/software/libc/libc.html.
|
||||
|
||||
The GNU C Library is completely documented by the Texinfo manual found
|
||||
in the `manual/' subdirectory. The manual is still being updated and
|
||||
contains some known errors and omissions; we regret that we do not have
|
||||
the resources to work on the manual as much as we would like. Please
|
||||
send comments on the manual to bug-glibc-manual@prep.ai.mit.edu, and
|
||||
send comments on the manual to <bug-glibc-manual@prep.ai.mit.edu>, and
|
||||
not to the library bug-reporting address.
|
||||
|
||||
The file NOTES contains a description of the feature-test macros used
|
||||
in the GNU C library, explaining how you can tell the library what
|
||||
facilities you want it to make available.
|
||||
|
||||
Send bug reports to bug-glibc@prep.ai.mit.edu.
|
||||
We prefer to get bug reports sent using the `glibcbug' shell script which
|
||||
is install together with the rest of the GNU libc to <bugs@gnu.ai.mit.edu>.
|
||||
Simply run this shell script and fill in the information. Nevertheless
|
||||
you can still send bug reports to <bug-glibc@prep.ai.mit.edu> as normal
|
||||
electronic mails.
|
||||
|
||||
The GNU C Library is free software. See the file COPYING.LIB for copying
|
||||
conditions.
|
||||
|
||||
+23
-11
@@ -6,9 +6,9 @@ As of this release, the GNU C library is known to run on the following
|
||||
configurations:
|
||||
|
||||
*-*-gnu GNU Hurd
|
||||
i[3456]86-*-linux Linux-2.0 on Intel
|
||||
m68k-*-linux Linux-2.0 on Motorola 680x0
|
||||
alpha-*-linux Linux-2.0 on DEC Alpha
|
||||
i[3456]86-*-linux-gnu Linux-2.0 on Intel
|
||||
m68k-*-linux-gnu Linux-2.0 on Motorola 680x0
|
||||
alpha-*-linux-gnu Linux-2.0 on DEC Alpha
|
||||
|
||||
|
||||
Former releases of this library (version 1.09.1 and perhaps earlier
|
||||
@@ -39,38 +39,50 @@ versions) used to run on the following configurations:
|
||||
Whether this is still true for this release is unknown. Porting the
|
||||
library is not hard. If you are interested in doing a port, please
|
||||
get on the mailing list by sending electronic mail to
|
||||
bug-glibc-request@prep.ai.mit.edu.
|
||||
<bug-glibc-request@prep.ai.mit.edu>.
|
||||
|
||||
The GNU C library now includes Michael Glad's Ultra Fast Crypt, which
|
||||
provides the Unix `crypt' function, plus some other entry points.
|
||||
Because of the United States export restriction on DES implementations,
|
||||
we are distributing this code separately from the rest of the C
|
||||
library. There is an extra distribution tar file just for crypt; it is
|
||||
called `glibc-VERSION-crypt.tar.gz'. You can just unpack the crypt
|
||||
called `glibc-crypt-VERSION.tar.gz'. You can just unpack the crypt
|
||||
distribution along with the rest of the C library and build; you can
|
||||
also build the library without getting crypt. Users outside the USA
|
||||
can get the crypt distribution via anonymous FTP from ftp.uni-c.dk
|
||||
[129.142.6.74], or another archive site outside the USA. Archive
|
||||
can get the crypt distribution via anonymous FTP from ftp.ifi.uio.no
|
||||
[129.240.64.21], or another archive site outside the USA. Archive
|
||||
maintainers are encouraged to copy this distribution to their archives
|
||||
outside the USA. Please get it from ftp.uni-c.dk; transferring this
|
||||
outside the USA. Please get it from ftp.ifi.uio.no; transferring this
|
||||
distribution from prep.ai.mit.edu (or any other site in the USA) to a
|
||||
site outside the USA is in violation of US export laws.
|
||||
|
||||
Beside the separate crypt tar file there are some more add-ons which can be
|
||||
used together with GNU libc. They are designed in a way to ease the
|
||||
installation by integrating them in the libc source tree. Simply get the
|
||||
add-ons you need and use the --enable-add-ons option of the `configure'
|
||||
script to tell where the add-ons are found. Please read the FAQ file for
|
||||
more details.
|
||||
|
||||
See the file INSTALL to find out how to configure, build, install, and port
|
||||
the GNU C library.
|
||||
the GNU C library. You might also consider reading the WWW pages for the
|
||||
GNU libc at http://www.gnu.org/software/libc/libc.html.
|
||||
|
||||
The GNU C Library is completely documented by the Texinfo manual found
|
||||
in the `manual/' subdirectory. The manual is still being updated and
|
||||
contains some known errors and omissions; we regret that we do not have
|
||||
the resources to work on the manual as much as we would like. Please
|
||||
send comments on the manual to bug-glibc-manual@prep.ai.mit.edu, and
|
||||
send comments on the manual to <bug-glibc-manual@prep.ai.mit.edu>, and
|
||||
not to the library bug-reporting address.
|
||||
|
||||
The file NOTES contains a description of the feature-test macros used
|
||||
in the GNU C library, explaining how you can tell the library what
|
||||
facilities you want it to make available.
|
||||
|
||||
Send bug reports to bug-glibc@prep.ai.mit.edu.
|
||||
We prefer to get bug reports sent using the `glibcbug' shell script which
|
||||
is install together with the rest of the GNU libc to <bugs@gnu.ai.mit.edu>.
|
||||
Simply run this shell script and fill in the information. Nevertheless
|
||||
you can still send bug reports to <bug-glibc@prep.ai.mit.edu> as normal
|
||||
electronic mails.
|
||||
|
||||
The GNU C Library is free software. See the file COPYING.LIB for copying
|
||||
conditions.
|
||||
|
||||
@@ -39,7 +39,8 @@ export subdir := $(subdir)
|
||||
all: objs lib others
|
||||
|
||||
others: $(addprefix $(objpfx),$(extra-objs) \
|
||||
$(install-lib) $(install-bin) $(install-sbin))
|
||||
$(install-lib) $(install-bin) \
|
||||
$(install-rootsbin) $(install-sbin))
|
||||
|
||||
ifneq "$(findstring env,$(origin headers))" ""
|
||||
headers :=
|
||||
|
||||
+4
-4
@@ -1,4 +1,4 @@
|
||||
# Copyright (C) 1991, 1994 Free Software Foundation, Inc.
|
||||
# Copyright (C) 1991, 1994, 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
|
||||
@@ -12,9 +12,9 @@
|
||||
# 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., 675 Mass Ave,
|
||||
# Cambridge, MA 02139, USA.
|
||||
# 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.
|
||||
|
||||
#
|
||||
# Sub-makefile for assert portion of the library.
|
||||
|
||||
+12
-13
@@ -1,23 +1,22 @@
|
||||
# Copyright (C) 1994 Free Software Foundation, Inc.
|
||||
# Contributed by Joel Sherrill (jsherril@redstone-emh2.army.mil),
|
||||
# On-Line Applications Research Corporation.
|
||||
#
|
||||
# Copyright (C) 1994, 1997 Free Software Foundation, Inc.
|
||||
# This file is part of the GNU C Library.
|
||||
#
|
||||
# Contributed by Joel Sherrill (jsherril@redstone-emh2.army.mil),
|
||||
# On-Line Applications Research Corporation.
|
||||
#
|
||||
# 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., 675 Mass Ave,
|
||||
# Cambridge, MA 02139, USA.
|
||||
# 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.
|
||||
|
||||
subdir := bare
|
||||
|
||||
@@ -33,11 +32,11 @@ include ../Rules
|
||||
#
|
||||
# For bare targets, the $(config-vendor) is the name of the board.
|
||||
# We will place the board dependent code ONLY in a library which
|
||||
# is board dependent. This way many target boards can share a
|
||||
# is board dependent. This way many target boards can share a
|
||||
# single libc.a. To resolve all symbols and successfully link
|
||||
# a program, the application must link against libc.a and libMY_TARGET.a.
|
||||
# For example, the target specific library for the Motorola MVME135
|
||||
# board will be named libmvme135.a. To link a program for the
|
||||
# For example, the target specific library for the Motorola MVME135
|
||||
# board will be named libmvme135.a. To link a program for the
|
||||
# MVME135, one must link against -lc and -lmvme135.
|
||||
#
|
||||
|
||||
|
||||
+12
-3
@@ -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.
|
||||
Contributed by Ulrich Drepper, <drepper@gnu.ai.mit.edu>.
|
||||
|
||||
@@ -34,6 +34,7 @@ catopen (const char *cat_name, int flag)
|
||||
{
|
||||
__nl_catd result;
|
||||
const char *env_var;
|
||||
const char *nlspath;
|
||||
|
||||
result = (__nl_catd) malloc (sizeof (*result));
|
||||
if (result == NULL)
|
||||
@@ -82,8 +83,16 @@ catopen (const char *cat_name, int flag)
|
||||
return (nl_catd) -1;
|
||||
}
|
||||
|
||||
if (__secure_getenv ("NLSPATH") != NULL)
|
||||
result->nlspath = __strdup (getenv ("NLSPATH"));
|
||||
nlspath = __secure_getenv ("NLSPATH");
|
||||
if (nlspath != NULL && *nlspath != '\0')
|
||||
{
|
||||
/* Append the system dependent directory. */
|
||||
size_t len = strlen (nlspath + 1 + sizeof NLSPATH);
|
||||
char *tmp = alloca (len);
|
||||
|
||||
__stpcpy (__stpcpy (__stpcpy (tmp, nlspath), ":"), NLSPATH);
|
||||
nlspath = tmp;
|
||||
}
|
||||
else
|
||||
result->nlspath = __strdup (NLSPATH);
|
||||
|
||||
|
||||
+1
-1
@@ -141,7 +141,7 @@ main (int argc, char *argv[])
|
||||
header_name = NULL;
|
||||
result = NULL;
|
||||
|
||||
while ((opt = getopt_long (argc, argv, "hH:o:V", long_options, NULL)) != EOF)
|
||||
while ((opt = getopt_long (argc, argv, "hH:o:V", long_options, NULL)) != -1)
|
||||
switch (opt)
|
||||
{
|
||||
case '\0': /* Long option. */
|
||||
|
||||
@@ -35,6 +35,14 @@
|
||||
This is defined by configure under --enable-libio. */
|
||||
#undef USE_IN_LIBIO
|
||||
|
||||
/* Define if using ELF and the assembler supports the `.previous'
|
||||
directive. */
|
||||
#undef HAVE_ASM_PREVIOUS_DIRECTIVE
|
||||
|
||||
/* Define if using ELF and the assembler supports the `.popsection'
|
||||
directive. */
|
||||
#undef HAVE_ASM_POPSECTION_DIRECTIVE
|
||||
|
||||
/*
|
||||
*/
|
||||
|
||||
|
||||
+9
-2
@@ -3,10 +3,16 @@
|
||||
# Don't edit this file. Put configuration parameters in configparms instead.
|
||||
|
||||
# Installation prefixes.
|
||||
install_root =
|
||||
prefix = @prefix@
|
||||
exec_prefix = @exec_prefix@
|
||||
slibdir = @libc_cv_slibdir@
|
||||
sysconfdir = @libc_cv_sysconfdir@
|
||||
rootsbindir = @libc_cv_rootsbindir@
|
||||
|
||||
# If ldconfig exists. This will go away as soon as `ldconfig' is available
|
||||
# in GNU libc.
|
||||
has-ldconfig = @has_ldconfig@
|
||||
|
||||
# System configuration.
|
||||
config-machine = @host_cpu@
|
||||
@@ -15,7 +21,7 @@ config-vendor = @host_vendor@
|
||||
config-os = @host_os@
|
||||
config-sysdirs = @sysnames@
|
||||
|
||||
defines = @DEFINES@ @USE_NEW_MALLOC@
|
||||
defines = @DEFINES@
|
||||
|
||||
elf = @elf@
|
||||
have-initfini = @libc_cv_have_initfini@
|
||||
@@ -23,6 +29,7 @@ have-initfini = @libc_cv_have_initfini@
|
||||
have-no-whole-archive = @libc_cv_ld_no_whole_archive@
|
||||
have-no-exceptions = @libc_cv_gcc_no_exceptions@
|
||||
have-bash2 = @libc_cv_have_bash2@
|
||||
have-ksh = @libc_cv_have_ksh@
|
||||
|
||||
# Configuration options.
|
||||
gnu-as = @gnu_as@
|
||||
@@ -31,7 +38,6 @@ build-shared = @shared@
|
||||
build-profile = @profile@
|
||||
build-omitfp = @omitfp@
|
||||
stdio = @stdio@
|
||||
malloc = @malloc@
|
||||
add-ons = @subdirs@
|
||||
|
||||
# Build tools.
|
||||
@@ -49,5 +55,6 @@ INSTALL_DATA = @INSTALL_DATA@
|
||||
LN_S = @LN_S@
|
||||
MSGFMT = @MSGFMT@
|
||||
BASH = @BASH@
|
||||
KSH = @KSH@
|
||||
|
||||
# More variables may be inserted below by configure.
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
# From configure.in CVSid
|
||||
# Guess values for system-dependent variables and create Makefiles.
|
||||
# Generated automatically using autoconf version 2.11.2
|
||||
# Generated automatically using autoconf version 2.12
|
||||
# Copyright (C) 1992, 93, 94, 95, 96 Free Software Foundation, Inc.
|
||||
#
|
||||
# This configure script is free software; the Free Software Foundation
|
||||
@@ -28,9 +28,6 @@ ac_help="$ac_help
|
||||
--with-elf if using the ELF object format"
|
||||
ac_help="$ac_help
|
||||
--enable-libio build in GNU libio instead of GNU stdio"
|
||||
ac_help="$ac_help
|
||||
--enable-new-malloc use the new malloc implementation. This is the
|
||||
default for Linux, others use the old malloc."
|
||||
ac_help="$ac_help
|
||||
--disable-sanity-checks really do not use threads (should not be used
|
||||
except in special situations) [default=yes]"
|
||||
@@ -363,7 +360,7 @@ EOF
|
||||
verbose=yes ;;
|
||||
|
||||
-version | --version | --versio | --versi | --vers)
|
||||
echo "configure generated by autoconf version 2.11.2"
|
||||
echo "configure generated by autoconf version 2.12"
|
||||
exit 0 ;;
|
||||
|
||||
-with-* | --with-*)
|
||||
@@ -646,19 +643,6 @@ else
|
||||
fi
|
||||
|
||||
|
||||
# Check whether --enable-new-malloc or --disable-new-malloc was given.
|
||||
if test "${enable_new_malloc+set}" = set; then
|
||||
enableval="$enable_new_malloc"
|
||||
if test $enableval = yes; then
|
||||
malloc=new-malloc
|
||||
else
|
||||
malloc=malloc
|
||||
fi
|
||||
else
|
||||
malloc=default
|
||||
fi
|
||||
|
||||
|
||||
# Check whether --enable-sanity-checks or --disable-sanity-checks was given.
|
||||
if test "${enable_sanity_checks+set}" = set; then
|
||||
enableval="$enable_sanity_checks"
|
||||
@@ -736,7 +720,7 @@ else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; }
|
||||
fi
|
||||
|
||||
echo $ac_n "checking host system type""... $ac_c" 1>&6
|
||||
echo "configure:740: checking host system type" >&5
|
||||
echo "configure:724: checking host system type" >&5
|
||||
|
||||
host_alias=$host
|
||||
case "$host_alias" in
|
||||
@@ -816,7 +800,7 @@ esac
|
||||
# This can take a while to compute.
|
||||
sysdep_dir=$srcdir/sysdeps
|
||||
echo $ac_n "checking sysdep dirs""... $ac_c" 1>&6
|
||||
echo "configure:820: checking sysdep dirs" >&5
|
||||
echo "configure:804: checking sysdep dirs" >&5
|
||||
# Make sco3.2v4 become sco3.2.4 and sunos4.1.1_U1 become sunos4.1.1.U1.
|
||||
os="`echo $os | sed 's/\([0-9A-Z]\)[v_]\([0-9A-Z]\)/\1.\2/g'`"
|
||||
|
||||
@@ -1017,7 +1001,7 @@ echo "$ac_t""sysdeps/generic sysdeps/stub" 1>&6
|
||||
# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
|
||||
# ./install, which can be erroneously created by make from ./install.sh.
|
||||
echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6
|
||||
echo "configure:1021: checking for a BSD compatible install" >&5
|
||||
echo "configure:1005: checking for a BSD compatible install" >&5
|
||||
if test -z "$INSTALL"; then
|
||||
if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then
|
||||
echo $ac_n "(cached) $ac_c" 1>&6
|
||||
@@ -1071,7 +1055,7 @@ if test "$INSTALL" = "${srcdir}/install-sh -c"; then
|
||||
INSTALL='$(..)./install-sh -c'
|
||||
fi
|
||||
echo $ac_n "checking whether ln -s works""... $ac_c" 1>&6
|
||||
echo "configure:1075: checking whether ln -s works" >&5
|
||||
echo "configure:1059: checking whether ln -s works" >&5
|
||||
if eval "test \"`echo '$''{'ac_cv_prog_LN_S'+set}'`\" = set"; then
|
||||
echo $ac_n "(cached) $ac_c" 1>&6
|
||||
else
|
||||
@@ -1096,7 +1080,7 @@ do
|
||||
# Extract the first word of "$ac_prog", so it can be a program name with args.
|
||||
set dummy $ac_prog; ac_word=$2
|
||||
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
|
||||
echo "configure:1100: checking for $ac_word" >&5
|
||||
echo "configure:1084: checking for $ac_word" >&5
|
||||
if eval "test \"`echo '$''{'ac_cv_prog_MSGFMT'+set}'`\" = set"; then
|
||||
echo $ac_n "(cached) $ac_c" 1>&6
|
||||
else
|
||||
@@ -1127,7 +1111,7 @@ test -n "$MSGFMT" || MSGFMT=":"
|
||||
|
||||
|
||||
echo $ac_n "checking build system type""... $ac_c" 1>&6
|
||||
echo "configure:1131: checking build system type" >&5
|
||||
echo "configure:1115: checking build system type" >&5
|
||||
|
||||
build_alias=$build
|
||||
case "$build_alias" in
|
||||
@@ -1153,7 +1137,7 @@ fi
|
||||
# Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args.
|
||||
set dummy ${ac_tool_prefix}gcc; ac_word=$2
|
||||
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
|
||||
echo "configure:1157: checking for $ac_word" >&5
|
||||
echo "configure:1141: checking for $ac_word" >&5
|
||||
if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
|
||||
echo $ac_n "(cached) $ac_c" 1>&6
|
||||
else
|
||||
@@ -1185,7 +1169,7 @@ if test $host != $build; then
|
||||
# Extract the first word of "gcc cc", so it can be a program name with args.
|
||||
set dummy gcc cc; ac_word=$2
|
||||
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
|
||||
echo "configure:1189: checking for $ac_word" >&5
|
||||
echo "configure:1173: checking for $ac_word" >&5
|
||||
if eval "test \"`echo '$''{'ac_cv_prog_BUILD_CC'+set}'`\" = set"; then
|
||||
echo $ac_n "(cached) $ac_c" 1>&6
|
||||
else
|
||||
@@ -1212,7 +1196,7 @@ fi
|
||||
|
||||
fi
|
||||
echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
|
||||
echo "configure:1216: checking how to run the C preprocessor" >&5
|
||||
echo "configure:1200: checking how to run the C preprocessor" >&5
|
||||
# On Suns, sometimes $CPP names a directory.
|
||||
if test -n "$CPP" && test -d "$CPP"; then
|
||||
CPP=
|
||||
@@ -1227,13 +1211,13 @@ else
|
||||
# On the NeXT, cc -E runs the code through the compiler's parser,
|
||||
# not just through cpp.
|
||||
cat > conftest.$ac_ext <<EOF
|
||||
#line 1231 "configure"
|
||||
#line 1215 "configure"
|
||||
#include "confdefs.h"
|
||||
#include <assert.h>
|
||||
Syntax Error
|
||||
EOF
|
||||
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
|
||||
{ (eval echo configure:1237: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
|
||||
{ (eval echo configure:1221: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
|
||||
ac_err=`grep -v '^ *+' conftest.out`
|
||||
if test -z "$ac_err"; then
|
||||
:
|
||||
@@ -1244,13 +1228,13 @@ else
|
||||
rm -rf conftest*
|
||||
CPP="${CC-cc} -E -traditional-cpp"
|
||||
cat > conftest.$ac_ext <<EOF
|
||||
#line 1248 "configure"
|
||||
#line 1232 "configure"
|
||||
#include "confdefs.h"
|
||||
#include <assert.h>
|
||||
Syntax Error
|
||||
EOF
|
||||
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
|
||||
{ (eval echo configure:1254: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
|
||||
{ (eval echo configure:1238: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
|
||||
ac_err=`grep -v '^ *+' conftest.out`
|
||||
if test -z "$ac_err"; then
|
||||
:
|
||||
@@ -1275,7 +1259,7 @@ echo "$ac_t""$CPP" 1>&6
|
||||
# Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args.
|
||||
set dummy ${ac_tool_prefix}ar; ac_word=$2
|
||||
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
|
||||
echo "configure:1279: checking for $ac_word" >&5
|
||||
echo "configure:1263: checking for $ac_word" >&5
|
||||
if eval "test \"`echo '$''{'ac_cv_prog_AR'+set}'`\" = set"; then
|
||||
echo $ac_n "(cached) $ac_c" 1>&6
|
||||
else
|
||||
@@ -1306,7 +1290,7 @@ fi
|
||||
# Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args.
|
||||
set dummy ${ac_tool_prefix}ranlib; ac_word=$2
|
||||
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
|
||||
echo "configure:1310: checking for $ac_word" >&5
|
||||
echo "configure:1294: checking for $ac_word" >&5
|
||||
if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then
|
||||
echo $ac_n "(cached) $ac_c" 1>&6
|
||||
else
|
||||
@@ -1337,7 +1321,7 @@ if test -n "$ac_tool_prefix"; then
|
||||
# Extract the first word of "ranlib", so it can be a program name with args.
|
||||
set dummy ranlib; ac_word=$2
|
||||
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
|
||||
echo "configure:1341: checking for $ac_word" >&5
|
||||
echo "configure:1325: checking for $ac_word" >&5
|
||||
if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then
|
||||
echo $ac_n "(cached) $ac_c" 1>&6
|
||||
else
|
||||
@@ -1372,7 +1356,7 @@ fi
|
||||
# Extract the first word of "bash", so it can be a program name with args.
|
||||
set dummy bash; ac_word=$2
|
||||
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
|
||||
echo "configure:1376: checking for $ac_word" >&5
|
||||
echo "configure:1360: checking for $ac_word" >&5
|
||||
if eval "test \"`echo '$''{'ac_cv_path_BASH'+set}'`\" = set"; then
|
||||
echo $ac_n "(cached) $ac_c" 1>&6
|
||||
else
|
||||
@@ -1409,8 +1393,53 @@ else
|
||||
fi
|
||||
|
||||
|
||||
if test "$BASH" = no; then
|
||||
# Extract the first word of "ksh", so it can be a program name with args.
|
||||
set dummy ksh; ac_word=$2
|
||||
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
|
||||
echo "configure:1401: checking for $ac_word" >&5
|
||||
if eval "test \"`echo '$''{'ac_cv_path_KSH'+set}'`\" = set"; then
|
||||
echo $ac_n "(cached) $ac_c" 1>&6
|
||||
else
|
||||
case "$KSH" in
|
||||
/*)
|
||||
ac_cv_path_KSH="$KSH" # Let the user override the test with a path.
|
||||
;;
|
||||
*)
|
||||
IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
|
||||
for ac_dir in $PATH; do
|
||||
test -z "$ac_dir" && ac_dir=.
|
||||
if test -f $ac_dir/$ac_word; then
|
||||
ac_cv_path_KSH="$ac_dir/$ac_word"
|
||||
break
|
||||
fi
|
||||
done
|
||||
IFS="$ac_save_ifs"
|
||||
test -z "$ac_cv_path_KSH" && ac_cv_path_KSH="no"
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
KSH="$ac_cv_path_KSH"
|
||||
if test -n "$KSH"; then
|
||||
echo "$ac_t""$KSH" 1>&6
|
||||
else
|
||||
echo "$ac_t""no" 1>&6
|
||||
fi
|
||||
|
||||
if test "$KSH" = no; then
|
||||
libc_cv_have_ksh=no
|
||||
else
|
||||
libc_cv_have_ksh=yes
|
||||
fi
|
||||
else
|
||||
KSH="$BASH"
|
||||
|
||||
libc_cv_have_ksh=yes
|
||||
fi
|
||||
|
||||
|
||||
echo $ac_n "checking for signed size_t type""... $ac_c" 1>&6
|
||||
echo "configure:1414: checking for signed size_t type" >&5
|
||||
echo "configure:1443: checking for signed size_t type" >&5
|
||||
if eval "test \"`echo '$''{'libc_cv_signed_size_t'+set}'`\" = set"; then
|
||||
echo $ac_n "(cached) $ac_c" 1>&6
|
||||
else
|
||||
@@ -1434,12 +1463,12 @@ EOF
|
||||
fi
|
||||
|
||||
echo $ac_n "checking for libc-friendly stddef.h""... $ac_c" 1>&6
|
||||
echo "configure:1438: checking for libc-friendly stddef.h" >&5
|
||||
echo "configure:1467: checking for libc-friendly stddef.h" >&5
|
||||
if eval "test \"`echo '$''{'libc_cv_friendly_stddef'+set}'`\" = set"; then
|
||||
echo $ac_n "(cached) $ac_c" 1>&6
|
||||
else
|
||||
cat > conftest.$ac_ext <<EOF
|
||||
#line 1443 "configure"
|
||||
#line 1472 "configure"
|
||||
#include "confdefs.h"
|
||||
#define __need_size_t
|
||||
#define __need_wchar_t
|
||||
@@ -1454,7 +1483,7 @@ size_t size; wchar_t wchar;
|
||||
if (&size == NULL || &wchar == NULL) abort ();
|
||||
; return 0; }
|
||||
EOF
|
||||
if { (eval echo configure:1458: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
|
||||
if { (eval echo configure:1487: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
|
||||
rm -rf conftest*
|
||||
libc_cv_friendly_stddef=yes
|
||||
else
|
||||
@@ -1473,7 +1502,7 @@ override stddef.h = # The installed <stddef.h> seems to be libc-friendly."
|
||||
fi
|
||||
|
||||
echo $ac_n "checking whether we need to use -P to assemble .S files""... $ac_c" 1>&6
|
||||
echo "configure:1477: checking whether we need to use -P to assemble .S files" >&5
|
||||
echo "configure:1506: checking whether we need to use -P to assemble .S files" >&5
|
||||
if eval "test \"`echo '$''{'libc_cv_need_minus_P'+set}'`\" = set"; then
|
||||
echo $ac_n "(cached) $ac_c" 1>&6
|
||||
else
|
||||
@@ -1496,7 +1525,7 @@ asm-CPPFLAGS = -P # The assembler can't grok cpp's # line directives."
|
||||
fi
|
||||
|
||||
echo $ac_n "checking for assembler global-symbol directive""... $ac_c" 1>&6
|
||||
echo "configure:1500: checking for assembler global-symbol directive" >&5
|
||||
echo "configure:1529: checking for assembler global-symbol directive" >&5
|
||||
if eval "test \"`echo '$''{'libc_cv_asm_global_directive'+set}'`\" = set"; then
|
||||
echo $ac_n "(cached) $ac_c" 1>&6
|
||||
else
|
||||
@@ -1526,7 +1555,7 @@ EOF
|
||||
fi
|
||||
|
||||
echo $ac_n "checking for .set assembler directive""... $ac_c" 1>&6
|
||||
echo "configure:1530: checking for .set assembler directive" >&5
|
||||
echo "configure:1559: checking for .set assembler directive" >&5
|
||||
if eval "test \"`echo '$''{'libc_cv_asm_set_directive'+set}'`\" = set"; then
|
||||
echo $ac_n "(cached) $ac_c" 1>&6
|
||||
else
|
||||
@@ -1559,14 +1588,66 @@ EOF
|
||||
|
||||
fi
|
||||
|
||||
if test $elf = yes; then
|
||||
echo $ac_n "checking for .previous assembler directive""... $ac_c" 1>&6
|
||||
echo "configure:1594: checking for .previous assembler directive" >&5
|
||||
if eval "test \"`echo '$''{'libc_cv_asm_previous_directive'+set}'`\" = set"; then
|
||||
echo $ac_n "(cached) $ac_c" 1>&6
|
||||
else
|
||||
cat > conftest.s <<EOF
|
||||
.section foo_section
|
||||
.previous
|
||||
EOF
|
||||
if { ac_try='${CC-cc} -c $CFLAGS conftest.s 1>&5'; { (eval echo configure:1602: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; }; then
|
||||
libc_cv_asm_previous_directive=yes
|
||||
else
|
||||
libc_cv_asm_previous_directive=no
|
||||
fi
|
||||
rm -f conftest*
|
||||
fi
|
||||
|
||||
echo "$ac_t""$libc_cv_asm_previous_directive" 1>&6
|
||||
if test $libc_cv_asm_previous_directive = yes; then
|
||||
cat >> confdefs.h <<\EOF
|
||||
#define HAVE_ASM_PREVIOUS_DIRECTIVE 1
|
||||
EOF
|
||||
|
||||
else
|
||||
echo $ac_n "checking for .popsection assembler directive""... $ac_c" 1>&6
|
||||
echo "configure:1618: checking for .popsection assembler directive" >&5
|
||||
if eval "test \"`echo '$''{'libc_cv_asm_popsection_directive'+set}'`\" = set"; then
|
||||
echo $ac_n "(cached) $ac_c" 1>&6
|
||||
else
|
||||
cat > conftest.s <<EOF
|
||||
.pushsection foo_section
|
||||
.popsection
|
||||
EOF
|
||||
if { ac_try='${CC-cc} -c $CFLAGS conftest.s 1>&5'; { (eval echo configure:1626: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; }; then
|
||||
libc_cv_asm_popsection_directive=yes
|
||||
else
|
||||
libc_cv_asm_popsection_directive=no
|
||||
fi
|
||||
rm -f conftest*
|
||||
fi
|
||||
|
||||
echo "$ac_t""$libc_cv_asm_popsection_directive" 1>&6
|
||||
if test $libc_cv_asm_popsection_directive = yes; then
|
||||
cat >> confdefs.h <<\EOF
|
||||
#define HAVE_ASM_POPSECTION_DIRECTIVE 1
|
||||
EOF
|
||||
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
if test $elf != yes; then
|
||||
echo $ac_n "checking for .init and .fini sections""... $ac_c" 1>&6
|
||||
echo "configure:1565: checking for .init and .fini sections" >&5
|
||||
echo "configure:1646: checking for .init and .fini sections" >&5
|
||||
if eval "test \"`echo '$''{'libc_cv_have_initfini'+set}'`\" = set"; then
|
||||
echo $ac_n "(cached) $ac_c" 1>&6
|
||||
else
|
||||
cat > conftest.$ac_ext <<EOF
|
||||
#line 1570 "configure"
|
||||
#line 1651 "configure"
|
||||
#include "confdefs.h"
|
||||
|
||||
int main() {
|
||||
@@ -1575,7 +1656,7 @@ asm (".section .init");
|
||||
asm (".text");
|
||||
; return 0; }
|
||||
EOF
|
||||
if { (eval echo configure:1579: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
|
||||
if { (eval echo configure:1660: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
|
||||
rm -rf conftest*
|
||||
libc_cv_have_initfini=yes
|
||||
else
|
||||
@@ -1600,19 +1681,19 @@ if test $elf = yes; then
|
||||
libc_cv_asm_underscores=no
|
||||
else
|
||||
echo $ac_n "checking for _ prefix on C symbol names""... $ac_c" 1>&6
|
||||
echo "configure:1604: checking for _ prefix on C symbol names" >&5
|
||||
echo "configure:1685: checking for _ prefix on C symbol names" >&5
|
||||
if eval "test \"`echo '$''{'libc_cv_asm_underscores'+set}'`\" = set"; then
|
||||
echo $ac_n "(cached) $ac_c" 1>&6
|
||||
else
|
||||
cat > conftest.$ac_ext <<EOF
|
||||
#line 1609 "configure"
|
||||
#line 1690 "configure"
|
||||
#include "confdefs.h"
|
||||
asm ("_glibc_foobar:");
|
||||
int main() {
|
||||
glibc_foobar ();
|
||||
; return 0; }
|
||||
EOF
|
||||
if { (eval echo configure:1616: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
|
||||
if { (eval echo configure:1697: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
|
||||
rm -rf conftest*
|
||||
libc_cv_asm_underscores=yes
|
||||
else
|
||||
@@ -1639,7 +1720,7 @@ if test $elf = yes; then
|
||||
libc_cv_asm_weakext_directive=no
|
||||
else
|
||||
echo $ac_n "checking for assembler .weak directive""... $ac_c" 1>&6
|
||||
echo "configure:1643: checking for assembler .weak directive" >&5
|
||||
echo "configure:1724: checking for assembler .weak directive" >&5
|
||||
if eval "test \"`echo '$''{'libc_cv_asm_weak_directive'+set}'`\" = set"; then
|
||||
echo $ac_n "(cached) $ac_c" 1>&6
|
||||
else
|
||||
@@ -1662,7 +1743,7 @@ echo "$ac_t""$libc_cv_asm_weak_directive" 1>&6
|
||||
|
||||
if test $libc_cv_asm_weak_directive = no; then
|
||||
echo $ac_n "checking for assembler .weakext directive""... $ac_c" 1>&6
|
||||
echo "configure:1666: checking for assembler .weakext directive" >&5
|
||||
echo "configure:1747: checking for assembler .weakext directive" >&5
|
||||
if eval "test \"`echo '$''{'libc_cv_asm_weakext_directive'+set}'`\" = set"; then
|
||||
echo $ac_n "(cached) $ac_c" 1>&6
|
||||
else
|
||||
@@ -1699,7 +1780,7 @@ EOF
|
||||
fi
|
||||
|
||||
echo $ac_n "checking for ld --no-whole-archive""... $ac_c" 1>&6
|
||||
echo "configure:1703: checking for ld --no-whole-archive" >&5
|
||||
echo "configure:1784: checking for ld --no-whole-archive" >&5
|
||||
if eval "test \"`echo '$''{'libc_cv_ld_no_whole_archive'+set}'`\" = set"; then
|
||||
echo $ac_n "(cached) $ac_c" 1>&6
|
||||
else
|
||||
@@ -1710,7 +1791,7 @@ __throw () {}
|
||||
EOF
|
||||
if { ac_try='${CC-cc} $CFLAGS
|
||||
-nostdlib -nostartfiles -Wl,--no-whole-archive
|
||||
-o conftest conftest.c'; { (eval echo configure:1714: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; }; then
|
||||
-o conftest conftest.c'; { (eval echo configure:1795: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; }; then
|
||||
libc_cv_ld_no_whole_archive=yes
|
||||
else
|
||||
libc_cv_ld_no_whole_archive=no
|
||||
@@ -1721,7 +1802,7 @@ fi
|
||||
echo "$ac_t""$libc_cv_ld_no_whole_archive" 1>&6
|
||||
|
||||
echo $ac_n "checking for gcc -fno-exceptions""... $ac_c" 1>&6
|
||||
echo "configure:1725: checking for gcc -fno-exceptions" >&5
|
||||
echo "configure:1806: checking for gcc -fno-exceptions" >&5
|
||||
if eval "test \"`echo '$''{'libc_cv_gcc_no_exceptions'+set}'`\" = set"; then
|
||||
echo $ac_n "(cached) $ac_c" 1>&6
|
||||
else
|
||||
@@ -1732,7 +1813,7 @@ __throw () {}
|
||||
EOF
|
||||
if { ac_try='${CC-cc} $CFLAGS
|
||||
-nostdlib -nostartfiles -fno-exceptions
|
||||
-o conftest conftest.c'; { (eval echo configure:1736: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; }; then
|
||||
-o conftest conftest.c'; { (eval echo configure:1817: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; }; then
|
||||
libc_cv_gcc_no_exceptions=yes
|
||||
else
|
||||
libc_cv_gcc_no_exceptions=no
|
||||
@@ -1784,7 +1865,7 @@ if test "$uname" = generic; then
|
||||
fi
|
||||
|
||||
echo $ac_n "checking OS release for uname""... $ac_c" 1>&6
|
||||
echo "configure:1788: checking OS release for uname" >&5
|
||||
echo "configure:1869: checking OS release for uname" >&5
|
||||
if eval "test \"`echo '$''{'libc_cv_uname_release'+set}'`\" = set"; then
|
||||
echo $ac_n "(cached) $ac_c" 1>&6
|
||||
else
|
||||
@@ -1806,7 +1887,7 @@ echo "$ac_t""$libc_cv_uname_release" 1>&6
|
||||
uname_release="$libc_cv_uname_release"
|
||||
|
||||
echo $ac_n "checking OS version for uname""... $ac_c" 1>&6
|
||||
echo "configure:1810: checking OS version for uname" >&5
|
||||
echo "configure:1891: checking OS version for uname" >&5
|
||||
if eval "test \"`echo '$''{'libc_cv_uname_version'+set}'`\" = set"; then
|
||||
echo $ac_n "(cached) $ac_c" 1>&6
|
||||
else
|
||||
@@ -1828,7 +1909,7 @@ else
|
||||
fi
|
||||
|
||||
echo $ac_n "checking stdio selection""... $ac_c" 1>&6
|
||||
echo "configure:1832: checking stdio selection" >&5
|
||||
echo "configure:1913: checking stdio selection" >&5
|
||||
|
||||
case $stdio in
|
||||
libio) cat >> confdefs.h <<\EOF
|
||||
@@ -1839,15 +1920,7 @@ default) stdio=stdio ;;
|
||||
esac
|
||||
echo "$ac_t""$stdio" 1>&6
|
||||
|
||||
echo $ac_n "checking malloc selection""... $ac_c" 1>&6
|
||||
echo "configure:1844: checking malloc selection" >&5
|
||||
|
||||
case $malloc in
|
||||
new-malloc) USE_NEW_MALLOC=-DUSE_NEW_MALLOC ;;
|
||||
default) malloc=malloc ;;
|
||||
esac
|
||||
|
||||
echo "$ac_t""$malloc" 1>&6
|
||||
|
||||
|
||||
|
||||
@@ -1920,7 +1993,7 @@ EOF
|
||||
# Ultrix sh set writes to stderr and can't be redirected directly,
|
||||
# and sets the high bit in the cache file unless we assign to the vars.
|
||||
(set) 2>&1 |
|
||||
case `(ac_space=' '; set) 2>&1` in
|
||||
case `(ac_space=' '; set | grep ac_space) 2>&1` in
|
||||
*ac_space=\ *)
|
||||
# `set' does not quote correctly, so add quotes (double-quote substitution
|
||||
# turns \\\\ into \\, and sed turns \\ into \).
|
||||
@@ -1987,7 +2060,7 @@ do
|
||||
echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion"
|
||||
exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;;
|
||||
-version | --version | --versio | --versi | --vers | --ver | --ve | --v)
|
||||
echo "$CONFIG_STATUS generated by autoconf version 2.11.2"
|
||||
echo "$CONFIG_STATUS generated by autoconf version 2.12"
|
||||
exit 0 ;;
|
||||
-help | --help | --hel | --he | --h)
|
||||
echo "\$ac_cs_usage"; exit 0 ;;
|
||||
@@ -2052,6 +2125,8 @@ s%@AR@%$AR%g
|
||||
s%@RANLIB@%$RANLIB%g
|
||||
s%@BASH@%$BASH%g
|
||||
s%@libc_cv_have_bash2@%$libc_cv_have_bash2%g
|
||||
s%@KSH@%$KSH%g
|
||||
s%@libc_cv_have_ksh@%$libc_cv_have_ksh%g
|
||||
s%@libc_cv_have_initfini@%$libc_cv_have_initfini%g
|
||||
s%@libc_cv_ld_no_whole_archive@%$libc_cv_ld_no_whole_archive%g
|
||||
s%@libc_cv_gcc_no_exceptions@%$libc_cv_gcc_no_exceptions%g
|
||||
@@ -2059,10 +2134,10 @@ s%@uname_sysname@%$uname_sysname%g
|
||||
s%@uname_release@%$uname_release%g
|
||||
s%@uname_version@%$uname_version%g
|
||||
s%@stdio@%$stdio%g
|
||||
s%@malloc@%$malloc%g
|
||||
s%@USE_NEW_MALLOC@%$USE_NEW_MALLOC%g
|
||||
s%@libc_cv_slibdir@%$libc_cv_slibdir%g
|
||||
s%@libc_cv_sysconfdir@%$libc_cv_sysconfdir%g
|
||||
s%@libc_cv_rootsbindir@%$libc_cv_rootsbindir%g
|
||||
s%@has_ldconfig@%$has_ldconfig%g
|
||||
s%@gnu_ld@%$gnu_ld%g
|
||||
s%@gnu_as@%$gnu_as%g
|
||||
s%@elf@%$elf%g
|
||||
|
||||
+52
-20
@@ -59,16 +59,6 @@ AC_ARG_ENABLE(libio, dnl
|
||||
fi],
|
||||
stdio=default)
|
||||
|
||||
AC_ARG_ENABLE(new-malloc, dnl
|
||||
[ --enable-new-malloc use the new malloc implementation. This is the
|
||||
default for Linux, others use the old malloc.],
|
||||
[if test $enableval = yes; then
|
||||
malloc=new-malloc
|
||||
else
|
||||
malloc=malloc
|
||||
fi],
|
||||
malloc=default)
|
||||
|
||||
AC_ARG_ENABLE(sanity-checks, dnl
|
||||
[ --disable-sanity-checks really do not use threads (should not be used
|
||||
except in special situations) [default=yes]],
|
||||
@@ -383,6 +373,21 @@ else
|
||||
fi
|
||||
AC_SUBST(libc_cv_have_bash2)
|
||||
|
||||
dnl We need a ksh compatible shell for tzselect.
|
||||
if test "$BASH" = no; then
|
||||
AC_PATH_PROG(KSH, ksh, no)
|
||||
if test "$KSH" = no; then
|
||||
libc_cv_have_ksh=no
|
||||
else
|
||||
libc_cv_have_ksh=yes
|
||||
fi
|
||||
else
|
||||
KSH="$BASH"
|
||||
AC_SUBST(KSH)
|
||||
libc_cv_have_ksh=yes
|
||||
fi
|
||||
AC_SUBST(libc_cv_have_ksh)
|
||||
|
||||
AC_CACHE_CHECK(for signed size_t type, libc_cv_signed_size_t, [dnl
|
||||
echo '#include <stddef.h>
|
||||
FOOBAR __SIZE_TYPE__ FOOBAR' > conftest.c
|
||||
@@ -481,6 +486,40 @@ if test $libc_cv_asm_set_directive = yes; then
|
||||
AC_DEFINE(HAVE_ASM_SET_DIRECTIVE)
|
||||
fi
|
||||
|
||||
if test $elf = yes; then
|
||||
AC_CACHE_CHECK(for .previous assembler directive,
|
||||
libc_cv_asm_previous_directive, [dnl
|
||||
cat > conftest.s <<EOF
|
||||
.section foo_section
|
||||
.previous
|
||||
EOF
|
||||
if AC_TRY_COMMAND(${CC-cc} -c $CFLAGS conftest.s 1>&AC_FD_CC); then
|
||||
libc_cv_asm_previous_directive=yes
|
||||
else
|
||||
libc_cv_asm_previous_directive=no
|
||||
fi
|
||||
rm -f conftest*])
|
||||
if test $libc_cv_asm_previous_directive = yes; then
|
||||
AC_DEFINE(HAVE_ASM_PREVIOUS_DIRECTIVE)
|
||||
else
|
||||
AC_CACHE_CHECK(for .popsection assembler directive,
|
||||
libc_cv_asm_popsection_directive, [dnl
|
||||
cat > conftest.s <<EOF
|
||||
.pushsection foo_section
|
||||
.popsection
|
||||
EOF
|
||||
if AC_TRY_COMMAND(${CC-cc} -c $CFLAGS conftest.s 1>&AC_FD_CC); then
|
||||
libc_cv_asm_popsection_directive=yes
|
||||
else
|
||||
libc_cv_asm_popsection_directive=no
|
||||
fi
|
||||
rm -f conftest*])
|
||||
if test $libc_cv_asm_popsection_directive = yes; then
|
||||
AC_DEFINE(HAVE_ASM_POPSECTION_DIRECTIVE)
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
if test $elf != yes; then
|
||||
AC_CACHE_CHECK(for .init and .fini sections, libc_cv_have_initfini,
|
||||
[AC_TRY_COMPILE(, [asm (".section .init");
|
||||
@@ -687,18 +726,11 @@ default) stdio=stdio ;;
|
||||
esac
|
||||
AC_MSG_RESULT($stdio)
|
||||
|
||||
AC_MSG_CHECKING(malloc selection)
|
||||
AC_SUBST(malloc)
|
||||
case $malloc in
|
||||
new-malloc) USE_NEW_MALLOC=-DUSE_NEW_MALLOC ;;
|
||||
default) malloc=malloc ;;
|
||||
esac
|
||||
AC_SUBST(USE_NEW_MALLOC)
|
||||
AC_MSG_RESULT($malloc)
|
||||
|
||||
|
||||
AC_SUBST(libc_cv_slibdir)
|
||||
AC_SUBST(libc_cv_sysconfdir)
|
||||
AC_SUBST(libc_cv_rootsbindir)
|
||||
|
||||
AC_SUBST(has_ldconfig)
|
||||
|
||||
AC_SUBST(gnu_ld) AC_SUBST(gnu_as) AC_SUBST(elf)
|
||||
if test $gnu_ld = yes; then
|
||||
|
||||
+4
-4
@@ -1,4 +1,4 @@
|
||||
# Copyright (C) 1991, 1992, 1993 Free Software Foundation, Inc.
|
||||
# Copyright (C) 1991, 1992, 1993, 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
|
||||
@@ -12,9 +12,9 @@
|
||||
# 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., 675 Mass Ave,
|
||||
# Cambridge, MA 02139, USA.
|
||||
# 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.
|
||||
|
||||
#
|
||||
# Sub-makefile for ctype portion of the library.
|
||||
|
||||
+3
-2
@@ -674,7 +674,8 @@ bt_psplit(t, h, l, r, pskip, ilen)
|
||||
* where we decide to try and copy too much onto the left page.
|
||||
* Make sure that doesn't happen.
|
||||
*/
|
||||
if (skip <= off && used + nbytes >= full) {
|
||||
if (skip <= off &&
|
||||
used + nbytes + sizeof(indx_t) >= full || nxt == top - 1) {
|
||||
--off;
|
||||
break;
|
||||
}
|
||||
@@ -687,7 +688,7 @@ bt_psplit(t, h, l, r, pskip, ilen)
|
||||
memmove((char *)l + l->upper, src, nbytes);
|
||||
}
|
||||
|
||||
used += nbytes;
|
||||
used += nbytes + sizeof(indx_t);
|
||||
if (used >= half) {
|
||||
if (!isbigkey || bigkeycnt == 3)
|
||||
break;
|
||||
|
||||
@@ -249,7 +249,7 @@ __big_delete(hashp, bufp)
|
||||
bufp->flags |= BUF_MOD;
|
||||
if (rbufp)
|
||||
__free_ovflpage(hashp, rbufp);
|
||||
if (last_bfp != rbufp)
|
||||
if (last_bfp && last_bfp != rbufp)
|
||||
__free_ovflpage(hashp, last_bfp);
|
||||
|
||||
hashp->NKEYS--;
|
||||
|
||||
+1
-1
@@ -86,7 +86,7 @@ main (argc, argv)
|
||||
be_quiet = 0;
|
||||
output_name = NULL;
|
||||
|
||||
while ((opt = getopt_long (argc, argv, "fho:uV", long_options, NULL)) != EOF)
|
||||
while ((opt = getopt_long (argc, argv, "fho:uV", long_options, NULL)) != -1)
|
||||
switch (opt)
|
||||
{
|
||||
case '\0': /* Long option. */
|
||||
|
||||
+4
-4
@@ -1,4 +1,4 @@
|
||||
# Copyright (C) 1991, 92, 93, 94, 95, 96 Free Software Foundation, Inc.
|
||||
# Copyright (C) 1991, 92, 93, 94, 95, 96, 97 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
|
||||
@@ -12,9 +12,9 @@
|
||||
# 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., 675 Mass Ave,
|
||||
# Cambridge, MA 02139, USA.
|
||||
# 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.
|
||||
|
||||
#
|
||||
# Sub-makefile for dirent portion of the library.
|
||||
|
||||
+17
-19
@@ -1,29 +1,27 @@
|
||||
/* Copyright (C) 1992 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
/* Copyright (C) 1992, 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 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.
|
||||
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., 675 Mass Ave,
|
||||
Cambridge, MA 02139, USA. */
|
||||
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 <ansidecl.h>
|
||||
#include <dirent.h>
|
||||
#include <string.h>
|
||||
|
||||
int
|
||||
DEFUN(alphasort, (a, b),
|
||||
CONST PTR a AND CONST PTR b)
|
||||
alphasort (const void *a, const void *b)
|
||||
{
|
||||
return strcmp (((struct dirent *) a)->d_name,
|
||||
((struct dirent *) b)->d_name);
|
||||
return strcmp ((*(const struct dirent **) a)->d_name,
|
||||
(*(const struct dirent **) b)->d_name);
|
||||
}
|
||||
|
||||
+38
-35
@@ -1,4 +1,4 @@
|
||||
/* Copyright (C) 1991, 92, 93, 94, 95, 96 Free Software Foundation, Inc.
|
||||
/* Copyright (C) 1991, 92, 93, 94, 95, 96, 97 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
|
||||
@@ -39,12 +39,15 @@ __BEGIN_DECLS
|
||||
|
||||
It defines the macro `_DIRENT_HAVE_D_OFF' iff there is a `d_off'
|
||||
member that gives the file offset of the next directory entry.
|
||||
|
||||
It defines the macro `_DIRENT_HAVE_D_TYPE' iff there is a `d_type'
|
||||
member that gives the type of the file.
|
||||
*/
|
||||
|
||||
#include <direntry.h>
|
||||
|
||||
#if (defined(__USE_BSD) || defined(__USE_MISC)) && !defined(d_fileno)
|
||||
#define d_ino d_fileno /* Backward compatibility. */
|
||||
#if (defined __USE_BSD || defined __USE_MISC) && !defined d_fileno
|
||||
# define d_ino d_fileno /* Backward compatibility. */
|
||||
#endif
|
||||
|
||||
/* These macros extract size information from a `struct dirent *'.
|
||||
@@ -62,16 +65,16 @@ __BEGIN_DECLS
|
||||
*/
|
||||
|
||||
#ifdef _DIRENT_HAVE_D_NAMLEN
|
||||
#define _D_EXACT_NAMLEN(d) ((d)->d_namlen)
|
||||
#define _D_ALLOC_NAMLEN(d) (_D_EXACT_NAMLEN (d) + 1)
|
||||
# define _D_EXACT_NAMLEN(d) ((d)->d_namlen)
|
||||
# define _D_ALLOC_NAMLEN(d) (_D_EXACT_NAMLEN (d) + 1)
|
||||
#else
|
||||
#define _D_EXACT_NAMLEN(d) (strlen ((d)->d_name))
|
||||
#ifdef _DIRENT_HAVE_D_RECLEN
|
||||
#define _D_ALLOC_NAMLEN(d) (((char *) (d) + (d)->d_reclen) - &(d)->d_name[0])
|
||||
#else
|
||||
#define _D_ALLOC_NAMLEN(d) (sizeof (d)->d_name > 1 ? sizeof (d)->d_name : \
|
||||
_D_EXACT_NAMLEN (d) + 1)
|
||||
#endif
|
||||
# define _D_EXACT_NAMLEN(d) (strlen ((d)->d_name))
|
||||
# ifdef _DIRENT_HAVE_D_RECLEN
|
||||
# define _D_ALLOC_NAMLEN(d) (((char *) (d) + (d)->d_reclen) - &(d)->d_name[0])
|
||||
# else
|
||||
# define _D_ALLOC_NAMLEN(d) (sizeof (d)->d_name > 1 ? sizeof (d)->d_name : \
|
||||
_D_EXACT_NAMLEN (d) + 1)
|
||||
# endif
|
||||
#endif
|
||||
|
||||
|
||||
@@ -90,8 +93,8 @@ enum
|
||||
};
|
||||
|
||||
/* Convert between stat structure types and directory types. */
|
||||
#define IFTODT(mode) (((mode) & 0170000) >> 12)
|
||||
#define DTTOIF(dirtype) ((dirtype) << 12)
|
||||
# define IFTODT(mode) (((mode) & 0170000) >> 12)
|
||||
# define DTTOIF(dirtype) ((dirtype) << 12)
|
||||
#endif
|
||||
|
||||
|
||||
@@ -116,42 +119,42 @@ extern int closedir __P ((DIR *__dirp));
|
||||
extern struct dirent *__readdir __P ((DIR *__dirp));
|
||||
extern struct dirent *readdir __P ((DIR *__dirp));
|
||||
|
||||
#ifdef __USE_REENTRANT
|
||||
#if defined __USE_POSIX || defined __USE_MISC
|
||||
/* Reentrant version of `readdir'. Return in RESULT a pointer to the
|
||||
next entry. */
|
||||
extern int __readdir_r __P ((DIR *__dirp, struct dirent *entry,
|
||||
struct dirent **result));
|
||||
extern int readdir_r __P ((DIR *__dirp, struct dirent *entry,
|
||||
struct dirent **result));
|
||||
#endif
|
||||
extern int __readdir_r __P ((DIR *__dirp, struct dirent *__entry,
|
||||
struct dirent **__result));
|
||||
extern int readdir_r __P ((DIR *__dirp, struct dirent *__entry,
|
||||
struct dirent **__result));
|
||||
#endif /* POSIX or misc */
|
||||
|
||||
/* Rewind DIRP to the beginning of the directory. */
|
||||
extern void rewinddir __P ((DIR *__dirp));
|
||||
|
||||
#if defined(__USE_BSD) || defined(__USE_MISC)
|
||||
#if defined __USE_BSD || defined __USE_MISC
|
||||
|
||||
/* Return the file descriptor used by DIRP. */
|
||||
extern int dirfd __P ((DIR *__dirp));
|
||||
|
||||
#if defined (__OPTIMIZE__) && defined (_DIR_dirfd)
|
||||
#define dirfd(dirp) _DIR_dirfd (dirp)
|
||||
#endif
|
||||
# if defined __OPTIMIZE__ && defined _DIR_dirfd
|
||||
# define dirfd(dirp) _DIR_dirfd (dirp)
|
||||
# endif
|
||||
|
||||
#ifndef MAXNAMLEN
|
||||
# ifndef MAXNAMLEN
|
||||
/* Get the definitions of the POSIX.1 limits. */
|
||||
#include <posix1_lim.h>
|
||||
# include <posix1_lim.h>
|
||||
|
||||
/* `MAXNAMLEN' is the BSD name for what POSIX calls `NAME_MAX'. */
|
||||
#ifdef NAME_MAX
|
||||
#define MAXNAMLEN NAME_MAX
|
||||
#else
|
||||
#define MAXNAMLEN 255
|
||||
#endif
|
||||
#endif
|
||||
# ifdef NAME_MAX
|
||||
# define MAXNAMLEN NAME_MAX
|
||||
# else
|
||||
# define MAXNAMLEN 255
|
||||
# endif
|
||||
# endif
|
||||
|
||||
#include <gnu/types.h>
|
||||
#define __need_size_t
|
||||
#include <stddef.h>
|
||||
# include <gnu/types.h>
|
||||
# define __need_size_t
|
||||
# include <stddef.h>
|
||||
|
||||
/* Seek to position POS on DIRP. */
|
||||
extern void seekdir __P ((DIR *__dirp, __off_t __pos));
|
||||
|
||||
+41
-7
@@ -1,6 +1,6 @@
|
||||
# Makefile for elf subdirectory of GNU C Library.
|
||||
|
||||
# Copyright (C) 1995, 1996 Free Software Foundation, Inc.
|
||||
# Copyright (C) 1995, 1996, 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
|
||||
@@ -41,6 +41,8 @@ extra-libs = libdl
|
||||
extra-libs-others = $(extra-libs)
|
||||
libdl-routines := dlopen dlclose dlsym dlerror dladdr
|
||||
|
||||
before-compile = $(objpfx)trusted-dirs.h
|
||||
|
||||
|
||||
all: # Make this the default target; it will be defined in Rules.
|
||||
|
||||
@@ -49,14 +51,26 @@ include ../Makeconfig
|
||||
ifeq (yes,$(build-shared))
|
||||
extra-objs = $(rtld-routines:=.so) soinit.so sofini.so eval.so
|
||||
generated = librtld.so dl-allobjs.so
|
||||
install-others = $(slibdir)/$(rtld-installed-name)
|
||||
install-others = $(inst_slibdir)/$(rtld-installed-name)
|
||||
install-bin = ldd
|
||||
endif
|
||||
|
||||
ifeq (yes,$(has-ldconfig))
|
||||
extra-objs += ldconfig.o
|
||||
install-rootsbin = ldconfig
|
||||
|
||||
$(objpfx)ldconfig: $(objpfx)ldconfig.o
|
||||
$(CC) -nostdlib -nostartfiles -o $@ $(sysdep-LDFLAGS) -static \
|
||||
$(addprefix $(csu-objpfx),start.o) $(+preinit) \
|
||||
$(filter-out $(addprefix $(csu-objpfx),start.o) $(+preinit) \
|
||||
$(link-extra-libs) $(common-objpfx)libc% $(+postinit),$^) \
|
||||
$(link-extra-libs) $(common-objpfx)libc.a $(gnulib) $(+postinit)
|
||||
endif
|
||||
|
||||
include ../Rules
|
||||
|
||||
|
||||
ifeq (yes, $(build-shared))
|
||||
ifeq (yes,$(build-shared))
|
||||
# Make sure these things are built in the `make lib' pass so they can be used
|
||||
# to run programs during the `make others' pass.
|
||||
lib-noranlib: $(objpfx)$(rtld-installed-name) \
|
||||
@@ -84,7 +98,7 @@ endef
|
||||
# The dl code in the static libc needs a default library path.
|
||||
CFLAGS-dl-support.c = -D'DEFAULT_RPATH="$(default-rpath)"'
|
||||
|
||||
ifneq (ld.so, $(rtld-installed-name))
|
||||
ifneq (ld.so,$(rtld-installed-name))
|
||||
# Make sure ld.so.1 exists in the build directory so we can link
|
||||
# against it.
|
||||
$(objpfx)$(rtld-installed-name): $(objpfx)ld.so
|
||||
@@ -92,21 +106,41 @@ $(objpfx)$(rtld-installed-name): $(objpfx)ld.so
|
||||
ln -s $(<F) $@
|
||||
endif
|
||||
|
||||
# Build a file mentioning all trustworthy directories to look for shared
|
||||
# libraries when using LD_LIBRARY_PATH in a setuid program. The user can
|
||||
# add directories to the list by defining $(user-defined-trusted-dirs)
|
||||
# before starting make.
|
||||
$(objpfx)trusted-dirs.h: Makefile
|
||||
$(make-target-directory)
|
||||
(for dir in `echo "$(default-rpath) $(user-defined-trusted-dirs)" | \
|
||||
sed 's/:/ /g'`; do \
|
||||
echo " \"$$dir\","; \
|
||||
done;) > $@T
|
||||
mv -f $@T $@
|
||||
CPPFLAGS-dl-load.c = -I$(objdir)/$(subdir)
|
||||
CFLAGS-dl-load.c += -Wno-uninitialized
|
||||
|
||||
# Specify the dependencies of libdl.so; its commands come from the generic
|
||||
# rule to build a shared library.
|
||||
$(objpfx)libdl.so: $(objpfx)libdl_pic.a $(common-objpfx)libc.so $(objpfx)ld.so
|
||||
|
||||
$(slibdir)/$(rtld-installed-name): $(objpfx)ld.so; $(do-install-program)
|
||||
$(inst_slibdir)/$(rtld-version-installed-name): $(objpfx)ld.so
|
||||
$(do-install-program)
|
||||
|
||||
$(inst_slibdir)/$(rtld-installed-name): \
|
||||
$(inst_slibdir)/$(rtld-version-installed-name)
|
||||
$(make-shlib-link)
|
||||
|
||||
ifneq ($(have-bash2),yes)
|
||||
$(objpfx)ldd: ldd.sh.in Makefile
|
||||
$(objpfx)ldd: ldd.sh.in $(common-objpfx)version.mk \
|
||||
$(common-objpfx)soversions.mk $(common-objpfx)config.make
|
||||
sed -e 's%@RTLD@%$(slibdir)/$(rtld-installed-name)%g' \
|
||||
-e 's%@VERSION@%$(version)%g' < $< > $@.new
|
||||
chmod 555 $@.new
|
||||
mv -f $@.new $@
|
||||
else
|
||||
$(objpfx)ldd: ldd.bash.in Makefile
|
||||
$(objpfx)ldd: ldd.bash.in $(common-objpfx)version.mk \
|
||||
$(common-objpfx)soversions.mk $(common-objpfx)config.make
|
||||
sed -e 's%@BASH@%$(BASH)%g' \
|
||||
-e 's%@RTLD@%$(slibdir)/$(rtld-installed-name)%g' \
|
||||
-e 's%@VERSION@%$(version)%g' \
|
||||
|
||||
+47
-26
@@ -32,7 +32,7 @@ _dl_map_object_deps (struct link_map *map,
|
||||
struct link_map *map;
|
||||
struct list *next;
|
||||
};
|
||||
struct list head[2 + npreloads], *tailp, *scanp;
|
||||
struct list *head, *tailp, *scanp;
|
||||
struct list duphead, *duptailp;
|
||||
unsigned int nduplist;
|
||||
unsigned int nlist, naux, i;
|
||||
@@ -49,36 +49,57 @@ _dl_map_object_deps (struct link_map *map,
|
||||
|
||||
naux = nlist = 0;
|
||||
|
||||
#define AUXTAG (DT_NUM + DT_PROCNUM + DT_EXTRATAGIDX (DT_AUXILIARY))
|
||||
/* XXX The AUXILIARY implementation isn't correct in the moment. XXX
|
||||
XXX The problem is that we currently do not handle auxiliary XXX
|
||||
XXX entries in the loaded objects. XXX */
|
||||
|
||||
#define AUXTAG (DT_NUM + DT_PROCNUM + DT_VERSIONTAGNUM \
|
||||
+ DT_EXTRATAGIDX (DT_AUXILIARY))
|
||||
|
||||
/* First determine the number of auxiliary objects we have to load. */
|
||||
if (map->l_info[AUXTAG])
|
||||
{
|
||||
/* There is an auxiliary library specified. We try to load it,
|
||||
and if we can, use its symbols in preference to our own.
|
||||
But if we can't load it, we just silently ignore it.
|
||||
XXX support multiple DT_AUXILIARYs?
|
||||
*/
|
||||
struct link_map *aux;
|
||||
void openaux (void)
|
||||
{
|
||||
const char *strtab
|
||||
= ((void *) map->l_addr + map->l_info[DT_STRTAB]->d_un.d_ptr);
|
||||
aux = _dl_map_object (map, strtab + map->l_info[AUXTAG]->d_un.d_val,
|
||||
map->l_type == lt_executable ? lt_library :
|
||||
map->l_type, trace_mode);
|
||||
}
|
||||
char *errstring;
|
||||
const char *objname;
|
||||
if (! _dl_catch_error (&errstring, &objname, &openaux))
|
||||
{
|
||||
/* The auxiliary object is actually there. Use it
|
||||
as the first search element, even before MAP itself. */
|
||||
preload (aux);
|
||||
naux = 1;
|
||||
}
|
||||
ElfW(Dyn) *d;
|
||||
for (d = map->l_ld; d->d_tag != DT_NULL; ++d)
|
||||
if (d->d_tag == DT_AUXILIARY)
|
||||
++naux;
|
||||
}
|
||||
|
||||
/* Start the search list with one element: MAP itself. */
|
||||
/* Now we can allocate the array for the linker maps. */
|
||||
head = (struct list *) alloca (sizeof (struct list)
|
||||
* (naux + npreloads + 2));
|
||||
|
||||
/* Load the auxiliary objects, even before the object itself. */
|
||||
if (map->l_info[AUXTAG])
|
||||
{
|
||||
/* There is at least one auxiliary library specified. We try to
|
||||
load it, and if we can, use its symbols in preference to our
|
||||
own. But if we can't load it, we just silently ignore it. */
|
||||
const char *strtab
|
||||
= ((void *) map->l_addr + map->l_info[DT_STRTAB]->d_un.d_ptr);
|
||||
ElfW(Dyn) *d;
|
||||
|
||||
for (d = map->l_ld; d->d_tag != DT_NULL; ++d)
|
||||
if (d->d_tag == DT_AUXILIARY)
|
||||
{
|
||||
struct link_map *aux;
|
||||
void openaux (void)
|
||||
{
|
||||
aux = _dl_map_object (map, strtab + d->d_un.d_val,
|
||||
(map->l_type == lt_executable
|
||||
? lt_library : map->l_type),
|
||||
trace_mode);
|
||||
}
|
||||
char *errstring;
|
||||
const char *objname;
|
||||
if (! _dl_catch_error (&errstring, &objname, openaux))
|
||||
/* The auxiliary object is actually there. Use it as
|
||||
the first search element, even before MAP itself. */
|
||||
preload (aux);
|
||||
}
|
||||
}
|
||||
|
||||
/* Next load MAP itself. */
|
||||
preload (map);
|
||||
|
||||
/* Add the preloaded items after MAP but before any of its dependencies. */
|
||||
|
||||
@@ -37,6 +37,11 @@ struct catch
|
||||
this is null. */
|
||||
static struct catch *catch;
|
||||
|
||||
/* This points to a function which is called when an error is
|
||||
received. Unlike the handling of `catch' this function may return.
|
||||
The arguments will be the `errstring' and `objname'. */
|
||||
static receiver_fct receiver;
|
||||
|
||||
|
||||
void
|
||||
_dl_signal_error (int errcode,
|
||||
@@ -58,6 +63,13 @@ _dl_signal_error (int errcode,
|
||||
catch->objname = objname;
|
||||
longjmp (catch->env, errcode ?: -1);
|
||||
}
|
||||
else if (receiver)
|
||||
{
|
||||
/* We are inside _dl_receive_error. Call the user supplied
|
||||
handler and resume the work. The receiver will still
|
||||
installed. */
|
||||
(*receiver) (errstring, objname);
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Lossage while resolving the program's own symbols is always fatal. */
|
||||
@@ -77,6 +89,8 @@ _dl_catch_error (char **errstring,
|
||||
{
|
||||
int errcode;
|
||||
struct catch *old, c = { errstring: NULL, objname: NULL };
|
||||
/* We need not handle `receiver' since setting a `catch' is handle
|
||||
before it. */
|
||||
|
||||
old = catch;
|
||||
errcode = setjmp (c.env);
|
||||
@@ -96,3 +110,22 @@ _dl_catch_error (char **errstring,
|
||||
*objname = c.objname;
|
||||
return errcode == -1 ? 0 : errcode;
|
||||
}
|
||||
|
||||
void
|
||||
_dl_receive_error (receiver_fct fct, void (*operate) (void))
|
||||
{
|
||||
struct catch *old_catch;
|
||||
receiver_fct old_receiver;
|
||||
|
||||
old_catch = catch;
|
||||
old_receiver = receiver;
|
||||
|
||||
/* Set the new values. */
|
||||
catch = NULL;
|
||||
receiver = fct;
|
||||
|
||||
(*operate) ();
|
||||
|
||||
catch = old_catch;
|
||||
receiver = old_receiver;
|
||||
}
|
||||
|
||||
+58
-14
@@ -1,5 +1,5 @@
|
||||
/* _dl_map_object -- Map in a shared object's segments from the file.
|
||||
Copyright (C) 1995, 1996 Free Software Foundation, Inc.
|
||||
Copyright (C) 1995, 1996, 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
|
||||
@@ -409,7 +409,8 @@ _dl_map_object_from_fd (char *name, int fd, char *realname,
|
||||
static int
|
||||
open_path (const char *name, size_t namelen,
|
||||
const char *dirpath,
|
||||
char **realname)
|
||||
char **realname,
|
||||
const char *trusted_dirs[])
|
||||
{
|
||||
char *buf;
|
||||
const char *p;
|
||||
@@ -426,13 +427,42 @@ open_path (const char *name, size_t namelen,
|
||||
do
|
||||
{
|
||||
size_t buflen;
|
||||
size_t this_len;
|
||||
|
||||
dirpath = p;
|
||||
p = strpbrk (dirpath, ":;");
|
||||
if (p == NULL)
|
||||
p = strchr (dirpath, '\0');
|
||||
|
||||
if (p == dirpath)
|
||||
this_len = p - dirpath;
|
||||
|
||||
/* When we run a setuid program we do not accept any directory. */
|
||||
if (__libc_enable_secure)
|
||||
{
|
||||
/* All trusted directory must be complete name. */
|
||||
if (dirpath[0] != '/')
|
||||
continue;
|
||||
|
||||
/* If we got a list of trusted directories only accept one
|
||||
of these. */
|
||||
if (trusted_dirs != NULL)
|
||||
{
|
||||
const char **trust = trusted_dirs;
|
||||
|
||||
while (*trust != NULL)
|
||||
if (memcmp (dirpath, *trust, this_len) == 0
|
||||
&& (*trust)[this_len] == '\0')
|
||||
break;
|
||||
else
|
||||
++trust;
|
||||
|
||||
/* If directory is not trusted, ignore this directory. */
|
||||
if (*trust == NULL)
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
if (this_len == 0)
|
||||
{
|
||||
/* Two adjacent colons, or a colon at the beginning or the end of
|
||||
the path means to search the current directory. */
|
||||
@@ -442,10 +472,10 @@ open_path (const char *name, size_t namelen,
|
||||
else
|
||||
{
|
||||
/* Construct the pathname to try. */
|
||||
(void) memcpy (buf, dirpath, p - dirpath);
|
||||
buf[p - dirpath] = '/';
|
||||
(void) memcpy (&buf[(p - dirpath) + 1], name, namelen);
|
||||
buflen = p - dirpath + 1 + namelen;
|
||||
(void) memcpy (buf, dirpath, this_len);
|
||||
buf[this_len] = '/';
|
||||
(void) memcpy (&buf[this_len + 1], name, namelen);
|
||||
buflen = this_len + 1 + namelen;
|
||||
}
|
||||
|
||||
fd = __open (buf, O_RDONLY);
|
||||
@@ -508,9 +538,9 @@ _dl_map_object (struct link_map *loader, const char *name, int type,
|
||||
|
||||
size_t namelen = strlen (name) + 1;
|
||||
|
||||
inline void trypath (const char *dirpath)
|
||||
inline void trypath (const char *dirpath, const char *trusted[])
|
||||
{
|
||||
fd = open_path (name, namelen, dirpath, &realname);
|
||||
fd = open_path (name, namelen, dirpath, &realname, trusted);
|
||||
}
|
||||
|
||||
fd = -1;
|
||||
@@ -521,16 +551,24 @@ _dl_map_object (struct link_map *loader, const char *name, int type,
|
||||
if (l && l->l_info[DT_RPATH])
|
||||
trypath ((const char *) (l->l_addr +
|
||||
l->l_info[DT_STRTAB]->d_un.d_ptr +
|
||||
l->l_info[DT_RPATH]->d_un.d_val));
|
||||
l->l_info[DT_RPATH]->d_un.d_val), NULL);
|
||||
/* If dynamically linked, try the DT_RPATH of the executable itself. */
|
||||
l = _dl_loaded;
|
||||
if (fd == -1 && l && l->l_type != lt_loaded && l->l_info[DT_RPATH])
|
||||
trypath ((const char *) (l->l_addr +
|
||||
l->l_info[DT_STRTAB]->d_un.d_ptr +
|
||||
l->l_info[DT_RPATH]->d_un.d_val));
|
||||
l->l_info[DT_RPATH]->d_un.d_val), NULL);
|
||||
/* Try an environment variable (unless setuid). */
|
||||
if (fd == -1 && ! __libc_enable_secure)
|
||||
trypath (getenv ("LD_LIBRARY_PATH"));
|
||||
{
|
||||
static const char *trusted_dirs[] =
|
||||
{
|
||||
#include "trusted-dirs.h"
|
||||
NULL
|
||||
};
|
||||
|
||||
trypath (getenv ("LD_LIBRARY_PATH"), trusted_dirs);
|
||||
}
|
||||
if (fd == -1)
|
||||
{
|
||||
/* Check the list of libraries in the file /etc/ld.so.cache,
|
||||
@@ -555,7 +593,7 @@ _dl_map_object (struct link_map *loader, const char *name, int type,
|
||||
if (fd == -1)
|
||||
{
|
||||
extern const char *_dl_rpath; /* Set in rtld.c. */
|
||||
trypath (_dl_rpath);
|
||||
trypath (_dl_rpath, NULL);
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -589,7 +627,8 @@ _dl_map_object (struct link_map *loader, const char *name, int type,
|
||||
/* We haven't found an appropriate library. But since we
|
||||
are only interested in the list of libraries this isn't
|
||||
so severe. Fake an entry with all the information we
|
||||
have (in fact only the name). */
|
||||
have. */
|
||||
static const ElfW(Symndx) dummy_bucket = STN_UNDEF;
|
||||
|
||||
/* Enter the new object in the list of loaded objects. */
|
||||
if ((name_copy = local_strdup (name)) == NULL
|
||||
@@ -599,6 +638,11 @@ _dl_map_object (struct link_map *loader, const char *name, int type,
|
||||
/* We use an opencount of 0 as a sign for the faked entry. */
|
||||
l->l_opencount = 0;
|
||||
l->l_reserved = 0;
|
||||
l->l_buckets = &dummy_bucket;
|
||||
l->l_nbuckets = 1;
|
||||
l->l_relocated = 1;
|
||||
|
||||
return l;
|
||||
}
|
||||
else
|
||||
_dl_signal_error (errno, name, "cannot open shared object file");
|
||||
|
||||
+7
-3
@@ -26,11 +26,12 @@
|
||||
|
||||
static inline void __attribute__ ((unused))
|
||||
elf_get_dynamic_info (ElfW(Dyn) *dyn,
|
||||
ElfW(Dyn) *info[DT_NUM + DT_PROCNUM + DT_EXTRANUM])
|
||||
ElfW(Dyn) *info[DT_NUM + DT_PROCNUM + DT_VERSIONTAGNUM
|
||||
+ DT_EXTRANUM])
|
||||
{
|
||||
unsigned int i;
|
||||
|
||||
for (i = 0; i < DT_NUM + DT_PROCNUM + DT_EXTRANUM; ++i)
|
||||
for (i = 0; i < DT_NUM + DT_PROCNUM + DT_VERSIONTAGNUM + DT_EXTRANUM; ++i)
|
||||
info[i] = NULL;
|
||||
|
||||
if (! dyn)
|
||||
@@ -43,8 +44,11 @@ elf_get_dynamic_info (ElfW(Dyn) *dyn,
|
||||
else if (dyn->d_tag >= DT_LOPROC &&
|
||||
dyn->d_tag < DT_LOPROC + DT_PROCNUM)
|
||||
info[dyn->d_tag - DT_LOPROC + DT_NUM] = dyn;
|
||||
else if ((Elf32_Word) DT_VERSIONTAGIDX (dyn->d_tag) < DT_VERSIONTAGNUM)
|
||||
info[DT_VERSIONTAGIDX (dyn->d_tag) + DT_NUM + DT_PROCNUM] = dyn;
|
||||
else if ((Elf32_Word) DT_EXTRATAGIDX (dyn->d_tag) < DT_EXTRANUM)
|
||||
info[DT_EXTRATAGIDX (dyn->d_tag) + DT_NUM + DT_PROCNUM] = dyn;
|
||||
info[DT_EXTRATAGIDX (dyn->d_tag) + DT_NUM + DT_PROCNUM
|
||||
+ DT_VERSIONTAGNUM] = dyn;
|
||||
else
|
||||
assert (! "bad dynamic tag");
|
||||
dyn++;
|
||||
|
||||
@@ -232,6 +232,11 @@ typedef struct
|
||||
#define SHT_SHLIB 10 /* Reserved */
|
||||
#define SHT_DYNSYM 11 /* Dynamic linker symbol table */
|
||||
#define SHT_NUM 12 /* Number of defined types. */
|
||||
#define SHT_LOSUNW 0x6ffffffd /* Sun-specific low bound. */
|
||||
#define SHT_GNU_verdef 0x6ffffffd /* Version definition section. */
|
||||
#define SHT_GNU_verneed 0x6ffffffe /* Version needs section. */
|
||||
#define SHT_GNU_versym 0x6fffffff /* Version symbol table. */
|
||||
#define SHT_HISUNW 0x6fffffff /* Sun-specific high bound. */
|
||||
#define SHT_LOPROC 0x70000000 /* Start of processor-specific */
|
||||
#define SHT_HIPROC 0x7fffffff /* End of processor-specific */
|
||||
#define SHT_LOUSER 0x80000000 /* Start of application-specific */
|
||||
@@ -464,6 +469,20 @@ typedef struct
|
||||
#define DT_HIPROC 0x7fffffff /* End of processor-specific */
|
||||
#define DT_PROCNUM DT_MIPS_NUM /* Most used by any processor */
|
||||
|
||||
/* The versioning entry types. The next are defined as part of the
|
||||
GNU extension. */
|
||||
#define DT_VERSYM 0x6ffffff0
|
||||
|
||||
/* These were chosen by Sun. */
|
||||
#define DT_VERDEF 0x6ffffffc /* Address of version definition
|
||||
table */
|
||||
#define DT_VERDEFNUM 0x6ffffffd /* Number of version definitions */
|
||||
#define DT_VERNEED 0x6ffffffe /* Address of table with needed
|
||||
versions */
|
||||
#define DT_VERNEEDNUM 0x6fffffff /* Number of needed versions */
|
||||
#define DT_VERSIONTAGIDX(tag) (DT_VERNEEDNUM - (tag)) /* Reverse order! */
|
||||
#define DT_VERSIONTAGNUM 16
|
||||
|
||||
/* Sun added these machine-independent extensions in the "processor-specific"
|
||||
range. Be compatible. */
|
||||
#define DT_AUXILIARY 0x7ffffffd /* Shared object to load before self */
|
||||
@@ -471,6 +490,71 @@ typedef struct
|
||||
#define DT_EXTRATAGIDX(tag) ((Elf32_Word)-((Elf32_Sword) (tag) <<1>>1)-1)
|
||||
#define DT_EXTRANUM 3
|
||||
|
||||
/* Version definition sections. */
|
||||
|
||||
typedef struct
|
||||
{
|
||||
Elf32_Half vd_version; /* Version revision */
|
||||
Elf32_Half vd_flags; /* Version information */
|
||||
Elf32_Half vd_ndx; /* Version Index */
|
||||
Elf32_Half vd_cnt; /* Number of associated aux entries */
|
||||
Elf32_Word vd_hash; /* Version name hash value */
|
||||
Elf32_Word vd_aux; /* Offset in bytes to verdaux array */
|
||||
Elf32_Word vd_next; /* Offset in bytes to next verdef
|
||||
entry */
|
||||
} Elf32_Verdef;
|
||||
|
||||
/* Legal values for vd_version (version revision). */
|
||||
#define VER_DEF_NONE 0 /* No version */
|
||||
#define VER_DEF_CURRENT 1 /* Current version */
|
||||
#define VER_DEF_NUM 2 /* Given version number */
|
||||
|
||||
/* Legal values for vd_flags (version information flags). */
|
||||
#define VER_FLG_BASE 0x1 /* Version definition of file itself */
|
||||
#define VER_FLG_WEAK 0x2 /* Weak version identifier */
|
||||
|
||||
/* Auxialiary version information. */
|
||||
|
||||
typedef struct
|
||||
{
|
||||
Elf32_Addr vda_name; /* Version or dependency names */
|
||||
Elf32_Word vda_next; /* Offset in bytes to next verdaux
|
||||
entry */
|
||||
} Elf32_Verdaux;
|
||||
|
||||
/* Version dependency section. */
|
||||
|
||||
typedef struct
|
||||
{
|
||||
Elf32_Half vn_version; /* Version of structure */
|
||||
Elf32_Half vn_cnt; /* Number of associated aux entries */
|
||||
Elf32_Addr vn_file; /* Offset of filename for this
|
||||
dependency */
|
||||
Elf32_Word vn_aux; /* Offset in bytes to vernaux array */
|
||||
Elf32_Word vn_next; /* Offset in bytes to next verneed
|
||||
entry */
|
||||
} Elf32_Verneed;
|
||||
|
||||
/* Legal values for vn_version (version revision). */
|
||||
#define VER_NEED_NONE 0 /* No version */
|
||||
#define VER_NEED_CURRENT 1 /* Current version */
|
||||
#define VER_NEED_NUM 2 /* Given version number */
|
||||
|
||||
/* Auxiliary needed version information. */
|
||||
|
||||
typedef struct
|
||||
{
|
||||
Elf32_Word vna_hash; /* Hash value of dependency name */
|
||||
Elf32_Half vna_flags; /* Dependency specific information */
|
||||
Elf32_Half vna_other; /* Unused */
|
||||
Elf32_Addr vna_name; /* Dependency name string offset */
|
||||
Elf32_Word vna_next; /* Offset in bytes to next vernaux
|
||||
entry */
|
||||
} Elf32_Vernaux;
|
||||
|
||||
/* Legal values for vna_flags. */
|
||||
#define VER_FLG_WEAK 0x2 /* Weak verison identifier */
|
||||
|
||||
|
||||
/* Auxiliary vector. */
|
||||
|
||||
|
||||
+50
-16
@@ -29,23 +29,39 @@ TEXTDOMAIN=libc
|
||||
TEXTDOMAINDIR=@TEXTDOMAINDIR@
|
||||
|
||||
RTLD=@RTLD@
|
||||
RELOCS=
|
||||
|
||||
while test $# -gt 0; do
|
||||
case "$1" in
|
||||
--v*)
|
||||
--v | --ve | --ver | --vers | --versi | --versio | --version)
|
||||
echo $"ldd (GNU libc) @VERSION@
|
||||
Copyright (C) 1996, 1997 Free Software Foundation, Inc.
|
||||
This is free software; see the source for copying conditions. There is NO
|
||||
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
|
||||
exit 0 ;;
|
||||
--h*)
|
||||
--h | --he | --hel | --help)
|
||||
echo $"ldd [OPTION]... FILE...
|
||||
--help print this help and exit
|
||||
--version print version information and exit
|
||||
--help print this help and exit
|
||||
--version print version information and exit
|
||||
-d, --data-relocs process data relocations
|
||||
-r, --function-relocs process data and function relocations
|
||||
Report bugs using the \`glibcbug' script to <bugs@gnu.ai.mit.edu>."
|
||||
exit 0 ;;
|
||||
-d | --d | --da | --dat | --data | --data- | --data-r | --data-re | \
|
||||
--data-rel | --data-relo | --data-reloc | --data-relocs)
|
||||
RELOCS='--data-relocs'
|
||||
shift ;;
|
||||
-r | --f | --fu | --fun | --func | --funct | --functi | --functio | \
|
||||
--function | --function- | --function-r | --function-re | --function-rel | \
|
||||
--function-relo | --function-reloc | --function-relocs)
|
||||
RELOCS='--function-relocs'
|
||||
shift ;;
|
||||
--) # Stop option processing.
|
||||
shift; break ;;
|
||||
-*)
|
||||
echo >&2 $"ldd: unrecognized option" "\`$1'"
|
||||
echo >&2 $"Try \`ldd --help' for more information."
|
||||
exit 1 ;;
|
||||
*)
|
||||
break ;;
|
||||
esac
|
||||
@@ -53,9 +69,8 @@ done
|
||||
|
||||
case $# in
|
||||
0)
|
||||
echo >&2 $"\
|
||||
ldd: missing file arguments
|
||||
Try \`ldd --help' for more information."
|
||||
echo >&2 $"ldd: missing file arguments"
|
||||
echo >&2 $"Try \`ldd --help' for more information."
|
||||
exit 1 ;;
|
||||
1)
|
||||
# We don't list the file name when there is only one.
|
||||
@@ -64,15 +79,25 @@ Try \`ldd --help' for more information."
|
||||
*) file="./$1" ;;
|
||||
esac
|
||||
if test ! -f "$file"; then
|
||||
echo "${file}:" $"no such file"
|
||||
elif ${RTLD} --verify "$file"; then
|
||||
LD_TRACE_LOADED_OBJECTS=1 exec ${RTLD} "$file" && exit 1
|
||||
echo "ldd: ${file}:" $"no such file"
|
||||
exit 1
|
||||
elif test -r "$file"; then
|
||||
test -x "$file" ||
|
||||
echo $"ldd: warning: you do not have execution permission for" "\`$file'"
|
||||
if ${RTLD} --verify "$file"; then
|
||||
LD_TRACE_LOADED_OBJECTS=1 exec ${RTLD} ${RELOCS} "$file" || exit 1
|
||||
else
|
||||
echo $" not a dynamic executable"
|
||||
exit 1
|
||||
fi
|
||||
else
|
||||
echo $" not a dynamic executable"
|
||||
echo $"ldd: error: you do not have read permission for" "\`$file'"
|
||||
exit 1
|
||||
fi
|
||||
exit ;;
|
||||
*)
|
||||
set -e # Bail out immediately if ${RTLD} loses on any argument.
|
||||
result=0
|
||||
for file; do
|
||||
echo "${file}:"
|
||||
case "$file" in
|
||||
@@ -80,16 +105,25 @@ Try \`ldd --help' for more information."
|
||||
*) file="./$file" ;;
|
||||
esac
|
||||
if test ! -f "$file"; then
|
||||
echo "$file:" $"no such file"
|
||||
elif ${RTLD} --verify "$file"; then
|
||||
LD_TRACE_LOADED_OBJECTS=1 ${RTLD} "$file"
|
||||
echo "ldd: ${file}:" $"no such file"
|
||||
result=1
|
||||
elif test -r "$file"; then
|
||||
test -x "$file" || echo $"\
|
||||
ldd: warning: you do not have execution permission for" "\`$file'"
|
||||
if ${RTLD} --verify "$file"; then
|
||||
LD_TRACE_LOADED_OBJECTS=1 ${RTLD} ${RELOCS} "$file" || result=1
|
||||
else
|
||||
echo $" not a dynamic executable"
|
||||
result=1
|
||||
fi
|
||||
else
|
||||
echo $" not a dynamic executable"
|
||||
echo $"ldd: error: you do not have read permission for" "\`$file'"
|
||||
result=1
|
||||
fi
|
||||
done
|
||||
esac
|
||||
|
||||
exit 0
|
||||
exit $result
|
||||
# Local Variables:
|
||||
# mode:ksh
|
||||
# End:
|
||||
|
||||
+53
-13
@@ -25,23 +25,40 @@
|
||||
# variable LD_TRACE_LOADED_OBJECTS to a non-empty value.
|
||||
|
||||
RTLD=@RTLD@
|
||||
RELOCS=
|
||||
|
||||
while test $# -gt 0; do
|
||||
case "$1" in
|
||||
--v*)
|
||||
--v | --ve | --ver | --vers | --versi | --versio | --version)
|
||||
echo 'ldd (GNU libc) @VERSION@
|
||||
Copyright (C) 1996, 1997 Free Software Foundation, Inc.
|
||||
This is free software; see the source for copying conditions. There is NO
|
||||
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.'
|
||||
exit 0 ;;
|
||||
--h*)
|
||||
--h | --he | --hel | --help)
|
||||
echo "ldd [OPTION]... FILE...
|
||||
--help print this help and exit
|
||||
--version print version information and exit
|
||||
--help print this help and exit
|
||||
--version print version information and exit
|
||||
-d, --data-relocs process data relocations
|
||||
-r, --function-relocs process data and function relocations
|
||||
Report bugs using the \`glibcbug' script to <bugs@gnu.ai.mit.edu>."
|
||||
exit 0 ;;
|
||||
-d | --d | --da | --dat | --data | --data- | --data-r | --data-re | \
|
||||
--data-rel | --data-relo | --data-reloc | --data-relocs)
|
||||
RELOCS='--data-relocs'
|
||||
shift ;;
|
||||
-r | --f | --fu | --fun | --func | --funct | --functi | --functio | \
|
||||
--function | --function- | --function-r | --function-re | --function-rel | \
|
||||
--function-relo | --function-reloc | --function-relocs)
|
||||
RELOCS='--function-relocs'
|
||||
shift ;;
|
||||
--) # Stop option processing.
|
||||
shift; break ;;
|
||||
-*)
|
||||
echo >&2 "\
|
||||
ldd: unrecognized option \`$1'
|
||||
Try \`ldd --help' for more information."
|
||||
exit 1 ;;
|
||||
*)
|
||||
break ;;
|
||||
esac
|
||||
@@ -60,15 +77,27 @@ Try \`ldd --help' for more information."
|
||||
*) file="./$1" ;;
|
||||
esac
|
||||
if test ! -f "$file"; then
|
||||
echo "${file}: no such file"
|
||||
elif ${RTLD} --verify "$file"; then
|
||||
LD_TRACE_LOADED_OBJECTS=1 exec ${RTLD} "$file" && exit 1
|
||||
echo "ldd: ${file}: no such file"
|
||||
exit 1
|
||||
else
|
||||
echo ' not a dynamic executable'
|
||||
if test -r "$file"; then
|
||||
test -x "$file" ||
|
||||
echo "ldd: warning: you do not have execution permission for \`$file'"
|
||||
if ${RTLD} --verify "$file"; then
|
||||
LD_TRACE_LOADED_OBJECTS=1 exec ${RTLD} ${RELOCS} "$file" || exit 1
|
||||
else
|
||||
echo ' not a dynamic executable'
|
||||
exit 1
|
||||
fi
|
||||
else
|
||||
echo "ldd: error: you do not have read permission for \`$file'"
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
exit ;;
|
||||
*)
|
||||
set -e # Bail out immediately if ${RTLD} loses on any argument.
|
||||
result=0
|
||||
for file; do
|
||||
echo "${file}:"
|
||||
case "$file" in
|
||||
@@ -76,13 +105,24 @@ Try \`ldd --help' for more information."
|
||||
*) file="./$file" ;;
|
||||
esac
|
||||
if test ! -f "$file"; then
|
||||
echo "$file: no such file"
|
||||
elif ${RTLD} --verify "$file"; then
|
||||
LD_TRACE_LOADED_OBJECTS=1 ${RTLD} "$file"
|
||||
echo "ldd: ${file}: no such file"
|
||||
result=1
|
||||
else
|
||||
echo ' not a dynamic executable'
|
||||
if test -r "$file"; then
|
||||
test -x "$file" || echo "\
|
||||
ldd: warning: you do not have execution permission for \`$file'"
|
||||
if ${RTLD} --verify "$file"; then
|
||||
LD_TRACE_LOADED_OBJECTS=1 ${RTLD} ${RELOCS} "$file" || result=1
|
||||
else
|
||||
echo ' not a dynamic executable'
|
||||
result=1
|
||||
fi
|
||||
else
|
||||
echo "ldd: error: you do not have read permission for \`$file'"
|
||||
result=1
|
||||
fi
|
||||
fi
|
||||
done
|
||||
esac
|
||||
|
||||
exit 0
|
||||
exit $result
|
||||
|
||||
+27
-5
@@ -18,13 +18,17 @@
|
||||
Boston, MA 02111-1307, USA. */
|
||||
|
||||
#ifndef _LINK_H
|
||||
|
||||
#define _LINK_H 1
|
||||
#include <features.h>
|
||||
|
||||
#define __need_size_t
|
||||
#include <stddef.h>
|
||||
|
||||
#include <elf.h>
|
||||
|
||||
__BEGIN_DECLS
|
||||
|
||||
/* We use this macro to refer to ELF types independent of the native wordsize.
|
||||
`ElfW(TYPE)' is used in place of `Elf32_TYPE' or `Elf64_TYPE'. */
|
||||
#define ElfW(type) _ElfW (Elf, __ELF_NATIVE_CLASS, type)
|
||||
@@ -99,9 +103,12 @@ struct link_map
|
||||
[0,DT_NUM) are indexed by the processor-independent tags.
|
||||
[DT_NUM,DT_NUM+DT_PROCNUM) are indexed by the tag minus DT_LOPROC.
|
||||
[DT_NUM+DT_PROCNUM,DT_NUM+DT_PROCNUM+DT_EXTRANUM) are indexed
|
||||
by DT_EXTRATAGIDX(tagvalue) (see <elf.h>). */
|
||||
by DT_EXTRATAGIDX(tagvalue) and
|
||||
[DT_NUM+DT_PROCNUM+DT_VERSIONTAGNUM,
|
||||
DT_NUM+DT_PROCNUM+DT_VERSIONTAGNUM+DT_EXTRANUM)
|
||||
are indexed by DT_EXTRATAGIDX(tagvalue) (see <elf.h>). */
|
||||
|
||||
ElfW(Dyn) *l_info[DT_NUM + DT_PROCNUM + DT_EXTRANUM];
|
||||
ElfW(Dyn) *l_info[DT_NUM + DT_PROCNUM + DT_VERSIONTAGNUM + DT_EXTRANUM];
|
||||
const ElfW(Phdr) *l_phdr; /* Pointer to program header table in core. */
|
||||
ElfW(Addr) l_entry; /* Entry point location. */
|
||||
ElfW(Half) l_phnum; /* Number of program header entries. */
|
||||
@@ -137,6 +144,12 @@ struct link_map
|
||||
unsigned int l_global:1; /* Nonzero if object in _dl_global_scope. */
|
||||
unsigned int l_reserved:2; /* Reserved for internal use. */
|
||||
};
|
||||
|
||||
|
||||
/* Function used as argument for `_dl_receive_error' function. The
|
||||
arguments are the error string and the objname the error occurred
|
||||
in. */
|
||||
typedef void (*receiver_fct) (const char *, const char *);
|
||||
|
||||
/* Internal functions of the run-time dynamic linker.
|
||||
These can be accessed if you link again the dynamic linker
|
||||
@@ -161,6 +174,11 @@ extern int _dl_sysdep_open_zero_fill (void); /* dl-sysdep.c */
|
||||
are concatenated to form the message to print. */
|
||||
extern void _dl_sysdep_message (const char *string, ...);
|
||||
|
||||
/* OS-dependent function to write a message on the standard error.
|
||||
All arguments are `const char *'; args until a null pointer
|
||||
are concatenated to form the message to print. */
|
||||
extern void _dl_sysdep_error (const char *string, ...);
|
||||
|
||||
/* OS-dependent function to give a fatal error message and exit
|
||||
when the dynamic linker fails before the program is fully linked.
|
||||
All arguments are `const char *'; args until a null pointer
|
||||
@@ -177,11 +195,9 @@ extern int _dl_secure;
|
||||
zero; OBJECT is the name of the problematical shared object, or null if
|
||||
it is a general problem; ERRSTRING is a string describing the specific
|
||||
problem. */
|
||||
|
||||
extern void _dl_signal_error (int errcode,
|
||||
const char *object,
|
||||
const char *errstring)
|
||||
__attribute__ ((__noreturn__));
|
||||
const char *errstring);
|
||||
|
||||
/* Call OPERATE, catching errors from `dl_signal_error'. If there is no
|
||||
error, *ERRSTRING is set to null. If there is an error, *ERRSTRING and
|
||||
@@ -192,6 +208,11 @@ extern int _dl_catch_error (char **errstring,
|
||||
const char **object,
|
||||
void (*operate) (void));
|
||||
|
||||
/* Call OPERATE, receiving errors from `dl_signal_error'. Unlike
|
||||
`_dl_catch_error' the operation is resumed after the OPERATE
|
||||
function returns. */
|
||||
extern void _dl_receive_error (receiver_fct fct, void (*operate) (void));
|
||||
|
||||
|
||||
/* Helper function for <dlfcn.h> functions. Runs the OPERATE function via
|
||||
_dl_catch_error. Returns zero for success, nonzero for failure; and
|
||||
@@ -323,5 +344,6 @@ extern void _dl_debug_state (void);
|
||||
in the `r_ldbase' member. Returns the address of the structure. */
|
||||
extern struct r_debug *_dl_debug_initialize (ElfW(Addr) ldbase);
|
||||
|
||||
__END_DECLS
|
||||
|
||||
#endif /* link.h */
|
||||
|
||||
+93
-32
@@ -1,5 +1,5 @@
|
||||
/* Run time dynamic linker.
|
||||
Copyright (C) 1995, 1996 Free Software Foundation, Inc.
|
||||
Copyright (C) 1995, 1996, 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
|
||||
@@ -44,6 +44,10 @@ extern void *_dl_sysdep_read_whole_file (const char *filename,
|
||||
size_t *filesize_ptr,
|
||||
int mmap_prot);
|
||||
|
||||
/* Helper function to handle errors while resolving symbols. */
|
||||
static void print_unresolved (const char *errstring, const char *objname);
|
||||
|
||||
|
||||
int _dl_argc;
|
||||
char **_dl_argv;
|
||||
const char *_dl_rpath;
|
||||
@@ -142,11 +146,19 @@ dl_main (const ElfW(Phdr) *phdr,
|
||||
enum { normal, list, verify, trace } mode;
|
||||
struct link_map **preloads;
|
||||
unsigned int npreloads;
|
||||
const char *preloadlist;
|
||||
size_t file_size;
|
||||
char *file;
|
||||
|
||||
mode = getenv ("LD_TRACE_LOADED_OBJECTS") != NULL ? trace : normal;
|
||||
|
||||
/* LAZY is determined by the parameters --datadeps and --function-deps
|
||||
if we trace the binary. */
|
||||
if (mode == trace)
|
||||
lazy = -1;
|
||||
else
|
||||
lazy = !__libc_enable_secure && *(getenv ("LD_BIND_NOW") ?: "") == '\0';
|
||||
|
||||
/* Set up a flag which tells we are just starting. */
|
||||
_dl_starting_up = 1;
|
||||
|
||||
@@ -186,22 +198,44 @@ of this helper program; chances are you did not intend to run this program.\n",
|
||||
/* Note the place where the dynamic linker actually came from. */
|
||||
_dl_rtld_map.l_name = _dl_argv[0];
|
||||
|
||||
if (! strcmp (_dl_argv[1], "--list"))
|
||||
{
|
||||
mode = list;
|
||||
while (_dl_argc > 1)
|
||||
if (! strcmp (_dl_argv[1], "--list"))
|
||||
{
|
||||
mode = list;
|
||||
lazy = -1; /* This means do no dependency analysis. */
|
||||
|
||||
++_dl_skip_args;
|
||||
--_dl_argc;
|
||||
++_dl_argv;
|
||||
}
|
||||
else if (! strcmp (_dl_argv[1], "--verify"))
|
||||
{
|
||||
mode = verify;
|
||||
++_dl_skip_args;
|
||||
--_dl_argc;
|
||||
++_dl_argv;
|
||||
}
|
||||
else if (! strcmp (_dl_argv[1], "--verify"))
|
||||
{
|
||||
mode = verify;
|
||||
|
||||
++_dl_skip_args;
|
||||
--_dl_argc;
|
||||
++_dl_argv;
|
||||
}
|
||||
++_dl_skip_args;
|
||||
--_dl_argc;
|
||||
++_dl_argv;
|
||||
}
|
||||
else if (! strcmp (_dl_argv[1], "--data-relocs"))
|
||||
{
|
||||
mode = trace;
|
||||
lazy = 1; /* This means do only data relocation analysis. */
|
||||
|
||||
++_dl_skip_args;
|
||||
--_dl_argc;
|
||||
++_dl_argv;
|
||||
}
|
||||
else if (! strcmp (_dl_argv[1], "--function-relocs"))
|
||||
{
|
||||
mode = trace;
|
||||
lazy = 0; /* This means do also function relocation analysis. */
|
||||
|
||||
++_dl_skip_args;
|
||||
--_dl_argc;
|
||||
++_dl_argv;
|
||||
}
|
||||
else
|
||||
break;
|
||||
|
||||
++_dl_skip_args;
|
||||
--_dl_argc;
|
||||
@@ -311,22 +345,22 @@ of this helper program; chances are you did not intend to run this program.\n",
|
||||
preloads = NULL;
|
||||
npreloads = 0;
|
||||
|
||||
if (! __libc_enable_secure)
|
||||
preloadlist = getenv ("LD_PRELOAD");
|
||||
if (preloadlist)
|
||||
{
|
||||
const char *preloadlist = getenv ("LD_PRELOAD");
|
||||
if (preloadlist)
|
||||
{
|
||||
/* The LD_PRELOAD environment variable gives a colon-separated
|
||||
list of libraries that are loaded before the executable's
|
||||
dependencies and prepended to the global scope list. */
|
||||
char *list = strdupa (preloadlist);
|
||||
char *p;
|
||||
while ((p = strsep (&list, ":")) != NULL)
|
||||
{
|
||||
(void) _dl_map_object (NULL, p, lt_library, 0);
|
||||
++npreloads;
|
||||
}
|
||||
}
|
||||
/* The LD_PRELOAD environment variable gives a white space
|
||||
separated list of libraries that are loaded before the
|
||||
executable's dependencies and prepended to the global scope
|
||||
list. If the binary is running setuid all elements
|
||||
containing a '/' are ignored since it is insecure. */
|
||||
char *list = strdupa (preloadlist);
|
||||
char *p;
|
||||
while ((p = strsep (&list, " ")) != NULL)
|
||||
if (! __libc_enable_secure || strchr (p, '/') == NULL)
|
||||
{
|
||||
(void) _dl_map_object (NULL, p, lt_library, 0);
|
||||
++npreloads;
|
||||
}
|
||||
}
|
||||
|
||||
/* Read the contents of the file. */
|
||||
@@ -495,12 +529,31 @@ of this helper program; chances are you did not intend to run this program.\n",
|
||||
*--bp = '0';
|
||||
_dl_sysdep_message (" in object at 0x", bp, "\n", NULL);
|
||||
}
|
||||
else if (lazy >= 0)
|
||||
{
|
||||
/* We have to do symbol dependency testing. */
|
||||
void doit (void)
|
||||
{
|
||||
_dl_relocate_object (l, _dl_object_relocation_scope (l), lazy);
|
||||
}
|
||||
|
||||
l = _dl_loaded;
|
||||
while (l->l_next)
|
||||
l = l->l_next;
|
||||
do
|
||||
{
|
||||
if (l != &_dl_rtld_map && l->l_opencount > 0)
|
||||
{
|
||||
_dl_receive_error (print_unresolved, doit);
|
||||
*_dl_global_scope_end = NULL;
|
||||
}
|
||||
l = l->l_prev;
|
||||
} while (l);
|
||||
}
|
||||
|
||||
_exit (0);
|
||||
}
|
||||
|
||||
lazy = !__libc_enable_secure && *(getenv ("LD_BIND_NOW") ?: "") == '\0';
|
||||
|
||||
{
|
||||
/* Now we have all the objects loaded. Relocate them all except for
|
||||
the dynamic linker itself. We do this in reverse order so that copy
|
||||
@@ -572,3 +625,11 @@ of this helper program; chances are you did not intend to run this program.\n",
|
||||
/* Once we return, _dl_sysdep_start will invoke
|
||||
the DT_INIT functions and then *USER_ENTRY. */
|
||||
}
|
||||
|
||||
/* This is a little helper function for resolving symbols while
|
||||
tracing the binary. */
|
||||
static void
|
||||
print_unresolved (const char *errstring, const char *objname)
|
||||
{
|
||||
_dl_sysdep_error (errstring, " (", objname, ")\n", NULL);
|
||||
}
|
||||
|
||||
+14
-23
@@ -29,11 +29,11 @@ trap 'rm -f $TEMP $TEMP.x' 0
|
||||
PASSWD="cat /etc/passwd"
|
||||
|
||||
if [ -f /usr/lib/sendmail ] ; then
|
||||
RMAIL="/usr/lib/sendmail -oi -t"
|
||||
MAIL_AGENT="/usr/lib/sendmail -oi -t"
|
||||
elif [ -f /usr/sbin/sendmail ] ; then
|
||||
RMAIL="/usr/sbin/sendmail -oi -t"
|
||||
MAIL_AGENT="/usr/sbin/sendmail -oi -t"
|
||||
else
|
||||
RMAIL=rmail
|
||||
MAIL_AGENT=rmail
|
||||
fi
|
||||
|
||||
# Figure out how to echo a string without a trailing newline
|
||||
@@ -86,7 +86,6 @@ ARCH=`[ -f /bin/arch ] && /bin/arch`
|
||||
MACHINE=`[ -f /bin/machine ] && /bin/machine`
|
||||
|
||||
ORGANIZATION_C='<organization of PR author (multiple lines)>'
|
||||
CONFIDENTIAL_C='<[ yes | no ] (one line)>'
|
||||
SYNOPSIS_C='<synopsis of the problem (one line)>'
|
||||
SEVERITY_C='<[ non-critical | serious | critical ] (one line)>'
|
||||
PRIORITY_C='<[ low | medium | high ] (one line)>'
|
||||
@@ -107,11 +106,11 @@ From: ${USER}
|
||||
To: ${BUGADDR}
|
||||
Subject: [50 character or so descriptive subject here (for reference)]
|
||||
|
||||
>Submitter-Id: <submitter ID>
|
||||
>Submitter-Id: net
|
||||
>Originator: ${ORIGINATOR}
|
||||
>Organization:
|
||||
${ORGANIZATION- $ORGANIZATION_C}
|
||||
>Confidential: $CONFIDENTIAL_C
|
||||
>Confidential: no
|
||||
>Synopsis: $SYNOPSIS_C
|
||||
>Severity: $SEVERITY_C
|
||||
>Priority: $PRIORITY_C
|
||||
@@ -119,7 +118,7 @@ ${ORGANIZATION- $ORGANIZATION_C}
|
||||
>Class: $CLASS_C
|
||||
>Release: libc-${VERSION}
|
||||
>Environment:
|
||||
<machine, os, target, libraries (multiple lines)>
|
||||
$ENVIRONMENT_C
|
||||
`[ -n "$SYSTEM" ] && echo System: $SYSTEM`
|
||||
`[ -n "$ARCH" ] && echo Architecture: $ARCH`
|
||||
`[ -n "$MACHINE" ] && echo Machine: $MACHINE`
|
||||
@@ -153,8 +152,8 @@ SED_CMD='
|
||||
/$PATTERN/{
|
||||
s|||
|
||||
s|<.*>||
|
||||
s|^[ ]*||
|
||||
s|[ ]*$||
|
||||
s|^[ ]*||
|
||||
s|[ ]*$||
|
||||
p
|
||||
q
|
||||
}'
|
||||
@@ -163,16 +162,8 @@ q
|
||||
while :; do
|
||||
CNT=0
|
||||
|
||||
# 1) Confidential
|
||||
#
|
||||
PATTERN=">Confidential:"
|
||||
CONFIDENTIAL=`eval sed -n -e "\"$SED_CMD\"" $TEMP`
|
||||
case "$CONFIDENTIAL" in
|
||||
""|yes|no) CNT=`expr $CNT + 1` ;;
|
||||
*) echo "$COMMAND: \`$CONFIDENTIAL' is not a valid value for \`Confidential'." ;;
|
||||
esac
|
||||
#
|
||||
# 2) Severity
|
||||
# 1) Severity
|
||||
#
|
||||
PATTERN=">Severity:"
|
||||
SEVERITY=`eval sed -n -e "\"$SED_CMD\"" $TEMP`
|
||||
@@ -181,7 +172,7 @@ while :; do
|
||||
*) echo "$COMMAND: \`$SEVERITY' is not a valid value for \`Severity'."
|
||||
esac
|
||||
#
|
||||
# 3) Priority
|
||||
# 2) Priority
|
||||
#
|
||||
PATTERN=">Priority:"
|
||||
PRIORITY=`eval sed -n -e "\"$SED_CMD\"" $TEMP`
|
||||
@@ -190,7 +181,7 @@ while :; do
|
||||
*) echo "$COMMAND: \`$PRIORITY' is not a valid value for \`Priority'."
|
||||
esac
|
||||
#
|
||||
# 4) Class
|
||||
# 3) Class
|
||||
#
|
||||
PATTERN=">Class:"
|
||||
CLASS=`eval sed -n -e "\"$SED_CMD\"" $TEMP`
|
||||
@@ -199,7 +190,7 @@ while :; do
|
||||
*) echo "$COMMAND: \`$CLASS' is not a valid value for \`Class'."
|
||||
esac
|
||||
|
||||
[ $CNT -lt 5 ] &&
|
||||
[ $CNT -lt 3 ] &&
|
||||
echo "Errors were found with the problem report."
|
||||
|
||||
while :; do
|
||||
@@ -239,9 +230,9 @@ sed -e "
|
||||
/^>Description:/,/^>[A-Za-z-]*:/s;$DESCRIPTION_C;;
|
||||
/^>How-To-Repeat:/,/^>[A-Za-z-]*:/s;$HOW_TO_REPEAT_C;;
|
||||
/^>Fix:/,/^>[A-Za-z-]*:/s;$FIX_C;;
|
||||
" $TEMP > $REF
|
||||
" $TEMP > $TEMP.x
|
||||
|
||||
if $MAIL_AGENT < $REF; then
|
||||
if $MAIL_AGENT < $TEMP.x; then
|
||||
echo "$COMMAND: problem report sent"
|
||||
xs=0; exit
|
||||
else
|
||||
|
||||
+4
-4
@@ -1,4 +1,4 @@
|
||||
# Copyright (C) 1995, 1996 Free Software Foundation, Inc.
|
||||
# Copyright (C) 1995, 1996, 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
|
||||
@@ -12,9 +12,9 @@
|
||||
# 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., 675 Mass Ave,
|
||||
# Cambridge, MA 02139, USA.
|
||||
# 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.
|
||||
|
||||
#
|
||||
# Sub-makefile for gmon portion of the library.
|
||||
|
||||
+2
-2
@@ -1,5 +1,5 @@
|
||||
/* Header with interface version macros for library pieces copied elsewhere.
|
||||
Copyright (C) 1995, 1996 Free Software Foundation, Inc.
|
||||
Copyright (C) 1995, 1996, 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
|
||||
@@ -47,7 +47,7 @@
|
||||
#define _GNU_OBSTACK_INTERFACE_VERSION 1 /* vs malloc/obstack.c */
|
||||
#define _GNU_REGEX_INTERFACE_VERSION 1 /* vs posix/regex.c */
|
||||
#define _GNU_GLOB_INTERFACE_VERSION 1 /* vs posix/glob.c */
|
||||
#define _GNU_GETOPT_INTERFACE_VERSION 1 /* vs posix/getopt.c and
|
||||
#define _GNU_GETOPT_INTERFACE_VERSION 2 /* vs posix/getopt.c and
|
||||
posix/getopt1.c */
|
||||
|
||||
#endif /* gnu-versions.h */
|
||||
|
||||
+4
-4
@@ -1,4 +1,4 @@
|
||||
# Copyright (C) 1991 Free Software Foundation, Inc.
|
||||
# Copyright (C) 1991, 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
|
||||
@@ -12,9 +12,9 @@
|
||||
# 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., 675 Mass Ave,
|
||||
# Cambridge, MA 02139, USA.
|
||||
# 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.
|
||||
|
||||
subdir := gnulib
|
||||
|
||||
|
||||
+4
-4
@@ -1,4 +1,4 @@
|
||||
# Copyright (C) 1991, 1992, 1996 Free Software Foundation, Inc.
|
||||
# Copyright (C) 1991, 1992, 1996, 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
|
||||
@@ -12,9 +12,9 @@
|
||||
# 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., 675 Mass Ave,
|
||||
# Cambridge, MA 02139, USA.
|
||||
# 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.
|
||||
|
||||
#
|
||||
# Sub-makefile for grp portion of the library.
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/* Copyright (C) 1991, 1992, 1995, 1996 Free Software Foundation, Inc.
|
||||
/* Copyright (C) 1991, 1992, 1995, 1996, 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
|
||||
@@ -91,10 +91,13 @@ extern struct group *getgrgid __P ((__gid_t __gid));
|
||||
/* Search for an entry with a matching group name. */
|
||||
extern struct group *getgrnam __P ((__const char *__name));
|
||||
|
||||
#ifdef __USE_REENTRANT
|
||||
#if defined __USE_POSIX || defined __USE_MISC
|
||||
|
||||
#ifdef __USE_MISC
|
||||
/* Reasonable value for the buffer sized used in the reentrant
|
||||
functions below. But better use `sysconf'. */
|
||||
#define NSS_BUFLEN_GROUP 1024
|
||||
#endif
|
||||
|
||||
/* Reentrant versions of some of the functions above.
|
||||
|
||||
@@ -132,7 +135,7 @@ extern int fgetgrent_r __P ((FILE * __stream, struct group *__resultbuf,
|
||||
struct group **__result));
|
||||
#endif
|
||||
|
||||
#endif /* reentrant */
|
||||
#endif /* POSIX or reentrant */
|
||||
|
||||
|
||||
#ifdef __USE_BSD
|
||||
|
||||
+7
-6
@@ -1,4 +1,4 @@
|
||||
# Copyright (C) 1991, 92, 93, 94, 95, 96 Free Software Foundation, Inc.
|
||||
# Copyright (C) 1991, 92, 93, 94, 95, 96, 97 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
|
||||
@@ -12,9 +12,9 @@
|
||||
# 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., 675 Mass Ave,
|
||||
# Cambridge, MA 02139, USA.
|
||||
# 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.
|
||||
|
||||
subdir := hurd
|
||||
|
||||
@@ -74,9 +74,10 @@ include ../Rules
|
||||
# to get installed.
|
||||
sunrpc-headers = netdb.h pmap_prot.h xdr.h types.h auth.h \
|
||||
rpc_msg.h auth_unix.h
|
||||
installed-sunrpc-headers = $(addprefix $(includedir)/rpc/,$(sunrpc-headers))
|
||||
installed-sunrpc-headers = $(addprefix $(inst_includedir)/rpc/, \
|
||||
$(sunrpc-headers))
|
||||
install-headers-nosubdir: $(installed-sunrpc-headers)
|
||||
$(installed-sunrpc-headers): $(includedir)/%: $(..)sunrpc/%
|
||||
$(installed-sunrpc-headers): $(inst_includedir)/%: $(..)sunrpc/%
|
||||
$(do-install)
|
||||
|
||||
|
||||
|
||||
+23
-17
@@ -1,20 +1,20 @@
|
||||
/* Copyright (C) 1993, 1994, 1995, 1996 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
/* Copyright (C) 1993, 1994, 1995, 1996, 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 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.
|
||||
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., 675 Mass Ave,
|
||||
Cambridge, MA 02139, USA. */
|
||||
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. */
|
||||
|
||||
#ifndef _HURD_H
|
||||
|
||||
@@ -109,11 +109,10 @@ extern pid_t _hurd_pid, _hurd_ppid, _hurd_pgrp;
|
||||
extern int _hurd_orphaned;
|
||||
|
||||
/* This variable is incremented every time the process IDs change. */
|
||||
|
||||
unsigned int _hurd_pids_changed_stamp;
|
||||
extern unsigned int _hurd_pids_changed_stamp;
|
||||
|
||||
/* This condition is broadcast every time the process IDs change. */
|
||||
struct condition _hurd_pids_changed_sync;
|
||||
extern struct condition _hurd_pids_changed_sync;
|
||||
|
||||
/* Unix `data break', for brk and sbrk.
|
||||
If brk and sbrk are not used, this info will not be initialized or used. */
|
||||
@@ -304,4 +303,11 @@ extern int hurd_check_cancel (void);
|
||||
extern io_t __getdport (int fd), getdport (int fd);
|
||||
|
||||
|
||||
#include <stdarg.h>
|
||||
|
||||
/* Write formatted output to PORT, a Mach port supporting the i/o protocol,
|
||||
according to the format string FORMAT, using the argument list in ARG. */
|
||||
int vpprintf (io_t port, const char *format, va_list arg);
|
||||
|
||||
|
||||
#endif /* hurd.h */
|
||||
|
||||
+15
-15
@@ -1,21 +1,21 @@
|
||||
/* Set a host configuration item kept as the whole contents of a file.
|
||||
Copyright (C) 1996 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
Copyright (C) 1996, 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 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.
|
||||
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., 675 Mass Ave,
|
||||
Cambridge, MA 02139, USA. */
|
||||
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 <fcntl.h>
|
||||
#include <hurd.h>
|
||||
@@ -28,7 +28,7 @@ _hurd_set_host_config (const char *item, const char *value, size_t valuelen)
|
||||
mach_msg_type_number_t nwrote;
|
||||
file_t new, dir;
|
||||
|
||||
dir = __file_name_split (item, &item);
|
||||
dir = __file_name_split (item, (char **)&item);
|
||||
if (dir == MACH_PORT_NULL)
|
||||
return -1;
|
||||
|
||||
|
||||
+23
-22
@@ -1,30 +1,30 @@
|
||||
/* Copyright (C) 1991, 1994 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
/* Copyright (C) 1991, 1994, 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 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.
|
||||
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., 675 Mass Ave,
|
||||
Cambridge, MA 02139, USA. */
|
||||
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 <ansidecl.h>
|
||||
#include <stdarg.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <hurd.h>
|
||||
|
||||
static ssize_t
|
||||
DEFUN(pwrite, (cookie, buf, n),
|
||||
PTR cookie AND CONST char *buf AND size_t n)
|
||||
pwrite (void *cookie,
|
||||
const char *buf,
|
||||
size_t n)
|
||||
{
|
||||
error_t error = __io_write ((io_t) cookie, buf, n, -1,
|
||||
(mach_msg_type_number_t *) &n);
|
||||
@@ -37,24 +37,25 @@ DEFUN(pwrite, (cookie, buf, n),
|
||||
/* Write formatted output to PORT, a Mach port supporting the i/o protocol,
|
||||
according to the format string FORMAT, using the argument list in ARG. */
|
||||
int
|
||||
DEFUN(vpprintf, (port, format, arg),
|
||||
io_t port AND CONST char *format AND va_list arg)
|
||||
vpprintf (io_t port,
|
||||
const char *format,
|
||||
va_list arg)
|
||||
{
|
||||
int done;
|
||||
FILE f;
|
||||
|
||||
/* Create an unbuffered stream talking to PORT on the stack. */
|
||||
memset((PTR) &f, 0, sizeof(f));
|
||||
memset ((void *) &f, 0, sizeof (f));
|
||||
f.__magic = _IOMAGIC;
|
||||
f.__mode.__write = 1;
|
||||
f.__cookie = (PTR) port;
|
||||
f.__cookie = (void *) port;
|
||||
f.__room_funcs = __default_room_functions;
|
||||
f.__io_funcs.__write = pwrite;
|
||||
f.__seen = 1;
|
||||
f.__userbuf = 1;
|
||||
|
||||
/* vfprintf will use a buffer on the stack for the life of the call. */
|
||||
done = vfprintf(&f, format, arg);
|
||||
done = vfprintf (&f, format, arg);
|
||||
|
||||
return done;
|
||||
}
|
||||
|
||||
+12
-13
@@ -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.
|
||||
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
@@ -28,12 +28,12 @@ __BEGIN_DECLS
|
||||
|
||||
/* Structure to represent one entry of the alias data base. */
|
||||
struct aliasent
|
||||
{
|
||||
char *alias_name;
|
||||
size_t alias_members_len;
|
||||
char **alias_members;
|
||||
int alias_local;
|
||||
};
|
||||
{
|
||||
char *alias_name;
|
||||
size_t alias_members_len;
|
||||
char **alias_members;
|
||||
int alias_local;
|
||||
};
|
||||
|
||||
|
||||
/* Open alias data base files. */
|
||||
@@ -45,19 +45,18 @@ extern void endaliasent __P ((void));
|
||||
/* Get the next entry from the alias data base. */
|
||||
extern struct aliasent *getaliasent __P ((void));
|
||||
|
||||
/* Get alias entry corresponding to NAME. */
|
||||
extern struct aliasent *getaliasbyname __P ((__const char *__name));
|
||||
|
||||
#ifdef __USE_REENTRANT
|
||||
/* Reentrant versions of some of the functions above. */
|
||||
/* Get the next entry from the alias data base and put it in RESULT_BUF. */
|
||||
extern int getaliasent_r __P ((struct aliasent *__result_buf, char *__buffer,
|
||||
size_t __buflen, struct aliasent **__result));
|
||||
|
||||
/* Get alias entry corresponding to NAME. */
|
||||
extern struct aliasent *getaliasbyname __P ((__const char *__name));
|
||||
|
||||
/* Get alias entry corresponding to NAME and put it in RESULT_BUF. */
|
||||
extern int getaliasbyname_r __P ((__const char *__name,
|
||||
struct aliasent *__result_buf,
|
||||
char *__buffer, size_t __buflen,
|
||||
struct aliasent **__result));
|
||||
#endif /* reentrant */
|
||||
|
||||
__END_DECLS
|
||||
|
||||
|
||||
@@ -40,6 +40,7 @@
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
#include <sys/types.h>
|
||||
#include <netinet/in.h> /* To define `struct in_addr'. */
|
||||
|
||||
__BEGIN_DECLS
|
||||
u_long inet_addr __P((const char *));
|
||||
|
||||
+29
-23
@@ -1,21 +1,21 @@
|
||||
/* Functions for storing Ethernet addresses in ASCII and mapping to hostnames.
|
||||
Copyright (C) 1996 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
Copyright (C) 1996, 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 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.
|
||||
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. */
|
||||
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. */
|
||||
|
||||
#ifndef __NETINET_ETHER_H
|
||||
|
||||
@@ -25,24 +25,30 @@ Boston, MA 02111-1307, USA. */
|
||||
/* Get definition of `struct ether_addr'. */
|
||||
#include <netinet/if_ether.h>
|
||||
|
||||
__BEGIN_DECLS
|
||||
|
||||
/* Convert 48 bit Ethernet ADDRess to ASCII. */
|
||||
char *ether_ntoa __P ((const struct ether_addr *__addr));
|
||||
char *ether_ntoa_r __P ((const struct ether_addr *__addr, char *__buf));
|
||||
extern char *ether_ntoa __P ((__const struct ether_addr *__addr));
|
||||
extern char *ether_ntoa_r __P ((__const struct ether_addr *__addr,
|
||||
char *__buf));
|
||||
|
||||
/* Convert ASCII string S to 48 bit Ethernet address. */
|
||||
struct ether_addr *ether_aton __P ((const char *__asc));
|
||||
struct ether_addr *ether_aton_r __P ((const char *__asc,
|
||||
struct ether_addr *__addr));
|
||||
extern struct ether_addr *ether_aton __P ((__const char *__asc));
|
||||
extern struct ether_addr *ether_aton_r __P ((__const char *__asc,
|
||||
struct ether_addr *__addr));
|
||||
|
||||
/* Map 48 bit Ethernet number ADDR to HOSTNAME. */
|
||||
int ether_ntohost __P ((char *__hostname, const struct ether_addr *__addr));
|
||||
extern int ether_ntohost __P ((char *__hostname,
|
||||
__const struct ether_addr *__addr));
|
||||
|
||||
/* Map HOSTNAME to 48 bit Ethernet address. */
|
||||
int ether_hostton __P ((const char *__hostname, struct ether_addr *__addr));
|
||||
extern int ether_hostton __P ((__const char *__hostname,
|
||||
struct ether_addr *__addr));
|
||||
|
||||
/* Scan LINE and set ADDR and HOSTNAME. */
|
||||
int ether_line __P ((const char *__line, struct ether_addr *__addr,
|
||||
char *__hostname));
|
||||
extern int ether_line __P ((__const char *__line, struct ether_addr *__addr,
|
||||
char *__hostname));
|
||||
|
||||
__END_DECLS
|
||||
|
||||
#endif /* netinet/ether.h */
|
||||
|
||||
@@ -33,6 +33,14 @@
|
||||
* @(#)tcp.h 8.1 (Berkeley) 6/10/93
|
||||
*/
|
||||
|
||||
#ifndef _NETINET_TCP_H
|
||||
|
||||
#define _NETINET_TCP_H 1
|
||||
#include <sys/cdefs.h>
|
||||
|
||||
|
||||
__BEGIN_DECLS
|
||||
|
||||
typedef unsigned int tcp_seq;
|
||||
/*
|
||||
* TCP header.
|
||||
@@ -96,3 +104,9 @@ struct tcphdr {
|
||||
*/
|
||||
#define TCP_NODELAY 0x01 /* don't delay send to coalesce packets */
|
||||
#define TCP_MAXSEG 0x02 /* set maximum segment size */
|
||||
|
||||
#define SOL_TCP 6 /* TCP level */
|
||||
|
||||
__END_DECLS
|
||||
|
||||
#endif /* netinet/tcp.h */
|
||||
|
||||
+11
-7
@@ -306,7 +306,6 @@ iruserok(raddr, superuser, ruser, luser)
|
||||
struct stat sbuf;
|
||||
struct passwd pwdbuf, *pwd;
|
||||
FILE *hostf;
|
||||
uid_t uid;
|
||||
int first;
|
||||
|
||||
first = 1;
|
||||
@@ -326,7 +325,7 @@ again:
|
||||
char *buffer = __alloca (buflen);
|
||||
|
||||
first = 0;
|
||||
if (getpwnam_r (luser, &pwdbuf, buffer, buflen, &pwd) < 0)
|
||||
if (__getpwnam_r (luser, &pwdbuf, buffer, buflen, &pwd) < 0)
|
||||
return -1;
|
||||
|
||||
dirlen = strlen (pwd->pw_dir);
|
||||
@@ -339,10 +338,15 @@ again:
|
||||
* reading an NFS mounted file system, can't read files that
|
||||
* are protected read/write owner only.
|
||||
*/
|
||||
uid = geteuid();
|
||||
(void)seteuid(pwd->pw_uid);
|
||||
hostf = fopen(pbuf, "r");
|
||||
(void)seteuid(uid);
|
||||
if (__euidaccess (pbuf, R_OK) != 0)
|
||||
hostf = NULL;
|
||||
else
|
||||
{
|
||||
uid_t uid = geteuid ();
|
||||
seteuid (pwd->pw_uid);
|
||||
hostf = fopen (pbuf, "r");
|
||||
seteuid (uid);
|
||||
}
|
||||
|
||||
if (hostf == NULL)
|
||||
return (-1);
|
||||
@@ -390,7 +394,7 @@ __ivaliduser(hostf, raddr, luser, ruser)
|
||||
size_t bufsize = 0;
|
||||
ssize_t nread;
|
||||
|
||||
while ((nread = getline (&buf, &bufsize, hostf)) > 0) {
|
||||
while ((nread = __getline (&buf, &bufsize, hostf)) > 0) {
|
||||
buf[bufsize - 1] = '\0'; /* Make sure it's terminated. */
|
||||
p = buf;
|
||||
while (*p != '\n' && *p != ' ' && *p != '\t' && *p != '\0') {
|
||||
|
||||
+8
-8
@@ -1,6 +1,4 @@
|
||||
# Makefile for intl subdirectory: message handling code from GNU gettext.
|
||||
|
||||
# Copyright (C) 1995, 1996 Free Software Foundation, Inc.
|
||||
# Copyright (C) 1995, 1996, 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
|
||||
@@ -14,9 +12,11 @@
|
||||
# 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., 675 Mass Ave,
|
||||
# Cambridge, MA 02139, USA.
|
||||
# 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.
|
||||
|
||||
# Makefile for intl subdirectory: message handling code from GNU gettext.
|
||||
|
||||
subdir = intl
|
||||
headers = libintl.h
|
||||
@@ -25,14 +25,14 @@ routines = bindtextdom dcgettext dgettext gettext \
|
||||
l10nflist explodename
|
||||
distribute = gettext.h gettextP.h hash-string.h loadinfo.h locale.alias
|
||||
|
||||
install-others = $(localedir)/locale.alias
|
||||
install-others = $(inst_localedir)/locale.alias
|
||||
|
||||
include ../Rules
|
||||
|
||||
CPPFLAGS += -D'GNULOCALEDIR="$(localedir)"' \
|
||||
-D'LOCALE_ALIAS_PATH="$(localedir):$(i18ndir)"'
|
||||
|
||||
$(localedir)/locale.alias: locale.alias
|
||||
$(inst_localedir)/locale.alias: locale.alias
|
||||
$(do-install)
|
||||
|
||||
ifdef gettext-srcdir
|
||||
|
||||
+17
-16
@@ -1,23 +1,23 @@
|
||||
/* Copyright (C) 1995, 1996 Free Software Foundation, Inc.
|
||||
Contributed by Ulrich Drepper <drepper@gnu.ai.mit.edu>, 1995.
|
||||
/* Copyright (C) 1995, 1996, 1997 Free Software Foundation, Inc.
|
||||
Contributed by Ulrich Drepper <drepper@gnu.ai.mit.edu>, 1995.
|
||||
|
||||
This file is part of the GNU C Library. Its master source is NOT part of
|
||||
the C library, however. The master source lives in /gd/gnu/lib.
|
||||
This file is part of the GNU C Library. Its master source is NOT part of
|
||||
the C library, however. The master source lives in /gd/gnu/lib.
|
||||
|
||||
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 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.
|
||||
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., 675 Mass Ave,
|
||||
Cambridge, MA 02139, USA. */
|
||||
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. */
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
# include <config.h>
|
||||
@@ -25,6 +25,7 @@ Cambridge, MA 02139, USA. */
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <sys/types.h>
|
||||
|
||||
#include "loadinfo.h"
|
||||
|
||||
|
||||
+4
-2
@@ -1,4 +1,4 @@
|
||||
/* Copyright (C) 1995, 1996 Free Software Foundation, Inc.
|
||||
/* Copyright (C) 1995, 1996, 1997 Free Software Foundation, Inc.
|
||||
Contributed by Ulrich Drepper <drepper@gnu.ai.mit.edu>, 1995.
|
||||
|
||||
This file is part of the GNU C Library. Its master source is NOT part of
|
||||
@@ -42,6 +42,7 @@
|
||||
# include <argz.h>
|
||||
#endif
|
||||
#include <ctype.h>
|
||||
#include <sys/types.h>
|
||||
|
||||
#if defined STDC_HEADERS || defined _LIBC
|
||||
# include <stdlib.h>
|
||||
@@ -205,7 +206,8 @@ _nl_make_l10nflist (l10nfile_list, dirlist, dirlist_len, mask, language,
|
||||
? strlen (modifier) + 1 : 0)
|
||||
+ ((mask & CEN_SPECIAL) != 0
|
||||
? strlen (special) + 1 : 0)
|
||||
+ ((mask & (CEN_SPONSOR | CEN_REVISION) != 0)
|
||||
+ (((mask & CEN_SPONSOR) != 0
|
||||
|| (mask & CEN_REVISION) != 0)
|
||||
? (1 + ((mask & CEN_SPONSOR) != 0
|
||||
? strlen (sponsor) + 1 : 0)
|
||||
+ ((mask & CEN_REVISION) != 0
|
||||
|
||||
@@ -26,6 +26,8 @@
|
||||
#define _FTW_H 1
|
||||
#include <features.h>
|
||||
|
||||
__BEGIN_DECLS
|
||||
|
||||
#include <statbuf.h>
|
||||
|
||||
/* The FLAG argument to the user function passed to ftw. */
|
||||
@@ -41,4 +43,6 @@ extern int ftw __P ((__const char *__dir,
|
||||
int __flag),
|
||||
int __descriptors));
|
||||
|
||||
__END_DECLS
|
||||
|
||||
#endif /* ftw.h */
|
||||
|
||||
+28
-15
@@ -1,25 +1,25 @@
|
||||
/* Support macros for making weak and strong aliases for symbols,
|
||||
and for using symbol sets and linker warnings with GNU ld.
|
||||
Copyright (C) 1995, 1996 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
Copyright (C) 1995, 1996, 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 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.
|
||||
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., 675 Mass Ave,
|
||||
Cambridge, MA 02139, USA. */
|
||||
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. */
|
||||
|
||||
#ifndef _LIBC_SYMBOLS_H
|
||||
#define _LIBC_SYMBOLS_H
|
||||
#define _LIBC_SYMBOLS_H 1
|
||||
|
||||
/* This file's macros are included implicitly in the compilation of every
|
||||
file in the C library by -imacros.
|
||||
@@ -224,7 +224,20 @@ extern const char _libc_intl_domainname[];
|
||||
warning message MSG. */
|
||||
#ifdef HAVE_GNU_LD
|
||||
#ifdef HAVE_ELF
|
||||
|
||||
/* We want the .gnu.warning.SYMBOL section to be unallocated. */
|
||||
#ifdef HAVE_ASM_PREVIOUS_DIRECTIVE
|
||||
#define __make_section_unallocated(section_string) \
|
||||
asm(".section " section_string "; .previous");
|
||||
#elif defined (HAVE_ASM_POPSECTION_DIRECTIVE)
|
||||
#define __make_section_unallocated(section_string) \
|
||||
asm(".pushsection " section_string "; .popsection");
|
||||
#else
|
||||
#define __make_section_unallocated(section_string)
|
||||
#endif
|
||||
|
||||
#define link_warning(symbol, msg) \
|
||||
__make_section_unallocated (".gnu.warning." #symbol) \
|
||||
static const char __evoke_link_warning_##symbol[] \
|
||||
__attribute__ ((section (".gnu.warning." #symbol))) = msg;
|
||||
#else
|
||||
|
||||
+2
-2
@@ -1,4 +1,4 @@
|
||||
# Copyright (C) 1995, 1996 Free Software Foundation, Inc.
|
||||
# Copyright (C) 1995, 1996, 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
|
||||
@@ -32,7 +32,7 @@ routines := \
|
||||
\
|
||||
clearerr feof ferror fgetc fileno fputc freopen fseek getc getchar \
|
||||
memstream pclose putc putchar rewind setbuf setlinebuf vasprintf \
|
||||
vdprintf vscanf vsnprintf obprintf fcloseall \
|
||||
iovdprintf vscanf vsnprintf obprintf fcloseall \
|
||||
\
|
||||
libc_fatal
|
||||
|
||||
|
||||
@@ -8,13 +8,23 @@
|
||||
|
||||
#include <gnu/types.h>
|
||||
#define __need_size_t
|
||||
#define __need_wint_t
|
||||
#include <stddef.h>
|
||||
#ifndef _WINT_T
|
||||
/* Integral type unchanged by default argument promotions that can
|
||||
hold any value corresponding to members of the extended character
|
||||
set, as well as at least one value that does not correspond to any
|
||||
member of the extended character set. */
|
||||
#define _WINT_T
|
||||
typedef unsigned int wint_t;
|
||||
#endif
|
||||
#define _G_size_t size_t
|
||||
#define _G_fpos_t __off_t
|
||||
#define _G_ssize_t __ssize_t
|
||||
#define _G_off_t __off_t
|
||||
#define _G_pid_t __pid_t
|
||||
#define _G_uid_t __uid_t
|
||||
#define _G_wint_t wint_t
|
||||
|
||||
typedef int _G_int16_t __attribute__ ((__mode__ (__HI__)));
|
||||
typedef int _G_int32_t __attribute__ ((__mode__ (__SI__)));
|
||||
|
||||
+3
-3
@@ -138,8 +138,8 @@ DEFUN(_IO_file_close_it, (fp),
|
||||
}
|
||||
|
||||
void
|
||||
DEFUN(_IO_file_finish, (fp),
|
||||
register _IO_FILE* fp)
|
||||
DEFUN(_IO_file_finish, (fp, dummy),
|
||||
register _IO_FILE* fp AND int dummy)
|
||||
{
|
||||
if (_IO_file_is_open(fp))
|
||||
{
|
||||
@@ -147,7 +147,7 @@ DEFUN(_IO_file_finish, (fp),
|
||||
if (!(fp->_flags & _IO_DELETE_DONT_CLOSE))
|
||||
_IO_SYSCLOSE (fp);
|
||||
}
|
||||
_IO_default_finish(fp);
|
||||
_IO_default_finish(fp, 0);
|
||||
}
|
||||
|
||||
_IO_FILE *
|
||||
|
||||
+2
-2
@@ -481,8 +481,8 @@ DEFUN(_IO_default_sync, (fp),
|
||||
current implementation, this function can get called twice! */
|
||||
|
||||
void
|
||||
DEFUN(_IO_default_finish, (fp),
|
||||
_IO_FILE *fp)
|
||||
DEFUN(_IO_default_finish, (fp, dummy),
|
||||
_IO_FILE *fp AND int dummy)
|
||||
{
|
||||
struct _IO_marker *mark;
|
||||
if (fp->_IO_buf_base && !(fp->_flags & _IO_USER_BUF))
|
||||
|
||||
+13
-10
@@ -149,15 +149,6 @@ the executable file might be covered by the GNU General Public License. */
|
||||
|
||||
struct _IO_jump_t; struct _IO_FILE;
|
||||
|
||||
/* Define the user-visible type, with user-friendly member names. */
|
||||
typedef struct
|
||||
{
|
||||
_IO_ssize_t (*read) __P ((struct _IO_FILE *, void *, _IO_ssize_t));
|
||||
_IO_ssize_t (*write) __P ((struct _IO_FILE *, const void *, _IO_ssize_t));
|
||||
_IO_fpos_t (*seek) __P ((struct _IO_FILE *, _IO_off_t, int));
|
||||
int (*close) __P ((struct _IO_FILE *));
|
||||
} _IO_cookie_io_functions_t;
|
||||
|
||||
/* Handle lock. */
|
||||
#ifdef _IO_MTSAFE_IO
|
||||
#include <stdio-lock.h>
|
||||
@@ -236,6 +227,15 @@ extern struct _IO_FILE_plus _IO_stdin_, _IO_stdout_, _IO_stderr_;
|
||||
#define _IO_stderr ((_IO_FILE*)(&_IO_stderr_))
|
||||
|
||||
|
||||
/* Define the user-visible type, with user-friendly member names. */
|
||||
typedef struct
|
||||
{
|
||||
_IO_ssize_t (*read) __P ((struct _IO_FILE *, void *, _IO_ssize_t));
|
||||
_IO_ssize_t (*write) __P ((struct _IO_FILE *, const void *, _IO_ssize_t));
|
||||
_IO_fpos_t (*seek) __P ((struct _IO_FILE *, _IO_off_t, int));
|
||||
int (*close) __P ((struct _IO_FILE *));
|
||||
} _IO_cookie_io_functions_t;
|
||||
|
||||
/* Special file type for fopencookie function. */
|
||||
struct _IO_cookie_file {
|
||||
struct _IO_FILE file;
|
||||
@@ -292,7 +292,10 @@ extern int _IO_ftrylockfile __P ((_IO_FILE *));
|
||||
# define _IO_cleanup_region_end(_Doit) /**/
|
||||
#endif /* !_IO_MTSAFE_IO */
|
||||
|
||||
#ifdef __USE_REENTRANT
|
||||
/* XXX Should we allow a symbol to be defined which selects the efficient
|
||||
implementation when the user is really sure no threaded functions ever
|
||||
will be used? */
|
||||
#if 1
|
||||
# define _IO_getc(_fp) _IO_getc (_fp)
|
||||
# define _IO_peekc(_fp) _IO_peekc_locked (_fp)
|
||||
# define _IO_putc(_ch, _fp) _IO_putc (_ch, _fp)
|
||||
|
||||
+5
-5
@@ -101,8 +101,8 @@ extern "C" {
|
||||
/* The 'finish' function does any final cleaning up of an _IO_FILE object.
|
||||
It does not delete (free) it, but does everything else to finalize it/
|
||||
It matches the streambuf::~streambuf virtual destructor. */
|
||||
typedef void (*_IO_finish_t) __P((_IO_FILE*)); /* finalize */
|
||||
#define _IO_FINISH(FP) JUMP0(__finish, FP)
|
||||
typedef void (*_IO_finish_t) __P((_IO_FILE*, int)); /* finalize */
|
||||
#define _IO_FINISH(FP) JUMP1(__finish, FP, 0)
|
||||
|
||||
/* The 'overflow' hook flushes the buffer.
|
||||
The second argument is a character, or EOF.
|
||||
@@ -295,7 +295,7 @@ extern int _IO_seekmark __P((_IO_FILE *, struct _IO_marker *, int));
|
||||
extern int _IO_default_underflow __P((_IO_FILE*));
|
||||
extern int _IO_default_uflow __P((_IO_FILE*));
|
||||
extern int _IO_default_doallocate __P((_IO_FILE*));
|
||||
extern void _IO_default_finish __P((_IO_FILE *));
|
||||
extern void _IO_default_finish __P((_IO_FILE *, int));
|
||||
extern int _IO_default_pbackfail __P((_IO_FILE*, int));
|
||||
extern _IO_FILE* _IO_default_setbuf __P((_IO_FILE *, char*, _IO_ssize_t));
|
||||
extern _IO_size_t _IO_default_xsputn __P((_IO_FILE *, const void*, _IO_size_t));
|
||||
@@ -352,7 +352,7 @@ extern _IO_ssize_t _IO_file_read __P((_IO_FILE*, void*, _IO_ssize_t));
|
||||
extern int _IO_file_sync __P((_IO_FILE*));
|
||||
extern int _IO_file_close_it __P((_IO_FILE*));
|
||||
extern _IO_fpos_t _IO_file_seek __P((_IO_FILE *, _IO_off_t, int));
|
||||
extern void _IO_file_finish __P((_IO_FILE*));
|
||||
extern void _IO_file_finish __P((_IO_FILE*, int));
|
||||
|
||||
/* Other file functions. */
|
||||
extern _IO_FILE* _IO_file_attach __P((_IO_FILE *, int));
|
||||
@@ -366,7 +366,7 @@ extern int _IO_str_underflow __P((_IO_FILE*));
|
||||
extern int _IO_str_overflow __P((_IO_FILE *, int));
|
||||
extern int _IO_str_pbackfail __P((_IO_FILE*, int));
|
||||
extern _IO_fpos_t _IO_str_seekoff __P((_IO_FILE*,_IO_off_t,int,int));
|
||||
extern void _IO_str_finish __P ((_IO_FILE*));
|
||||
extern void _IO_str_finish __P ((_IO_FILE*, int));
|
||||
|
||||
/* Other strfile functions */
|
||||
extern void _IO_str_init_static __P((_IO_FILE *, char*, int, char*));
|
||||
|
||||
+18
-17
@@ -1,20 +1,20 @@
|
||||
/* Copyright (C) 1995, 1996 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
/* Copyright (C) 1995, 1996, 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 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.
|
||||
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. */
|
||||
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 "libioP.h"
|
||||
#include "strfile.h"
|
||||
@@ -31,7 +31,7 @@ struct _IO_FILE_memstream
|
||||
|
||||
|
||||
static int _IO_mem_sync __P ((_IO_FILE* fp));
|
||||
static void _IO_mem_finish __P ((_IO_FILE* fp));
|
||||
static void _IO_mem_finish __P ((_IO_FILE* fp, int));
|
||||
|
||||
|
||||
static const struct _IO_jump_t _IO_mem_jumps =
|
||||
@@ -124,8 +124,9 @@ _IO_mem_sync (fp)
|
||||
|
||||
|
||||
static void
|
||||
_IO_mem_finish (fp)
|
||||
_IO_mem_finish (fp, dummy)
|
||||
_IO_FILE* fp;
|
||||
int dummy;
|
||||
{
|
||||
struct _IO_FILE_memstream *mp = (struct _IO_FILE_memstream *) fp;
|
||||
|
||||
@@ -139,5 +140,5 @@ _IO_mem_finish (fp)
|
||||
|
||||
fp->_IO_buf_base = NULL;
|
||||
|
||||
_IO_default_finish (fp);
|
||||
_IO_default_finish (fp, 0);
|
||||
}
|
||||
|
||||
+23
-15
@@ -1,6 +1,6 @@
|
||||
/* This is part of the iostream/stdio library, providing -*- C -*- I/O.
|
||||
Define ANSI C stdio on top of C++ iostreams.
|
||||
Copyright (C) 1991, 1994, 1995, 1996 Free Software Foundation, Inc.
|
||||
Copyright (C) 1991, 1994, 1995, 1996, 1997 Free Software Foundation, Inc.
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Library General Public
|
||||
@@ -138,7 +138,7 @@ extern int sprintf __P ((char*, __const char* format, ...));
|
||||
extern int sscanf __P ((__const char* string, __const char* format, ...));
|
||||
extern FILE* tmpfile __P ((void));
|
||||
extern char* tmpnam __P ((char*));
|
||||
#ifdef __USE_REENTRANT
|
||||
#ifdef __USE_MISC
|
||||
extern char* tmpnam_r __P ((char*));
|
||||
#endif
|
||||
#if defined(__USE_SVID) || defined(__USE_XOPEN)
|
||||
@@ -224,7 +224,7 @@ extern const char *const _sys_errlist[];
|
||||
#endif
|
||||
|
||||
/* Handle locking of streams. */
|
||||
#ifdef __USE_REENTRANT
|
||||
#ifdef __USE_MISC
|
||||
extern void clearerr_locked __P ((FILE *));
|
||||
extern void clearerr_unlocked __P ((FILE *));
|
||||
extern int feof_locked __P ((FILE *));
|
||||
@@ -233,9 +233,6 @@ extern int ferror_locked __P ((FILE*));
|
||||
extern int ferror_unlocked __P ((FILE*));
|
||||
extern int fileno_locked __P ((FILE *));
|
||||
extern int fileno_unlocked __P ((FILE *));
|
||||
extern void flockfile __P ((FILE *));
|
||||
extern void funlockfile __P ((FILE *));
|
||||
extern int ftrylockfile __P ((FILE *));
|
||||
extern int fclose_unlocked __P ((FILE *));
|
||||
extern int fflush_locked __P ((FILE *));
|
||||
extern int fflush_unlocked __P ((FILE *));
|
||||
@@ -245,24 +242,35 @@ extern size_t fwrite_unlocked __P ((const void *, size_t, size_t, FILE *));
|
||||
extern int fputc_locked __P ((int, FILE*));
|
||||
extern int fputc_unlocked __P ((int, FILE*));
|
||||
extern int getc_locked __P ((FILE *));
|
||||
extern int getc_unlocked __P ((FILE *));
|
||||
extern int getchar_locked __P ((void));
|
||||
extern int getchar_unlocked __P ((void));
|
||||
extern int putc_locked __P ((int, FILE *));
|
||||
extern int putc_unlocked __P ((int, FILE *));
|
||||
extern int putchar_locked __P ((int));
|
||||
|
||||
# ifndef _LIBC
|
||||
# define getc_locked(fp) _IO_getc (fp)
|
||||
# define getchar_locked() _IO_getc (stdin)
|
||||
# define putchar_locked(c) _IO_putc (c, stdout)
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#if defined __USE_POSIX || defined __USE_MISC
|
||||
/* These are defined in POSIX.1:1996. */
|
||||
extern void flockfile __P ((FILE *));
|
||||
extern void funlockfile __P ((FILE *));
|
||||
extern int ftrylockfile __P ((FILE *));
|
||||
|
||||
extern int getc_unlocked __P ((FILE *));
|
||||
extern int getchar_unlocked __P ((void));
|
||||
extern int putc_unlocked __P ((int, FILE *));
|
||||
extern int putchar_unlocked __P ((int));
|
||||
|
||||
# ifndef _LIBC
|
||||
# define getc_unlocked(fp) _IO_getc_unlocked (fp)
|
||||
# define getc_locked(fp) _IO_getc (fp)
|
||||
# define getchar_unlocked() _IO_getc_unlocked (stdin)
|
||||
# define getchar_locked() _IO_getc (stdin)
|
||||
# define putchar_unlocked(c) _IO_putc_unlocked (c, stdout)
|
||||
# define putchar_locked(c) _IO_putc (c, stdout)
|
||||
# define putc_unlocked(c, fp) _IO_putc_unlocked ((c), (fp))
|
||||
# define putchar_unlocked(c) _IO_putc_unlocked ((c), stdout)
|
||||
# endif
|
||||
|
||||
#endif /* __USE_REENTRANT */
|
||||
#endif /* POSIX || misc */
|
||||
|
||||
#define getc(_fp) _IO_getc (_fp)
|
||||
#define putc(_ch, _fp) _IO_putc (_ch, _fp)
|
||||
|
||||
+3
-3
@@ -258,14 +258,14 @@ DEFUN(_IO_str_pbackfail, (fp, c),
|
||||
}
|
||||
|
||||
void
|
||||
DEFUN (_IO_str_finish, (fp),
|
||||
register _IO_FILE* fp)
|
||||
DEFUN (_IO_str_finish, (fp, dummy),
|
||||
register _IO_FILE* fp AND int dummy)
|
||||
{
|
||||
if (fp->_IO_buf_base && !(fp->_flags & _IO_USER_BUF))
|
||||
(((_IO_strfile*)fp)->_s._free_buffer)(fp->_IO_buf_base);
|
||||
fp->_IO_buf_base = NULL;
|
||||
|
||||
_IO_default_finish(fp);
|
||||
_IO_default_finish(fp, 0);
|
||||
}
|
||||
|
||||
struct _IO_jump_t _IO_str_jumps = {
|
||||
|
||||
@@ -38,6 +38,11 @@ _IO_vsnprintf (string, maxlen, format, args)
|
||||
_IO_lock_t lock;
|
||||
sf._sbf._f._lock = &lock;
|
||||
#endif
|
||||
|
||||
/* We need to handle the special case where MAXLEN is 0. */
|
||||
if (maxlen == 0)
|
||||
return 0;
|
||||
|
||||
_IO_init ((_IO_FILE *) &sf, 0);
|
||||
_IO_JUMPS ((_IO_FILE *) &sf) = &_IO_str_jumps;
|
||||
_IO_str_init_static ((_IO_FILE *) &sf, string, maxlen - 1, string);
|
||||
|
||||
+24
-23
@@ -1,21 +1,21 @@
|
||||
/* Copyright (C) 1995, 1996 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
Contributed by Ulrich Drepper <drepper@gnu.ai.mit.edu>, 1995.
|
||||
/* Copyright (C) 1995, 1996, 1997 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
Contributed by Ulrich Drepper <drepper@gnu.ai.mit.edu>, 1995.
|
||||
|
||||
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 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.
|
||||
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. */
|
||||
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 "localeinfo.h"
|
||||
|
||||
@@ -26,7 +26,7 @@ const struct locale_data _nl_C_LC_TIME =
|
||||
{
|
||||
_nl_C_name,
|
||||
NULL, 0, /* no file mapped */
|
||||
53,
|
||||
54,
|
||||
{
|
||||
{ string: "Sun" },
|
||||
{ string: "Mon" },
|
||||
@@ -73,13 +73,14 @@ const struct locale_data _nl_C_LC_TIME =
|
||||
{ string: "%H:%M:%S" },
|
||||
{ string: "%I:%M:%S %p" },
|
||||
{ string: NULL },
|
||||
{ string: NULL },
|
||||
{ string: NULL },
|
||||
{ string: NULL },
|
||||
{ string: NULL },
|
||||
{ string: NULL },
|
||||
{ string: "" },
|
||||
{ string: "" },
|
||||
{ string: "" },
|
||||
{ string: "" },
|
||||
{ string: "" },
|
||||
{ word: 0 },
|
||||
{ string: NULL },
|
||||
{ string: NULL },
|
||||
{ word: 0 },
|
||||
{ string: "" },
|
||||
{ string: "" },
|
||||
}
|
||||
};
|
||||
|
||||
+14
-14
@@ -1,21 +1,21 @@
|
||||
/* localeinfo.h -- declarations for internal libc locale interfaces
|
||||
Copyright (C) 1995, 1996 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
Copyright (C) 1995, 1996, 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 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.
|
||||
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., 675 Mass Ave,
|
||||
Cambridge, MA 02139, USA. */
|
||||
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. */
|
||||
|
||||
#ifndef _LOCALEINFO_H
|
||||
#define _LOCALEINFO_H 1
|
||||
|
||||
@@ -72,7 +72,7 @@ charmap_read (const char *filename)
|
||||
|
||||
result = parse_charmap (pathnfile);
|
||||
|
||||
if (result == NULL)
|
||||
if (result == NULL && !be_quiet)
|
||||
error (0, errno, _("character map file `%s' not found"), filename);
|
||||
}
|
||||
|
||||
@@ -171,7 +171,7 @@ parse_charmap (const char *filename)
|
||||
result->mb_cur_max = 1;
|
||||
if (result->mb_cur_min == 0)
|
||||
result->mb_cur_min = result->mb_cur_max;
|
||||
if (result->mb_cur_min > result->mb_cur_max)
|
||||
if (result->mb_cur_min > result->mb_cur_max && !be_quiet)
|
||||
{
|
||||
error (0, 0, _("\
|
||||
%s: <mb_cur_max> must be greater than <mb_cur_min>\n"),
|
||||
@@ -596,7 +596,7 @@ only WIDTH definitions are allowed to follow the CHARMAP definition"));
|
||||
break;
|
||||
}
|
||||
|
||||
if (state != 91)
|
||||
if (state != 91 && !be_quiet)
|
||||
error (0, 0, _("%s: premature end of file"), cmfile->fname);
|
||||
|
||||
lr_close (cmfile);
|
||||
|
||||
@@ -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.
|
||||
Contributed by Ulrich Drepper, <drepper@gnu.ai.mit.edu>.
|
||||
|
||||
@@ -56,6 +56,9 @@ struct charset_t
|
||||
#define ILLEGAL_CHAR_VALUE ((wchar_t) 0xffffffffu)
|
||||
|
||||
|
||||
/* Declared in localedef.c. */
|
||||
extern int be_quiet;
|
||||
|
||||
/* Prototypes for charmap handling functions. */
|
||||
struct charset_t *charmap_read (const char *filename);
|
||||
|
||||
|
||||
@@ -239,7 +239,7 @@ collate_finish (struct localedef_t *locale, struct charset_t *charset)
|
||||
else
|
||||
value = 0;
|
||||
|
||||
if (value == 0)
|
||||
if (value == 0 && !be_quiet)
|
||||
error_at_line (0, 0, patch->fname, patch->lineno,
|
||||
_("no weight defined for symbol `%s'"), patch->token);
|
||||
else
|
||||
@@ -256,7 +256,8 @@ collate_finish (struct localedef_t *locale, struct charset_t *charset)
|
||||
\**************************************************************/
|
||||
u_int32_t weight;
|
||||
|
||||
error (0, 0, _("no definition of `UNDEFINED'"));
|
||||
if (!be_quiet)
|
||||
error (0, 0, _("no definition of `UNDEFINED'"));
|
||||
|
||||
collate->undefined.ordering_len = collate->nrules;
|
||||
weight = ++collate->order_cnt;
|
||||
@@ -324,9 +325,10 @@ collate_output (struct localedef_t *locale, struct charset_t *charset,
|
||||
level_best = 0xffff;
|
||||
|
||||
/* Compute table size. */
|
||||
fputs (_("\
|
||||
if (!be_quiet)
|
||||
fputs (_("\
|
||||
Computing table size for collation information might take a while..."),
|
||||
stderr);
|
||||
stderr);
|
||||
for (table_size = 256; table_size < sum_best; ++table_size)
|
||||
{
|
||||
size_t hits[table_size];
|
||||
@@ -357,7 +359,8 @@ Computing table size for collation information might take a while..."),
|
||||
}
|
||||
}
|
||||
assert (table_best != 0xffff || level_best != 0xffff);
|
||||
fputs (_(" done\n"), stderr);
|
||||
if (!be_quiet)
|
||||
fputs (_(" done\n"), stderr);
|
||||
|
||||
obstack_init (&non_simple);
|
||||
obstack_init (&string_pool);
|
||||
|
||||
+43
-36
@@ -1,4 +1,4 @@
|
||||
/* Copyright (C) 1995, 1996 Free Software Foundation, Inc.
|
||||
/* Copyright (C) 1995, 1996, 1997 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
Contributed by Ulrich Drepper, <drepper@gnu.ai.mit.edu>.
|
||||
|
||||
@@ -262,10 +262,11 @@ ctype_finish (struct localedef_t *locale, struct charset_t *charset)
|
||||
cp += sprintf (cp, "\\%o", (value >> 8) & 0xff);
|
||||
sprintf (cp, "\\%o", value & 0xff);
|
||||
|
||||
error (0, 0, _("\
|
||||
if (!be_quiet)
|
||||
error (0, 0, _("\
|
||||
character %s'%s' in class `%s' must be in class `%s'"), value > 256 ? "L" : "",
|
||||
cp, valid_table[cls1].name,
|
||||
valid_table[cls2].name);
|
||||
cp, valid_table[cls1].name,
|
||||
valid_table[cls2].name);
|
||||
}
|
||||
break;
|
||||
|
||||
@@ -286,10 +287,12 @@ character %s'%s' in class `%s' must be in class `%s'"), value > 256 ? "L" : "",
|
||||
cp += sprintf (cp, "\\%o", (value >> 8) & 0xff);
|
||||
sprintf (cp, "\\%o", value & 0xff);
|
||||
|
||||
error (0, 0, _("\
|
||||
if (!be_quiet)
|
||||
error (0, 0, _("\
|
||||
character %s'%s' in class `%s' must not be in class `%s'"),
|
||||
value > 256 ? "L" : "", cp,
|
||||
valid_table[cls1].name, valid_table[cls2].name);
|
||||
value > 256 ? "L" : "", cp,
|
||||
valid_table[cls1].name,
|
||||
valid_table[cls2].name);
|
||||
}
|
||||
break;
|
||||
|
||||
@@ -306,23 +309,25 @@ character %s'%s' in class `%s' must not be in class `%s'"),
|
||||
|
||||
/* ... and now test <SP> as a special case. */
|
||||
space_value = charset_find_value (charset, "SP", 2);
|
||||
if ((wchar_t) space_value == ILLEGAL_CHAR_VALUE)
|
||||
if ((wchar_t) space_value == ILLEGAL_CHAR_VALUE && !be_quiet)
|
||||
error (0, 0, _("character <SP> not defined in character map"));
|
||||
else if ((cnt = BITPOS (tok_space),
|
||||
(ELEM (ctype, class_collection, , space_value)
|
||||
& BIT (tok_space)) == 0)
|
||||
|| (cnt = BITPOS (tok_blank),
|
||||
(ELEM (ctype, class_collection, , space_value)
|
||||
& BIT (tok_blank)) == 0))
|
||||
else if (((cnt = BITPOS (tok_space),
|
||||
(ELEM (ctype, class_collection, , space_value)
|
||||
& BIT (tok_space)) == 0)
|
||||
|| (cnt = BITPOS (tok_blank),
|
||||
(ELEM (ctype, class_collection, , space_value)
|
||||
& BIT (tok_blank)) == 0))
|
||||
&& !be_quiet)
|
||||
error (0, 0, _("<SP> character not in class `%s'"),
|
||||
valid_table[cnt].name);
|
||||
else if ((cnt = BITPOS (tok_punct),
|
||||
(ELEM (ctype, class_collection, , space_value)
|
||||
& BIT (tok_punct)) != 0)
|
||||
|| (cnt = BITPOS (tok_graph),
|
||||
(ELEM (ctype, class_collection, , space_value)
|
||||
& BIT (tok_graph))
|
||||
!= 0))
|
||||
else if (((cnt = BITPOS (tok_punct),
|
||||
(ELEM (ctype, class_collection, , space_value)
|
||||
& BIT (tok_punct)) != 0)
|
||||
|| (cnt = BITPOS (tok_graph),
|
||||
(ELEM (ctype, class_collection, , space_value)
|
||||
& BIT (tok_graph))
|
||||
!= 0))
|
||||
&& !be_quiet)
|
||||
error (0, 0, _("<SP> character must not be in class `%s'"),
|
||||
valid_table[cnt].name);
|
||||
else
|
||||
@@ -934,7 +939,7 @@ set_class_defaults (struct locale_ctype_t *ctype, struct charset_t *charset)
|
||||
tmp[0] = ch;
|
||||
|
||||
value = charset_find_value (charset, tmp, 1);
|
||||
if ((wchar_t) value == ILLEGAL_CHAR_VALUE)
|
||||
if ((wchar_t) value == ILLEGAL_CHAR_VALUE && !be_quiet)
|
||||
{
|
||||
error (0, 0, _("\
|
||||
character `%s' not defined while needed as default value"),
|
||||
@@ -998,7 +1003,7 @@ character `%s' not defined while needed as default value"),
|
||||
unsigned int value;
|
||||
|
||||
value = charset_find_value (charset, "space", 5);
|
||||
if ((wchar_t) value == ILLEGAL_CHAR_VALUE)
|
||||
if ((wchar_t) value == ILLEGAL_CHAR_VALUE && !be_quiet)
|
||||
error (0, 0, _("\
|
||||
character `%s' not defined while needed as default value"),
|
||||
"<space>");
|
||||
@@ -1006,7 +1011,7 @@ character `%s' not defined while needed as default value"),
|
||||
ELEM (ctype, class_collection, , value) |= BIT (tok_space);
|
||||
|
||||
value = charset_find_value (charset, "form-feed", 9);
|
||||
if ((wchar_t) value == ILLEGAL_CHAR_VALUE)
|
||||
if ((wchar_t) value == ILLEGAL_CHAR_VALUE && !be_quiet)
|
||||
error (0, 0, _("\
|
||||
character `%s' not defined while needed as default value"),
|
||||
"<form-feed>");
|
||||
@@ -1014,7 +1019,7 @@ character `%s' not defined while needed as default value"),
|
||||
ELEM (ctype, class_collection, , value) |= BIT (tok_space);
|
||||
|
||||
value = charset_find_value (charset, "newline", 7);
|
||||
if ((wchar_t) value == ILLEGAL_CHAR_VALUE)
|
||||
if ((wchar_t) value == ILLEGAL_CHAR_VALUE && !be_quiet)
|
||||
error (0, 0, _("\
|
||||
character `%s' not defined while needed as default value"),
|
||||
"<newline>");
|
||||
@@ -1022,7 +1027,7 @@ character `%s' not defined while needed as default value"),
|
||||
ELEM (ctype, class_collection, , value) |= BIT (tok_space);
|
||||
|
||||
value = charset_find_value (charset, "carriage-return", 15);
|
||||
if ((wchar_t) value == ILLEGAL_CHAR_VALUE)
|
||||
if ((wchar_t) value == ILLEGAL_CHAR_VALUE && !be_quiet)
|
||||
error (0, 0, _("\
|
||||
character `%s' not defined while needed as default value"),
|
||||
"<carriage-return>");
|
||||
@@ -1030,7 +1035,7 @@ character `%s' not defined while needed as default value"),
|
||||
ELEM (ctype, class_collection, , value) |= BIT (tok_space);
|
||||
|
||||
value = charset_find_value (charset, "tab", 3);
|
||||
if ((wchar_t) value == ILLEGAL_CHAR_VALUE)
|
||||
if ((wchar_t) value == ILLEGAL_CHAR_VALUE && !be_quiet)
|
||||
error (0, 0, _("\
|
||||
character `%s' not defined while needed as default value"),
|
||||
"<tab>");
|
||||
@@ -1038,7 +1043,7 @@ character `%s' not defined while needed as default value"),
|
||||
ELEM (ctype, class_collection, , value) |= BIT (tok_space);
|
||||
|
||||
value = charset_find_value (charset, "vertical-tab", 12);
|
||||
if ((wchar_t) value == ILLEGAL_CHAR_VALUE)
|
||||
if ((wchar_t) value == ILLEGAL_CHAR_VALUE && !be_quiet)
|
||||
error (0, 0, _("\
|
||||
character `%s' not defined while needed as default value"),
|
||||
"<vertical-tab>");
|
||||
@@ -1064,7 +1069,7 @@ character `%s' not defined while needed as default value"),
|
||||
unsigned int value;
|
||||
|
||||
value = charset_find_value (charset, "space", 5);
|
||||
if ((wchar_t) value == ILLEGAL_CHAR_VALUE)
|
||||
if ((wchar_t) value == ILLEGAL_CHAR_VALUE && !be_quiet)
|
||||
error (0, 0, _("\
|
||||
character `%s' not defined while needed as default value"),
|
||||
"<space>");
|
||||
@@ -1072,7 +1077,7 @@ character `%s' not defined while needed as default value"),
|
||||
ELEM (ctype, class_collection, , value) |= BIT (tok_blank);
|
||||
|
||||
value = charset_find_value (charset, "tab", 3);
|
||||
if ((wchar_t) value == ILLEGAL_CHAR_VALUE)
|
||||
if ((wchar_t) value == ILLEGAL_CHAR_VALUE && !be_quiet)
|
||||
error (0, 0, _("\
|
||||
character `%s' not defined while needed as default value"),
|
||||
"<tab>");
|
||||
@@ -1110,7 +1115,7 @@ character `%s' not defined while needed as default value"),
|
||||
ctype->class_collection[cnt] |= BIT (tok_print);
|
||||
|
||||
space = charset_find_value (charset, "space", 5);
|
||||
if (space == ILLEGAL_CHAR_VALUE)
|
||||
if (space == ILLEGAL_CHAR_VALUE && !be_quiet)
|
||||
error (0, 0, _("\
|
||||
character `%s' not defined while needed as default value"),
|
||||
"<space>");
|
||||
@@ -1136,7 +1141,7 @@ character `%s' not defined while needed as default value"),
|
||||
tmp[1] = (char) ch;
|
||||
|
||||
value_from = charset_find_value (charset, &tmp[1], 1);
|
||||
if ((wchar_t) value_from == ILLEGAL_CHAR_VALUE)
|
||||
if ((wchar_t) value_from == ILLEGAL_CHAR_VALUE && !be_quiet)
|
||||
{
|
||||
error (0, 0, _("\
|
||||
character `%s' not defined while needed as default value"),
|
||||
@@ -1147,7 +1152,7 @@ character `%s' not defined while needed as default value"),
|
||||
/* This conversion is implementation defined. */
|
||||
tmp[1] = (char) (ch + ('A' - 'a'));
|
||||
value_to = charset_find_value (charset, &tmp[1], 1);
|
||||
if ((wchar_t) value_to == ILLEGAL_CHAR_VALUE)
|
||||
if ((wchar_t) value_to == ILLEGAL_CHAR_VALUE && !be_quiet)
|
||||
{
|
||||
error (0, 0, _("\
|
||||
character `%s' not defined while needed as default value"),
|
||||
@@ -1195,9 +1200,10 @@ allocate_arrays (struct locale_ctype_t *ctype, struct charset_t *charset)
|
||||
size_t min_total = UINT_MAX;
|
||||
size_t act_size = 256;
|
||||
|
||||
fputs (_("\
|
||||
if (!be_quiet)
|
||||
fputs (_("\
|
||||
Computing table size for character classes might take a while..."),
|
||||
stderr);
|
||||
stderr);
|
||||
|
||||
while (act_size < min_total)
|
||||
{
|
||||
@@ -1232,7 +1238,8 @@ Computing table size for character classes might take a while..."),
|
||||
++act_size;
|
||||
}
|
||||
|
||||
fprintf (stderr, _(" done\n"));
|
||||
if (!be_quiet)
|
||||
fprintf (stderr, _(" done\n"));
|
||||
|
||||
|
||||
#if __BYTE_ORDER == __LITTLE_ENDIAN
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/* Copyright (C) 1995, 1996 Free Software Foundation, Inc.
|
||||
/* Copyright (C) 1995, 1996, 1997 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
Contributed by Ulrich Drepper, <drepper@gnu.ai.mit.edu>.
|
||||
|
||||
@@ -77,7 +77,7 @@ messages_finish (struct localedef_t *locale)
|
||||
= locale->categories[LC_MESSAGES].messages;
|
||||
|
||||
/* The fields YESSTR and NOSTR are optional. */
|
||||
if (messages->yesexpr == NULL)
|
||||
if (messages->yesexpr == NULL && !be_quiet)
|
||||
error (0, 0, _("field `%s' in category `%s' undefined"),
|
||||
"yesexpr", "LC_MESSAGES");
|
||||
else
|
||||
@@ -87,7 +87,7 @@ messages_finish (struct localedef_t *locale)
|
||||
|
||||
/* Test whether it are correct regular expressions. */
|
||||
result = regcomp (&re, messages->yesexpr, REG_EXTENDED);
|
||||
if (result != 0)
|
||||
if (result != 0 && !be_quiet)
|
||||
{
|
||||
char errbuf[BUFSIZ];
|
||||
|
||||
@@ -98,7 +98,7 @@ no correct regular expression for field `%s' in category `%s': %s"),
|
||||
}
|
||||
}
|
||||
|
||||
if (messages->noexpr == NULL)
|
||||
if (messages->noexpr == NULL && !be_quiet)
|
||||
error (0, 0, _("field `%s' in category `%s' undefined"),
|
||||
"noexpr", "LC_MESSAGES");
|
||||
else
|
||||
@@ -108,7 +108,7 @@ no correct regular expression for field `%s' in category `%s': %s"),
|
||||
|
||||
/* Test whether it are correct regular expressions. */
|
||||
result = regcomp (&re, messages->noexpr, REG_EXTENDED);
|
||||
if (result != 0)
|
||||
if (result != 0 && !be_quiet)
|
||||
{
|
||||
char errbuf[BUFSIZ];
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/* Copyright (C) 1995, 1996 Free Software Foundation, Inc.
|
||||
/* Copyright (C) 1995, 1996, 1997 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
Contributed by Ulrich Drepper, <drepper@gnu.ai.mit.edu>.
|
||||
|
||||
@@ -115,7 +115,7 @@ monetary_finish (struct localedef_t *locale)
|
||||
= locale->categories[LC_MONETARY].monetary;
|
||||
|
||||
#define TEST_ELEM(cat) \
|
||||
if (monetary->cat == NULL) \
|
||||
if (monetary->cat == NULL && !be_quiet) \
|
||||
error (0, 0, _("field `%s' in category `%s' not defined"), \
|
||||
#cat, "LC_MONETARY")
|
||||
|
||||
@@ -129,12 +129,13 @@ monetary_finish (struct localedef_t *locale)
|
||||
/* The international currency symbol must come from ISO 4217. */
|
||||
if (monetary->int_curr_symbol != NULL)
|
||||
{
|
||||
if (strlen (monetary->int_curr_symbol) != 4)
|
||||
if (strlen (monetary->int_curr_symbol) != 4 && !be_quiet)
|
||||
error (0, 0, _("\
|
||||
value of field `int_curr_symbol' in category `LC_MONETARY' has wrong length"));
|
||||
else if (bsearch (monetary->int_curr_symbol, valid_int_curr,
|
||||
NR_VALID_INT_CURR, sizeof (const char *),
|
||||
(comparison_fn_t) curr_strcmp) == NULL)
|
||||
(comparison_fn_t) curr_strcmp) == NULL
|
||||
&& !be_quiet)
|
||||
error (0, 0, _("\
|
||||
value of field `int_curr_symbol' in category `LC_MONETARY' does \
|
||||
not correspond to a valid name in ISO 4217"));
|
||||
@@ -143,23 +144,23 @@ not correspond to a valid name in ISO 4217"));
|
||||
/* The decimal point must not be empty. This is not said explicitly
|
||||
in POSIX but ANSI C (ISO/IEC 9899) says in 4.4.2.1 it has to be
|
||||
!= "". */
|
||||
if (monetary->mon_decimal_point[0] == '\0')
|
||||
if (monetary->mon_decimal_point[0] == '\0' && !be_quiet)
|
||||
{
|
||||
error (0, 0, _("\
|
||||
value for field `%s' in category `%s' must not be the empty string"),
|
||||
"mon_decimal_point", "LC_MONETARY");
|
||||
}
|
||||
|
||||
if (monetary->mon_grouping_act == 0)
|
||||
if (monetary->mon_grouping_act == 0 && !be_quiet)
|
||||
error (0, 0, _("field `%s' in category `%s' not defined"),
|
||||
"mon_grouping", "LC_MONETARY");
|
||||
|
||||
#undef TEST_ELEM
|
||||
#define TEST_ELEM(cat, min, max) \
|
||||
if (monetary->cat == -2) \
|
||||
if (monetary->cat == -2 && !be_quiet) \
|
||||
error (0, 0, _("field `%s' in category `%s' not defined"), \
|
||||
#cat, "LC_MONETARY"); \
|
||||
else if (monetary->cat < min || monetary->cat > max) \
|
||||
else if ((monetary->cat < min || monetary->cat > max) && !be_quiet) \
|
||||
error (0, 0, _("\
|
||||
value for field `%s' in category `%s' must be in range %d...%d"), \
|
||||
#cat, "LC_MONETARY", min, max)
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/* Copyright (C) 1995, 1996 Free Software Foundation, Inc.
|
||||
/* Copyright (C) 1995, 1996, 1997 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
Contributed by Ulrich Drepper, <drepper@gnu.ai.mit.edu>.
|
||||
|
||||
@@ -74,7 +74,7 @@ numeric_finish (struct localedef_t *locale)
|
||||
struct locale_numeric_t *numeric = locale->categories[LC_NUMERIC].numeric;
|
||||
|
||||
#define TEST_ELEM(cat) \
|
||||
if (numeric->cat == NULL) \
|
||||
if (numeric->cat == NULL && !be_quiet) \
|
||||
error (0, 0, _("field `%s' in category `%s' not defined"), \
|
||||
#cat, "LC_NUMERIC")
|
||||
|
||||
@@ -84,14 +84,14 @@ numeric_finish (struct localedef_t *locale)
|
||||
/* The decimal point must not be empty. This is not said explicitly
|
||||
in POSIX but ANSI C (ISO/IEC 9899) says in 4.4.2.1 it has to be
|
||||
!= "". */
|
||||
if (numeric->decimal_point[0] == '\0')
|
||||
if (numeric->decimal_point[0] == '\0' && !be_quiet)
|
||||
{
|
||||
error (0, 0, _("\
|
||||
value for field `%s' in category `%s' must not be the empty string"),
|
||||
"decimal_point", "LC_NUMERIC");
|
||||
}
|
||||
|
||||
if (numeric->grouping_act == 0)
|
||||
if (numeric->grouping_act == 0 && !be_quiet)
|
||||
error (0, 0, _("field `%s' in category `%s' not defined"),
|
||||
"grouping", "LC_NUMERIC");
|
||||
}
|
||||
|
||||
+34
-32
@@ -1,6 +1,6 @@
|
||||
/* Copyright (C) 1995, 1996 Free Software Foundation, Inc.
|
||||
/* Copyright (C) 1995, 1996, 1997 Free Software Foundation, Inc.
|
||||
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>, 1995.
|
||||
|
||||
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
|
||||
@@ -106,10 +106,10 @@ time_finish (struct localedef_t *locale)
|
||||
struct locale_time_t *time = locale->categories[LC_TIME].time;
|
||||
|
||||
#define TESTARR_ELEM(cat, max) \
|
||||
if (time->cur_num_##cat == 0) \
|
||||
if (time->cur_num_##cat == 0 && !be_quiet) \
|
||||
error (0, 0, _("field `%s' in category `%s' not defined"), \
|
||||
#cat, "LC_TIME"); \
|
||||
else if (time->cur_num_##cat != max) \
|
||||
else if (time->cur_num_##cat != max && !be_quiet) \
|
||||
error (0, 0, _("field `%s' in category `%s' has not enough values"), \
|
||||
#cat, "LC_TIME")
|
||||
|
||||
@@ -120,7 +120,7 @@ time_finish (struct localedef_t *locale)
|
||||
TESTARR_ELEM (am_pm, 2);
|
||||
|
||||
#define TEST_ELEM(cat) \
|
||||
if (time->cat == NULL) \
|
||||
if (time->cat == NULL && !be_quiet) \
|
||||
error (0, 0, _("field `%s' in category `%s' not defined"), \
|
||||
#cat, "LC_TIME")
|
||||
|
||||
@@ -149,7 +149,7 @@ time_finish (struct localedef_t *locale)
|
||||
memcpy (str, time->era[idx], era_len + 1);
|
||||
|
||||
/* First character must be + or - for the direction. */
|
||||
if (*str != '+' && *str != '-')
|
||||
if (*str != '+' && *str != '-' && !be_quiet)
|
||||
{
|
||||
error (0, 0, _("direction flag in string %d in `era' field"
|
||||
" in category `%s' is not '+' nor '-'"),
|
||||
@@ -159,7 +159,7 @@ time_finish (struct localedef_t *locale)
|
||||
}
|
||||
else
|
||||
time->era_entries[idx].direction = *str;
|
||||
if (*++str != ':')
|
||||
if (*++str != ':' && !be_quiet)
|
||||
{
|
||||
error (0, 0, _("direction flag in string %d in `era' field"
|
||||
" in category `%s' is not a single character"),
|
||||
@@ -171,14 +171,14 @@ time_finish (struct localedef_t *locale)
|
||||
|
||||
/* Now the offset year. */
|
||||
time->era_entries[idx].offset = strtol (str, &endp, 10);
|
||||
if (endp == str)
|
||||
if (endp == str && !be_quiet)
|
||||
{
|
||||
error (0, 0, _("illegal number for offset in string %d in"
|
||||
" `era' field in category `%s'"),
|
||||
idx + 1, "LC_TIME");
|
||||
(void) strsep (&str, ":");
|
||||
}
|
||||
else if (*endp != ':')
|
||||
else if (*endp != ':' && !be_quiet)
|
||||
{
|
||||
error (0, 0, _("garbage at end of offset value in string %d in"
|
||||
" `era' field in category `%s'"),
|
||||
@@ -224,7 +224,7 @@ time_finish (struct localedef_t *locale)
|
||||
time->era_entries[idx].start_date[1] -= 1;
|
||||
|
||||
time->era_entries[idx].start_date[2] = strtol (str, &endp, 10);
|
||||
if (endp == str)
|
||||
if (endp == str && !be_quiet)
|
||||
{
|
||||
invalid_start_date:
|
||||
error (0, 0, _("illegal starting date in string %d in"
|
||||
@@ -232,7 +232,7 @@ time_finish (struct localedef_t *locale)
|
||||
idx + 1, "LC_TIME");
|
||||
(void) strsep (&str, ":");
|
||||
}
|
||||
else if (*endp != ':')
|
||||
else if (*endp != ':' && !be_quiet)
|
||||
{
|
||||
garbage_start_date:
|
||||
error (0, 0, _("garbage at end of starting date in string %d"
|
||||
@@ -245,14 +245,15 @@ time_finish (struct localedef_t *locale)
|
||||
str = endp + 1;
|
||||
|
||||
/* Check for valid value. */
|
||||
if (time->era_entries[idx].start_date[1] < 0
|
||||
|| time->era_entries[idx].start_date[1] >= 12
|
||||
|| time->era_entries[idx].start_date[2] < 0
|
||||
|| (time->era_entries[idx].start_date[2]
|
||||
> days_per_month[time->era_entries[idx].start_date[1]])
|
||||
|| (time->era_entries[idx].start_date[1] == 2
|
||||
&& time->era_entries[idx].start_date[2] == 29
|
||||
&& !__isleap (time->era_entries[idx].start_date[0])))
|
||||
if ((time->era_entries[idx].start_date[1] < 0
|
||||
|| time->era_entries[idx].start_date[1] >= 12
|
||||
|| time->era_entries[idx].start_date[2] < 0
|
||||
|| (time->era_entries[idx].start_date[2]
|
||||
> days_per_month[time->era_entries[idx].start_date[1]])
|
||||
|| (time->era_entries[idx].start_date[1] == 2
|
||||
&& time->era_entries[idx].start_date[2] == 29
|
||||
&& !__isleap (time->era_entries[idx].start_date[0])))
|
||||
&& !be_quiet)
|
||||
error (0, 0, _("starting date is illegal in"
|
||||
" string %d in `era' field in"
|
||||
" category `%s'"),
|
||||
@@ -296,7 +297,7 @@ time_finish (struct localedef_t *locale)
|
||||
time->era_entries[idx].stop_date[1] -= 1;
|
||||
|
||||
time->era_entries[idx].stop_date[2] = strtol (str, &endp, 10);
|
||||
if (endp == str)
|
||||
if (endp == str && !be_quiet)
|
||||
{
|
||||
invalid_stop_date:
|
||||
error (0, 0, _("illegal stopping date in string %d in"
|
||||
@@ -304,7 +305,7 @@ time_finish (struct localedef_t *locale)
|
||||
idx + 1, "LC_TIME");
|
||||
(void) strsep (&str, ":");
|
||||
}
|
||||
else if (*endp != ':')
|
||||
else if (*endp != ':' && !be_quiet)
|
||||
{
|
||||
garbage_stop_date:
|
||||
error (0, 0, _("garbage at end of stopping date in string %d"
|
||||
@@ -317,14 +318,15 @@ time_finish (struct localedef_t *locale)
|
||||
str = endp + 1;
|
||||
|
||||
/* Check for valid value. */
|
||||
if (time->era_entries[idx].stop_date[1] < 0
|
||||
|| time->era_entries[idx].stop_date[1] >= 12
|
||||
|| time->era_entries[idx].stop_date[2] < 0
|
||||
|| (time->era_entries[idx].stop_date[2]
|
||||
> days_per_month[time->era_entries[idx].stop_date[1]])
|
||||
|| (time->era_entries[idx].stop_date[1] == 2
|
||||
&& time->era_entries[idx].stop_date[2] == 29
|
||||
&& !__isleap (time->era_entries[idx].stop_date[0])))
|
||||
if ((time->era_entries[idx].stop_date[1] < 0
|
||||
|| time->era_entries[idx].stop_date[1] >= 12
|
||||
|| time->era_entries[idx].stop_date[2] < 0
|
||||
|| (time->era_entries[idx].stop_date[2]
|
||||
> days_per_month[time->era_entries[idx].stop_date[1]])
|
||||
|| (time->era_entries[idx].stop_date[1] == 2
|
||||
&& time->era_entries[idx].stop_date[2] == 29
|
||||
&& !__isleap (time->era_entries[idx].stop_date[0])))
|
||||
&& !be_quiet)
|
||||
error (0, 0, _("stopping date is illegal in"
|
||||
" string %d in `era' field in"
|
||||
" category `%s'"),
|
||||
@@ -332,10 +334,10 @@ time_finish (struct localedef_t *locale)
|
||||
}
|
||||
}
|
||||
|
||||
if (str == NULL || *str == '\0')
|
||||
if ((str == NULL || *str == '\0') && !be_quiet)
|
||||
{
|
||||
error (0, 0, _("missing era name in string %d in `era' field"
|
||||
"in category `%s'"), idx + 1, "LC_TIME");
|
||||
" in category `%s'"), idx + 1, "LC_TIME");
|
||||
time->era_entries[idx].name =
|
||||
time->era_entries[idx].format = "";
|
||||
}
|
||||
@@ -343,7 +345,7 @@ time_finish (struct localedef_t *locale)
|
||||
{
|
||||
time->era_entries[idx].name = strsep (&str, ":");
|
||||
|
||||
if (str == NULL || *str == '\0')
|
||||
if ((str == NULL || *str == '\0') && !be_quiet)
|
||||
{
|
||||
error (0, 0, _("missing era format in string %d in `era'"
|
||||
" field in category `%s'"),
|
||||
|
||||
@@ -1,21 +1,21 @@
|
||||
/* Copyright (C) 1996 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
Contributed by Ulrich Drepper, <drepper@gnu.ai.mit.edu>.
|
||||
/* Copyright (C) 1996, 1997 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
Contributed by Ulrich Drepper <drepper@gnu.ai.mit.edu>, 1996.
|
||||
|
||||
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 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.
|
||||
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. */
|
||||
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. */
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
# include <config.h>
|
||||
@@ -211,7 +211,7 @@ lr_token (struct linereader *lr, const struct charset_t *charset)
|
||||
lr->token.val.num += ch - '0';
|
||||
}
|
||||
if (isalpha (ch))
|
||||
lr_error (lr, _("garbage at end of digit"));
|
||||
lr_error (lr, _("garbage at end of number"));
|
||||
lr_ungetn (lr, 1);
|
||||
|
||||
return &lr->token;
|
||||
|
||||
@@ -153,7 +153,7 @@ main (int argc, char *argv[])
|
||||
textdomain (PACKAGE);
|
||||
|
||||
while ((optchar = getopt_long (argc, argv, "achkmV", long_options, NULL))
|
||||
!= EOF)
|
||||
!= -1)
|
||||
switch (optchar)
|
||||
{
|
||||
case '\0': /* Long option. */
|
||||
|
||||
@@ -70,6 +70,8 @@ int posix_conformance;
|
||||
/* If not zero give a lot more messages. */
|
||||
int verbose;
|
||||
|
||||
/* If not zero don't print warnings. */
|
||||
int be_quiet;
|
||||
|
||||
|
||||
/* Long options. */
|
||||
@@ -81,6 +83,7 @@ static const struct option long_options[] =
|
||||
{ "force", no_argument, NULL, 'c' },
|
||||
{ "inputfile", required_argument, NULL, 'i' },
|
||||
{ "posix", no_argument, &posix_conformance, 1 },
|
||||
{ "quiet", no_argument, &be_quiet, 1 },
|
||||
{ "verbose", no_argument, &verbose, 1},
|
||||
{ "version", no_argument, NULL, 'V' },
|
||||
{ NULL, 0, NULL, 0 }
|
||||
@@ -127,7 +130,7 @@ main (int argc, char *argv[])
|
||||
textdomain (_libc_intl_domainname);
|
||||
|
||||
while ((optchar = getopt_long (argc, argv, "cf:hi:u:vV", long_options, NULL))
|
||||
!= EOF)
|
||||
!= -1)
|
||||
switch (optchar)
|
||||
{
|
||||
case '\0': /* Long option. */
|
||||
@@ -258,21 +261,22 @@ warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n\
|
||||
|
||||
if (! avail)
|
||||
{
|
||||
const char *locale_names[] = { "LC_COLLATE", "LC_CTYPE",
|
||||
"LC_MONETARY", "LC_NUMERIC",
|
||||
"LC_TIME", "LC_MESSAGES" };
|
||||
static const char *locale_names[] =
|
||||
{ "LC_COLLATE", "LC_CTYPE", "LC_MONETARY",
|
||||
"LC_NUMERIC", "LC_TIME", "LC_MESSAGES"
|
||||
};
|
||||
char *fname;
|
||||
int fd;
|
||||
struct stat st;
|
||||
|
||||
asprintf (&fname, LOCALE_PATH "/%s/%s", act_add_locdef->name,
|
||||
asprintf (&fname, LOCALEDIR "/%s/%s", act_add_locdef->name,
|
||||
locale_names[cat]);
|
||||
fd = open (fname, O_RDONLY);
|
||||
if (fd == -1)
|
||||
{
|
||||
free (fname);
|
||||
|
||||
asprintf (&fname, LOCALE_PATH "/%s/%s/SYS_%s",
|
||||
asprintf (&fname, LOCALEDIR "/%s/%s/SYS_%s",
|
||||
act_add_locdef->name, locale_names[cat],
|
||||
locale_names[cat]);
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/* Copyright (C) 1996 Free Software Foundation, Inc.
|
||||
/* Copyright (C) 1996, 1997 Free Software Foundation, Inc.
|
||||
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>, 1996.
|
||||
|
||||
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
|
||||
@@ -26,6 +26,7 @@
|
||||
#include <locale.h>
|
||||
#include <malloc.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <unistd.h>
|
||||
#include <sys/stat.h>
|
||||
@@ -76,10 +77,31 @@ locfile_read (const char *filename, struct charset_t *charset)
|
||||
{
|
||||
if (filename[0] != '/')
|
||||
{
|
||||
char path[strlen (filename) + 1 + sizeof (LOCSRCDIR)];
|
||||
char *i18npath = __secure_getenv ("I18NPATH");
|
||||
if (i18npath != NULL && *i18npath != '\0')
|
||||
{
|
||||
char path[strlen (filename) + 1 + strlen (i18npath) + 1];
|
||||
char *next;
|
||||
i18npath = strdupa (i18npath);
|
||||
|
||||
stpcpy (stpcpy (stpcpy (path, LOCSRCDIR), "/"), filename);
|
||||
ldfile = lr_open (path, locfile_hash);
|
||||
|
||||
while (ldfile == NULL
|
||||
&& (next = strsep (&i18npath, ":")) != NULL)
|
||||
{
|
||||
stpcpy (stpcpy (stpcpy (path, next), "/"), filename);
|
||||
|
||||
ldfile = lr_open (path, locfile_hash);
|
||||
}
|
||||
}
|
||||
|
||||
/* Test in the default directory. */
|
||||
if (ldfile == NULL)
|
||||
{
|
||||
char path[strlen (filename) + 1 + sizeof (LOCSRCDIR)];
|
||||
|
||||
stpcpy (stpcpy (stpcpy (path, LOCSRCDIR), "/"), filename);
|
||||
ldfile = lr_open (path, locfile_hash);
|
||||
}
|
||||
}
|
||||
|
||||
if (ldfile == NULL)
|
||||
@@ -981,7 +1003,7 @@ write_locale_data (const char *output_path, const char *category,
|
||||
save_err = errno;
|
||||
}
|
||||
|
||||
if (fd == -1)
|
||||
if (fd == -1 && !be_quiet)
|
||||
{
|
||||
error (0, save_err, _("\
|
||||
cannot open output file `%s' for category `%s'"),
|
||||
@@ -1005,7 +1027,7 @@ cannot open output file `%s' for category `%s'"),
|
||||
if (maxiov > 0)
|
||||
step = MIN (maxiov, step);
|
||||
|
||||
if (writev (fd, &vec[cnt], step) < 0)
|
||||
if (writev (fd, &vec[cnt], step) < 0 && !be_quiet)
|
||||
{
|
||||
error (0, errno, _("failure while writing data for category `%s'"),
|
||||
category);
|
||||
|
||||
@@ -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.
|
||||
Contributed by Ulrich Drepper, <drepper@gnu.ai.mit.edu>.
|
||||
|
||||
@@ -53,6 +53,8 @@ struct localedef_t
|
||||
size_t len[6];
|
||||
};
|
||||
|
||||
/* Declared in localedef.c. */
|
||||
extern int be_quiet;
|
||||
|
||||
/* Found in localedef.c. */
|
||||
void def_to_process (const char *name, int category);
|
||||
|
||||
+10
-12
@@ -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.
|
||||
Written by Ulrich Drepper, <drepper@gnu.ai.mit.edu>.
|
||||
|
||||
@@ -52,11 +52,11 @@ typedef struct weight_t
|
||||
#define collate_undefined \
|
||||
(_NL_CURRENT_WORD (LC_COLLATE, _NL_COLLATE_UNDEFINED))
|
||||
#define collate_rules \
|
||||
(_NL_CURRENT (LC_COLLATE, _NL_COLLATE_RULES))
|
||||
((u_int32_t *) _NL_CURRENT (LC_COLLATE, _NL_COLLATE_RULES))
|
||||
|
||||
|
||||
static __inline int get_weight (const STRING_TYPE **str, weight_t *result);
|
||||
static __inline int
|
||||
static __inline void get_weight (const STRING_TYPE **str, weight_t *result);
|
||||
static __inline void
|
||||
get_weight (const STRING_TYPE **str, weight_t *result)
|
||||
{
|
||||
unsigned int ch = *((USTRING_TYPE *) (*str))++;
|
||||
@@ -69,7 +69,7 @@ get_weight (const STRING_TYPE **str, weight_t *result)
|
||||
const size_t level_size = collate_hash_size * (collate_nrules + 1);
|
||||
size_t level;
|
||||
|
||||
slot = (ch * (collate_nrules + 1)) % collate_hash_size;
|
||||
slot = (ch % collate_hash_size) * (collate_nrules + 1);
|
||||
|
||||
level = 0;
|
||||
while (__collate_table[slot] != (u_int32_t) ch)
|
||||
@@ -86,7 +86,7 @@ get_weight (const STRING_TYPE **str, weight_t *result)
|
||||
result->data[cnt].value = &__collate_extra[idx];
|
||||
idx += result->data[cnt].number;
|
||||
}
|
||||
return 0;
|
||||
return;
|
||||
}
|
||||
slot += level_size;
|
||||
}
|
||||
@@ -102,7 +102,7 @@ get_weight (const STRING_TYPE **str, weight_t *result)
|
||||
result->data[cnt].number = 1;
|
||||
result->data[cnt].value = &__collate_table[slot + 1 + cnt];
|
||||
}
|
||||
return ch == 0;
|
||||
return;
|
||||
}
|
||||
|
||||
/* We now look for any collation element which starts with CH.
|
||||
@@ -135,14 +135,12 @@ get_weight (const STRING_TYPE **str, weight_t *result)
|
||||
result->data[cnt].value = &__collate_extra[idx];
|
||||
idx += result->data[cnt].number;
|
||||
}
|
||||
return 0;
|
||||
return;
|
||||
}
|
||||
|
||||
/* To next entry in list. */
|
||||
slot += __collate_extra[slot];
|
||||
}
|
||||
/* NOTREACHED */
|
||||
return 0; /* To calm down gcc. */
|
||||
}
|
||||
|
||||
|
||||
@@ -155,7 +153,7 @@ get_weight (const STRING_TYPE **str, weight_t *result)
|
||||
do \
|
||||
{ \
|
||||
weight_t *newp; \
|
||||
do \
|
||||
while (*str != '\0') \
|
||||
{ \
|
||||
newp = (weight_t *) alloca (sizeof (weight_t) \
|
||||
+ (collate_nrules \
|
||||
@@ -168,7 +166,7 @@ get_weight (const STRING_TYPE **str, weight_t *result)
|
||||
backw->next = newp; \
|
||||
newp->next = NULL; \
|
||||
backw = newp; \
|
||||
get_weight (&str, newp); \
|
||||
} \
|
||||
while (get_weight (&str, newp) == 0); \
|
||||
} \
|
||||
while (0)
|
||||
|
||||
+4
-3
@@ -1,4 +1,4 @@
|
||||
/* Copyright (C) 1993, 1996 Free Software Foundation, Inc.
|
||||
/* Copyright (C) 1993, 1996, 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
|
||||
@@ -24,6 +24,7 @@
|
||||
|
||||
#include <sys/types.h>
|
||||
|
||||
__BEGIN_DECLS
|
||||
|
||||
/* Get system dependent values and data structures. */
|
||||
#include <utmpbits.h>
|
||||
@@ -77,7 +78,7 @@ extern struct utmp *getutline __P ((__const struct utmp *__line));
|
||||
extern struct utmp *pututline __P ((__const struct utmp *__utmp_ptr));
|
||||
|
||||
|
||||
#ifdef __USE_REENTRANT
|
||||
#ifdef __USE_MISC
|
||||
/* Reentrant versions of the file for handling utmp files. */
|
||||
extern int __getutent_r __P ((struct utmp *__buffer, struct utmp **__result));
|
||||
extern int getutent_r __P ((struct utmp *__buffer, struct utmp **__result));
|
||||
@@ -92,7 +93,7 @@ extern int __getutline_r __P ((__const struct utmp *__line,
|
||||
extern int getutline_r __P ((__const struct utmp *__line,
|
||||
struct utmp *__buffer, struct utmp **__result));
|
||||
|
||||
#endif /* Use reentrant. */
|
||||
#endif /* Use misc. */
|
||||
|
||||
__END_DECLS
|
||||
|
||||
|
||||
+1
-1
@@ -38,7 +38,7 @@ static const char *file_name = (const char *) default_file_name;
|
||||
|
||||
/* Descriptor for database. */
|
||||
#if 0
|
||||
/* XXX One day this will become menaingful again. */
|
||||
/* XXX One day this will become meaningful again. */
|
||||
static DB *db_fd;
|
||||
static char last_date[16];
|
||||
#endif
|
||||
|
||||
+4
-4
@@ -1,4 +1,4 @@
|
||||
# Copyright (C) 1991, 92, 93, 94, 95, 96 Free Software Foundation, Inc.
|
||||
# Copyright (C) 1991, 92, 93, 94, 95, 96, 97 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
|
||||
@@ -12,9 +12,9 @@
|
||||
# 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., 675 Mass Ave,
|
||||
# Cambridge, MA 02139, USA.
|
||||
# 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.
|
||||
|
||||
subdir := mach
|
||||
|
||||
|
||||
+23
-2
@@ -26,6 +26,28 @@
|
||||
|
||||
/* This file was broken out from:
|
||||
$Log$
|
||||
Revision 1.1.2.1 1997/03/17 03:52:14 drepper
|
||||
(__mach_error_map_compat): Give full prototype.
|
||||
|
||||
Revision 1.2 1997/03/16 17:41:36 drepper
|
||||
(__mach_error_map_compat): Give full prototype.
|
||||
|
||||
Revision 1.2 1997/03/14 15:26:28 thomas
|
||||
Wed Mar 5 10:40:05 1997 Thomas Bushnell, n/BSG <thomas@gnu.ai.mit.edu>
|
||||
|
||||
* mach/mach_error.c (mach_error_string_int): Give full prototype.
|
||||
* mach/errstring.c (mach_error_string_int): Likewise.
|
||||
* mach/error_compat.c (__mach_error_map_compat): Likewise.
|
||||
|
||||
* mach/spin-solid.c: Include <mach/mach_traps.h>.
|
||||
* mach/spin-solid.c (__spin_lock_solid): Provide arg to
|
||||
swtch_pri.
|
||||
|
||||
* mach/mach_init.c: Include <mach/mig_support.h>.
|
||||
|
||||
* mach/mach_error.h (mach_error_string, mach_error,
|
||||
mach_error_type): Always provide prototypes.
|
||||
|
||||
Revision 1.1 1993/11/30 17:35:24 roland
|
||||
entered into RCS
|
||||
|
||||
@@ -39,8 +61,7 @@
|
||||
|
||||
|
||||
void
|
||||
__mach_error_map_compat( org_err )
|
||||
mach_error_t * org_err;
|
||||
__mach_error_map_compat(mach_error_t *org_err)
|
||||
{
|
||||
mach_error_t err = *org_err;
|
||||
|
||||
|
||||
+24
-3
@@ -26,6 +26,28 @@
|
||||
/*
|
||||
* HISTORY
|
||||
* $Log$
|
||||
* Revision 1.1.2.1 1997/03/17 03:52:30 drepper
|
||||
* (mach_error_string_int): Give full prototype.
|
||||
*
|
||||
* Revision 1.2 1997/03/16 17:41:48 drepper
|
||||
* (mach_error_string_int): Give full prototype.
|
||||
*
|
||||
* Revision 1.2 1997/03/14 15:26:29 thomas
|
||||
* Wed Mar 5 10:40:05 1997 Thomas Bushnell, n/BSG <thomas@gnu.ai.mit.edu>
|
||||
*
|
||||
* * mach/mach_error.c (mach_error_string_int): Give full prototype.
|
||||
* * mach/errstring.c (mach_error_string_int): Likewise.
|
||||
* * mach/error_compat.c (__mach_error_map_compat): Likewise.
|
||||
*
|
||||
* * mach/spin-solid.c: Include <mach/mach_traps.h>.
|
||||
* * mach/spin-solid.c (__spin_lock_solid): Provide arg to
|
||||
* swtch_pri.
|
||||
*
|
||||
* * mach/mach_init.c: Include <mach/mig_support.h>.
|
||||
*
|
||||
* * mach/mach_error.h (mach_error_string, mach_error,
|
||||
* mach_error_type): Always provide prototypes.
|
||||
*
|
||||
* Revision 1.1 1993/11/30 17:35:58 roland
|
||||
* entered into RCS
|
||||
*
|
||||
@@ -67,9 +89,8 @@ mach_error_type( err )
|
||||
boolean_t mach_error_full_diag = FALSE;
|
||||
|
||||
const char *
|
||||
mach_error_string_int( err, diag )
|
||||
mach_error_t err;
|
||||
boolean_t * diag;
|
||||
mach_error_string_int(mach_error_t err,
|
||||
boolean_t * diag)
|
||||
{
|
||||
int sub, system, code;
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/* 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.
|
||||
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
@@ -26,7 +26,7 @@
|
||||
#define _MACH_MACH_TRAPS_H_ 1
|
||||
|
||||
#include <mach/port.h>
|
||||
|
||||
#include <mach/kern_return.h>
|
||||
|
||||
/* Create and return a new receive right. */
|
||||
extern mach_port_t mach_reply_port (void);
|
||||
|
||||
+23
-1
@@ -26,6 +26,28 @@
|
||||
/*
|
||||
* HISTORY
|
||||
* $Log$
|
||||
* Revision 1.1.2.1 1997/03/17 03:52:38 drepper
|
||||
* (mach_error_string_int): Give full prototype.
|
||||
*
|
||||
* Revision 1.2 1997/03/16 17:42:02 drepper
|
||||
* (mach_error_string_int): Give full prototype.
|
||||
*
|
||||
* Revision 1.2 1997/03/14 15:26:30 thomas
|
||||
* Wed Mar 5 10:40:05 1997 Thomas Bushnell, n/BSG <thomas@gnu.ai.mit.edu>
|
||||
*
|
||||
* * mach/mach_error.c (mach_error_string_int): Give full prototype.
|
||||
* * mach/errstring.c (mach_error_string_int): Likewise.
|
||||
* * mach/error_compat.c (__mach_error_map_compat): Likewise.
|
||||
*
|
||||
* * mach/spin-solid.c: Include <mach/mach_traps.h>.
|
||||
* * mach/spin-solid.c (__spin_lock_solid): Provide arg to
|
||||
* swtch_pri.
|
||||
*
|
||||
* * mach/mach_init.c: Include <mach/mig_support.h>.
|
||||
*
|
||||
* * mach/mach_error.h (mach_error_string, mach_error,
|
||||
* mach_error_type): Always provide prototypes.
|
||||
*
|
||||
* Revision 1.1 1992/10/06 18:29:54 roland
|
||||
* entered into RCS
|
||||
*
|
||||
@@ -63,7 +85,7 @@
|
||||
#include <mach_error.h>
|
||||
#include <mach/boolean.h>
|
||||
|
||||
extern char * mach_error_string_int();
|
||||
extern char * mach_error_string_int(mach_error_t, boolean_t *);
|
||||
|
||||
void
|
||||
mach_error( str, err )
|
||||
|
||||
+26
-6
@@ -26,6 +26,32 @@
|
||||
/*
|
||||
* HISTORY
|
||||
* $Log$
|
||||
* Revision 1.2.2.1 1997/03/17 03:52:48 drepper
|
||||
* (mach_error_string, mach_error, mach_error_type): Always provide
|
||||
* prototypes.
|
||||
*
|
||||
* Revision 1.3 1997/03/16 17:42:25 drepper
|
||||
* (mach_error_string, mach_error, mach_error_type): Always provide
|
||||
* prototypes.
|
||||
* (mach_error_fn_t): Comment out declaration; it appears to be entirely
|
||||
* unused dead code.
|
||||
*
|
||||
* Revision 1.3 1997/03/14 15:26:31 thomas
|
||||
* Wed Mar 5 10:40:05 1997 Thomas Bushnell, n/BSG <thomas@gnu.ai.mit.edu>
|
||||
*
|
||||
* * mach/mach_error.c (mach_error_string_int): Give full prototype.
|
||||
* * mach/errstring.c (mach_error_string_int): Likewise.
|
||||
* * mach/error_compat.c (__mach_error_map_compat): Likewise.
|
||||
*
|
||||
* * mach/spin-solid.c: Include <mach/mach_traps.h>.
|
||||
* * mach/spin-solid.c (__spin_lock_solid): Provide arg to
|
||||
* swtch_pri.
|
||||
*
|
||||
* * mach/mach_init.c: Include <mach/mig_support.h>.
|
||||
*
|
||||
* * mach/mach_error.h (mach_error_string, mach_error,
|
||||
* mach_error_type): Always provide prototypes.
|
||||
*
|
||||
* Revision 1.2 1993/11/23 20:39:08 mib
|
||||
* entered into RCS
|
||||
*
|
||||
@@ -53,28 +79,22 @@ const char *mach_error_string(
|
||||
/*
|
||||
* Returns a string appropriate to the error argument given
|
||||
*/
|
||||
#if c_plusplus
|
||||
mach_error_t error_value
|
||||
#endif c_plusplus
|
||||
);
|
||||
|
||||
void mach_error(
|
||||
/*
|
||||
* Prints an appropriate message on the standard error stream
|
||||
*/
|
||||
#if c_plusplus
|
||||
char *str,
|
||||
mach_error_t error_value
|
||||
#endif c_plusplus
|
||||
);
|
||||
|
||||
const char *mach_error_type(
|
||||
/*
|
||||
* Returns a string with the error system, subsystem and code
|
||||
*/
|
||||
#if c_plusplus
|
||||
mach_error_t error_value
|
||||
#endif c_plusplus
|
||||
);
|
||||
|
||||
#endif _MACH_ERROR_
|
||||
|
||||
+15
-14
@@ -1,23 +1,24 @@
|
||||
/* Copyright (C) 1992, 1993, 1995 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
/* Copyright (C) 1992, 1993, 1995, 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 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.
|
||||
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., 675 Mass Ave,
|
||||
Cambridge, MA 02139, USA. */
|
||||
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 <mach_init.h>
|
||||
#include <mach/mach_interface.h>
|
||||
#include <mach/mig_support.h>
|
||||
|
||||
mach_port_t __mach_task_self_;
|
||||
vm_size_t __vm_page_size = 0; /* Must be data not bss for weak alias. */
|
||||
|
||||
+16
-15
@@ -1,28 +1,29 @@
|
||||
/* Copyright (C) 1994, 1995 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
/* Copyright (C) 1994, 1995, 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 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.
|
||||
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., 675 Mass Ave,
|
||||
Cambridge, MA 02139, USA. */
|
||||
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 <spin-lock.h>
|
||||
#include <mach/mach_traps.h>
|
||||
|
||||
void
|
||||
__spin_lock_solid (spin_lock_t *lock)
|
||||
{
|
||||
while (__spin_lock_locked (lock) || ! __spin_try_lock (lock))
|
||||
/* Yield to another thread (system call). */
|
||||
__swtch_pri ();
|
||||
__swtch_pri (0);
|
||||
}
|
||||
weak_alias (__spin_lock_solid, spin_lock_solid);
|
||||
|
||||
@@ -1,5 +1 @@
|
||||
#ifdef USE_NEW_MALLOC
|
||||
# include <new-malloc/malloc.h>
|
||||
#else
|
||||
# include <malloc/malloc.h>
|
||||
#endif
|
||||
#include <malloc/malloc.h>
|
||||
|
||||
+5
-4
@@ -1,4 +1,4 @@
|
||||
# Copyright (C) 1991, 92, 93, 94, 95, 96 Free Software Foundation, Inc.
|
||||
# Copyright (C) 1991, 92, 93, 94, 95, 96, 97 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
|
||||
@@ -19,7 +19,7 @@
|
||||
#
|
||||
# Makefile for malloc routines
|
||||
#
|
||||
subdir := new-malloc
|
||||
subdir := malloc
|
||||
|
||||
all:
|
||||
|
||||
@@ -27,7 +27,7 @@ dist-headers := malloc.h
|
||||
headers := $(dist-headers) obstack.h
|
||||
tests := mallocbug
|
||||
|
||||
distribute = thread-m.h mtrace.awk
|
||||
distribute = thread-m.h mtrace.awk mcheck-init.c mcheck.h
|
||||
|
||||
# Things which get pasted together into gmalloc.c.
|
||||
gmalloc-routines := malloc morecore
|
||||
@@ -50,4 +50,5 @@ $(objpfx)libmcheck.a: $(objpfx)mcheck-init.o
|
||||
lib: $(objpfx)libmcheck.a
|
||||
|
||||
|
||||
CPPFLAGS-malloc.o += -DMALLOC_DEBUG
|
||||
# Uncomment this for test releases. For public releases it is too expensive.
|
||||
#CPPFLAGS-malloc.o += -DMALLOC_DEBUG
|
||||
|
||||
+209
-18
@@ -1,5 +1,5 @@
|
||||
/* Malloc implementation for multiple threads without lock contention.
|
||||
Copyright (C) 1996 Free Software Foundation, Inc.
|
||||
Copyright (C) 1996, 1997 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
Contributed by Wolfram Gloger <wmglo@dent.med.uni-muenchen.de>
|
||||
and Doug Lea <dl@cs.oswego.edu>, 1996.
|
||||
@@ -19,7 +19,7 @@
|
||||
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||
Boston, MA 02111-1307, USA. */
|
||||
|
||||
/* V2.6.4-pt2 Sat Dec 14 1996
|
||||
/* V2.6.4-pt3 Thu Feb 20 1997
|
||||
|
||||
This work is mainly derived from malloc-2.6.4 by Doug Lea
|
||||
<dl@cs.oswego.edu>, which is available from:
|
||||
@@ -647,7 +647,7 @@ do { \
|
||||
might set to a value close to the average size of a process
|
||||
(program) running on your system. Releasing this much memory
|
||||
would allow such a process to run in memory. Generally, it's
|
||||
worth it to tune for trimming rather tham memory mapping when a
|
||||
worth it to tune for trimming rather than memory mapping when a
|
||||
program undergoes phases where several large chunks are
|
||||
allocated and released in ways that can reuse each other's
|
||||
storage, perhaps mixed with phases where there are no such
|
||||
@@ -820,12 +820,12 @@ do { \
|
||||
#if __STD_C
|
||||
|
||||
Void_t * __default_morecore (ptrdiff_t);
|
||||
static Void_t *(*__morecore)(ptrdiff_t) = __default_morecore;
|
||||
Void_t *(*__morecore)(ptrdiff_t) = __default_morecore;
|
||||
|
||||
#else
|
||||
|
||||
Void_t * __default_morecore ();
|
||||
static Void_t *(*__morecore)() = __default_morecore;
|
||||
Void_t *(*__morecore)() = __default_morecore;
|
||||
|
||||
#endif
|
||||
|
||||
@@ -835,6 +835,7 @@ static Void_t *(*__morecore)() = __default_morecore;
|
||||
#define mmap __mmap
|
||||
#define munmap __munmap
|
||||
#define mremap __mremap
|
||||
#define mprotect __mprotect
|
||||
#undef malloc_getpagesize
|
||||
#define malloc_getpagesize __getpagesize()
|
||||
|
||||
@@ -874,6 +875,8 @@ extern Void_t* sbrk();
|
||||
#define mALLOC_STATs __malloc_stats
|
||||
#define mALLOC_USABLE_SIZe __malloc_usable_size
|
||||
#define mALLOC_TRIm __malloc_trim
|
||||
#define mALLOC_GET_STATe __malloc_get_state
|
||||
#define mALLOC_SET_STATe __malloc_set_state
|
||||
|
||||
#else
|
||||
|
||||
@@ -889,6 +892,8 @@ extern Void_t* sbrk();
|
||||
#define mALLOC_STATs malloc_stats
|
||||
#define mALLOC_USABLE_SIZe malloc_usable_size
|
||||
#define mALLOC_TRIm malloc_trim
|
||||
#define mALLOC_GET_STATe malloc_get_state
|
||||
#define mALLOC_SET_STATe malloc_set_state
|
||||
|
||||
#endif
|
||||
|
||||
@@ -912,7 +917,11 @@ size_t mALLOC_USABLE_SIZe(Void_t*);
|
||||
void mALLOC_STATs(void);
|
||||
int mALLOPt(int, int);
|
||||
struct mallinfo mALLINFo(void);
|
||||
#else
|
||||
Void_t* mALLOC_GET_STATe(void);
|
||||
int mALLOC_SET_STATe(Void_t*);
|
||||
|
||||
#else /* !__STD_C */
|
||||
|
||||
#ifndef _LIBC
|
||||
void ptmalloc_init();
|
||||
#endif
|
||||
@@ -929,7 +938,10 @@ size_t mALLOC_USABLE_SIZe();
|
||||
void mALLOC_STATs();
|
||||
int mALLOPt();
|
||||
struct mallinfo mALLINFo();
|
||||
#endif
|
||||
Void_t* mALLOC_GET_STATe();
|
||||
int mALLOC_SET_STATe();
|
||||
|
||||
#endif /* __STD_C */
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
@@ -1486,6 +1498,13 @@ static unsigned long max_mmapped_mem = 0;
|
||||
|
||||
|
||||
|
||||
#ifndef _LIBC
|
||||
#define weak_variable
|
||||
#else
|
||||
/* In GNU libc we want the hook variables to be weak definitions to
|
||||
avoid a problem with Emacs. */
|
||||
#define weak_variable weak_function
|
||||
#endif
|
||||
|
||||
/* Already initialized? */
|
||||
int __malloc_initialized = 0;
|
||||
@@ -1521,7 +1540,7 @@ ptmalloc_init __MALLOC_P((void))
|
||||
__malloc_hook = malloc_starter;
|
||||
__free_hook = free_starter;
|
||||
#endif
|
||||
#if defined(_LIBC)
|
||||
#if defined(_LIBC) && !defined (NO_THREADS)
|
||||
/* Initialize the pthreads interface. */
|
||||
if (__pthread_initialize != NULL)
|
||||
__pthread_initialize();
|
||||
@@ -1533,12 +1552,20 @@ ptmalloc_init __MALLOC_P((void))
|
||||
tsd_setspecific(arena_key, (Void_t *)&main_arena);
|
||||
#endif
|
||||
#if defined(_LIBC) || defined(MALLOC_HOOKS)
|
||||
if((s = getenv("MALLOC_TRIM_THRESHOLD_")))
|
||||
mALLOPt(M_TRIM_THRESHOLD, atoi(s));
|
||||
if((s = getenv("MALLOC_TOP_PAD_")))
|
||||
mALLOPt(M_TOP_PAD, atoi(s));
|
||||
if((s = getenv("MALLOC_MMAP_THRESHOLD_")))
|
||||
mALLOPt(M_MMAP_THRESHOLD, atoi(s));
|
||||
if((s = getenv("MALLOC_MMAP_MAX_")))
|
||||
mALLOPt(M_MMAP_MAX, atoi(s));
|
||||
s = getenv("MALLOC_CHECK_");
|
||||
__malloc_hook = save_malloc_hook;
|
||||
__free_hook = save_free_hook;
|
||||
if(s) {
|
||||
if(s[0]) mallopt(M_CHECK_ACTION, (int)(s[0] - '0'));
|
||||
malloc_check_init();
|
||||
if(s[0]) mALLOPt(M_CHECK_ACTION, (int)(s[0] - '0'));
|
||||
__malloc_check_init();
|
||||
}
|
||||
if(__malloc_initialize_hook != NULL)
|
||||
(*__malloc_initialize_hook)();
|
||||
@@ -1592,18 +1619,19 @@ memalign_hook_ini(sz, alignment) size_t sz; size_t alignment;
|
||||
return mEMALIGn(sz, alignment);
|
||||
}
|
||||
|
||||
void (*__malloc_initialize_hook) __MALLOC_P ((void)) = NULL;
|
||||
void (*__free_hook) __MALLOC_P ((__malloc_ptr_t __ptr)) = NULL;
|
||||
__malloc_ptr_t (*__malloc_hook)
|
||||
void weak_variable (*__malloc_initialize_hook) __MALLOC_P ((void)) = NULL;
|
||||
void weak_variable (*__free_hook) __MALLOC_P ((__malloc_ptr_t __ptr)) = NULL;
|
||||
__malloc_ptr_t weak_variable (*__malloc_hook)
|
||||
__MALLOC_P ((size_t __size)) = malloc_hook_ini;
|
||||
__malloc_ptr_t (*__realloc_hook)
|
||||
__malloc_ptr_t weak_variable (*__realloc_hook)
|
||||
__MALLOC_P ((__malloc_ptr_t __ptr, size_t __size)) = realloc_hook_ini;
|
||||
__malloc_ptr_t (*__memalign_hook)
|
||||
__malloc_ptr_t weak_variable (*__memalign_hook)
|
||||
__MALLOC_P ((size_t __size, size_t __alignment)) = memalign_hook_ini;
|
||||
void weak_variable (*__after_morecore_hook) __MALLOC_P ((void)) = NULL;
|
||||
|
||||
/* Activate a standard set of debugging hooks. */
|
||||
void
|
||||
malloc_check_init()
|
||||
__malloc_check_init()
|
||||
{
|
||||
__malloc_hook = malloc_check;
|
||||
__free_hook = free_check;
|
||||
@@ -2200,6 +2228,10 @@ static void malloc_extend_top(ar_ptr, nb) arena *ar_ptr; INTERNAL_SIZE_T nb;
|
||||
(brk < old_end && old_top != initial_top(&main_arena)))
|
||||
return;
|
||||
|
||||
/* Call the `morecore' hook if necessary. */
|
||||
if (__after_morecore_hook)
|
||||
(*__after_morecore_hook) ();
|
||||
|
||||
sbrked_mem += sbrk_size;
|
||||
|
||||
if (brk == old_end) { /* can just add bytes to current top */
|
||||
@@ -2228,6 +2260,10 @@ static void malloc_extend_top(ar_ptr, nb) arena *ar_ptr; INTERNAL_SIZE_T nb;
|
||||
new_brk = (char*)(MORECORE (correction));
|
||||
if (new_brk == (char*)(MORECORE_FAILURE)) return;
|
||||
|
||||
/* Call the `morecore' hook if necessary. */
|
||||
if (__after_morecore_hook)
|
||||
(*__after_morecore_hook) ();
|
||||
|
||||
sbrked_mem += correction;
|
||||
|
||||
top(&main_arena) = (mchunkptr)brk;
|
||||
@@ -2899,8 +2935,10 @@ Void_t* rEALLOc(oldmem, bytes) Void_t* oldmem; size_t bytes;
|
||||
(void)mutex_lock(&ar_ptr->mutex);
|
||||
#endif
|
||||
|
||||
#ifndef NO_THREADS
|
||||
/* As in malloc(), remember this arena for the next allocation. */
|
||||
tsd_setspecific(arena_key, (Void_t *)ar_ptr);
|
||||
#endif
|
||||
|
||||
newp = chunk_realloc(ar_ptr, oldp, oldsize, nb);
|
||||
|
||||
@@ -3265,10 +3303,12 @@ Void_t* cALLOc(n, elem_size) size_t n; size_t elem_size;
|
||||
if (__malloc_hook != NULL) {
|
||||
sz = n * elem_size;
|
||||
mem = (*__malloc_hook)(sz);
|
||||
if(mem == 0)
|
||||
return 0;
|
||||
#ifdef HAVE_MEMCPY
|
||||
memset(mem, 0, sz);
|
||||
#else
|
||||
while(sz > 0) mem[--sz] = 0; /* rather inefficient */
|
||||
while(sz > 0) ((char*)mem)[--sz] = 0; /* rather inefficient */
|
||||
#endif
|
||||
return mem;
|
||||
}
|
||||
@@ -3404,6 +3444,10 @@ main_trim(pad) size_t pad;
|
||||
|
||||
new_brk = (char*)(MORECORE (-extra));
|
||||
|
||||
/* Call the `morecore' hook if necessary. */
|
||||
if (__after_morecore_hook)
|
||||
(*__after_morecore_hook) ();
|
||||
|
||||
if (new_brk == (char*)(MORECORE_FAILURE)) { /* sbrk failed? */
|
||||
/* Try to figure out what we have */
|
||||
current_brk = (char*)(MORECORE (0));
|
||||
@@ -3686,7 +3730,9 @@ struct mallinfo mALLINFo()
|
||||
struct mallinfo mi;
|
||||
Void_t *vptr = NULL;
|
||||
|
||||
#ifndef NO_THREADS
|
||||
tsd_getspecific(arena_key, vptr);
|
||||
#endif
|
||||
malloc_update_mallinfo((vptr ? (arena*)vptr : &main_arena), &mi);
|
||||
return mi;
|
||||
}
|
||||
@@ -3741,13 +3787,151 @@ int mALLOPt(param_number, value) int param_number; int value;
|
||||
|
||||
|
||||
|
||||
/* Get/set state: malloc_get_state() records the current state of all
|
||||
malloc variables (_except_ for the actual heap contents and `hook'
|
||||
function pointers) in a system dependent, opaque data structure.
|
||||
This data structure is dynamically allocated and can be free()d
|
||||
after use. malloc_set_state() restores the state of all malloc
|
||||
variables to the previously obtained state. This is especially
|
||||
useful when using this malloc as part of a shared library, and when
|
||||
the heap contents are saved/restored via some other method. The
|
||||
primary example for this is GNU Emacs with its `dumping' procedure.
|
||||
`Hook' function pointers are never saved or restored by these
|
||||
functions. */
|
||||
|
||||
#define MALLOC_STATE_MAGIC 0x444c4541l
|
||||
#define MALLOC_STATE_VERSION (0*0x100l + 0l) /* major*0x100 + minor */
|
||||
|
||||
struct malloc_state {
|
||||
long magic;
|
||||
long version;
|
||||
mbinptr av[NAV * 2 + 2];
|
||||
char* sbrk_base;
|
||||
int sbrked_mem_bytes;
|
||||
unsigned long trim_threshold;
|
||||
unsigned long top_pad;
|
||||
unsigned int n_mmaps_max;
|
||||
unsigned long mmap_threshold;
|
||||
int check_action;
|
||||
unsigned long max_sbrked_mem;
|
||||
unsigned long max_total_mem;
|
||||
unsigned int n_mmaps;
|
||||
unsigned int max_n_mmaps;
|
||||
unsigned long mmapped_mem;
|
||||
unsigned long max_mmapped_mem;
|
||||
};
|
||||
|
||||
Void_t*
|
||||
mALLOC_GET_STATe()
|
||||
{
|
||||
mchunkptr victim;
|
||||
struct malloc_state* ms;
|
||||
int i;
|
||||
mbinptr b;
|
||||
|
||||
ptmalloc_init();
|
||||
(void)mutex_lock(&main_arena.mutex);
|
||||
victim = chunk_alloc(&main_arena, request2size(sizeof(*ms)));
|
||||
if(!victim) {
|
||||
(void)mutex_unlock(&main_arena.mutex);
|
||||
return 0;
|
||||
}
|
||||
ms = (struct malloc_state*)chunk2mem(victim);
|
||||
ms->magic = MALLOC_STATE_MAGIC;
|
||||
ms->version = MALLOC_STATE_VERSION;
|
||||
ms->av[0] = main_arena.av[0];
|
||||
ms->av[1] = main_arena.av[1];
|
||||
for(i=0; i<NAV; i++) {
|
||||
b = bin_at(&main_arena, i);
|
||||
if(first(b) == b)
|
||||
ms->av[2*i+2] = ms->av[2*i+3] = 0; /* empty bin (or initial top) */
|
||||
else {
|
||||
ms->av[2*i+2] = first(b);
|
||||
ms->av[2*i+3] = last(b);
|
||||
}
|
||||
}
|
||||
ms->sbrk_base = sbrk_base;
|
||||
ms->sbrked_mem_bytes = sbrked_mem;
|
||||
ms->trim_threshold = trim_threshold;
|
||||
ms->top_pad = top_pad;
|
||||
ms->n_mmaps_max = n_mmaps_max;
|
||||
ms->mmap_threshold = mmap_threshold;
|
||||
ms->check_action = check_action;
|
||||
ms->max_sbrked_mem = max_sbrked_mem;
|
||||
#ifdef NO_THREADS
|
||||
ms->max_total_mem = max_total_mem;
|
||||
#else
|
||||
ms->max_total_mem = 0;
|
||||
#endif
|
||||
ms->n_mmaps = n_mmaps;
|
||||
ms->max_n_mmaps = max_n_mmaps;
|
||||
ms->mmapped_mem = mmapped_mem;
|
||||
ms->max_mmapped_mem = max_mmapped_mem;
|
||||
(void)mutex_unlock(&main_arena.mutex);
|
||||
return (Void_t*)ms;
|
||||
}
|
||||
|
||||
int
|
||||
#if __STD_C
|
||||
mALLOC_SET_STATe(Void_t* msptr)
|
||||
#else
|
||||
mALLOC_SET_STATe(msptr) Void_t* msptr;
|
||||
#endif
|
||||
{
|
||||
struct malloc_state* ms = (struct malloc_state*)msptr;
|
||||
int i;
|
||||
mbinptr b;
|
||||
|
||||
ptmalloc_init();
|
||||
if(ms->magic != MALLOC_STATE_MAGIC) return -1;
|
||||
/* Must fail if the major version is too high. */
|
||||
if((ms->version & ~0xffl) > (MALLOC_STATE_VERSION & ~0xffl)) return -2;
|
||||
(void)mutex_lock(&main_arena.mutex);
|
||||
main_arena.av[0] = ms->av[0];
|
||||
main_arena.av[1] = ms->av[1];
|
||||
for(i=0; i<NAV; i++) {
|
||||
b = bin_at(&main_arena, i);
|
||||
if(ms->av[2*i+2] == 0)
|
||||
first(b) = last(b) = b;
|
||||
else {
|
||||
first(b) = ms->av[2*i+2];
|
||||
last(b) = ms->av[2*i+3];
|
||||
if(i > 0) {
|
||||
/* Make sure the links to the `av'-bins in the heap are correct. */
|
||||
first(b)->bk = b;
|
||||
last(b)->fd = b;
|
||||
}
|
||||
}
|
||||
}
|
||||
sbrk_base = ms->sbrk_base;
|
||||
sbrked_mem = ms->sbrked_mem_bytes;
|
||||
trim_threshold = ms->trim_threshold;
|
||||
top_pad = ms->top_pad;
|
||||
n_mmaps_max = ms->n_mmaps_max;
|
||||
mmap_threshold = ms->mmap_threshold;
|
||||
check_action = ms->check_action;
|
||||
max_sbrked_mem = ms->max_sbrked_mem;
|
||||
#ifdef NO_THREADS
|
||||
max_total_mem = ms->max_total_mem;
|
||||
#endif
|
||||
n_mmaps = ms->n_mmaps;
|
||||
max_n_mmaps = ms->max_n_mmaps;
|
||||
mmapped_mem = ms->mmapped_mem;
|
||||
max_mmapped_mem = ms->max_mmapped_mem;
|
||||
/* add version-dependent code here */
|
||||
(void)mutex_unlock(&main_arena.mutex);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
|
||||
#if defined(_LIBC) || defined(MALLOC_HOOKS)
|
||||
|
||||
/* A simple, standard set of debugging hooks. Overhead is `only' one
|
||||
byte per chunk; still this will catch most cases of double frees or
|
||||
overruns. */
|
||||
|
||||
#define MAGICBYTE(p) ( ( ((unsigned)p >> 3) ^ ((unsigned)p >> 11)) & 0xFF )
|
||||
#define MAGICBYTE(p) ( ( ((size_t)p >> 3) ^ ((size_t)p >> 11)) & 0xFF )
|
||||
|
||||
/* Convert a pointer to be free()d or realloc()ed to a valid chunk
|
||||
pointer. If the provided pointer is not valid, return NULL. The
|
||||
@@ -4014,12 +4198,19 @@ weak_alias (__libc_mallopt, __mallopt) weak_alias (__libc_mallopt, mallopt)
|
||||
weak_alias (__malloc_stats, malloc_stats)
|
||||
weak_alias (__malloc_usable_size, malloc_usable_size)
|
||||
weak_alias (__malloc_trim, malloc_trim)
|
||||
weak_alias (__malloc_get_state, malloc_get_state)
|
||||
weak_alias (__malloc_set_state, malloc_set_state)
|
||||
#endif
|
||||
|
||||
/*
|
||||
|
||||
History:
|
||||
|
||||
V2.6.4-pt3 Thu Feb 20 1997 Wolfram Gloger (wmglo@dent.med.uni-muenchen.de)
|
||||
* Added malloc_get/set_state() (mainly for use in GNU emacs),
|
||||
using interface from Marcus Daniels
|
||||
* All parameters are now adjustable via environment variables
|
||||
|
||||
V2.6.4-pt2 Sat Dec 14 1996 Wolfram Gloger (wmglo@dent.med.uni-muenchen.de)
|
||||
* Added debugging hooks
|
||||
* Fixed possible deadlock in realloc() when out of memory
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user