mirror of
git://sourceware.org/git/glibc.git
synced 2026-09-08 23:58:31 +08:00
Compare commits
33
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
7799b7b335 | ||
|
|
9d8067d8f2 | ||
|
|
6355131153 | ||
|
|
c131718ccc | ||
|
|
26dee9c49c | ||
|
|
fe7bdd630f | ||
|
|
22d57dd369 | ||
|
|
5929563ff2 | ||
|
|
3075e0e37c | ||
|
|
993b3242cd | ||
|
|
e7fd8a39ab | ||
|
|
34b402e5a9 | ||
|
|
4e1101a7da | ||
|
|
3e5f555752 | ||
|
|
bc9f6000f6 | ||
|
|
5ae9d168f6 | ||
|
|
f752bfe379 | ||
|
|
c57abfa735 | ||
|
|
e61abf8398 | ||
|
|
6465cfc9cf | ||
|
|
81e9dad672 | ||
|
|
0d8733c4fc | ||
|
|
1ed4222e57 | ||
|
|
f166d86530 | ||
|
|
4cca6b868f | ||
|
|
f5f52655ce | ||
|
|
377a515b4c | ||
|
|
d1a2b102df | ||
|
|
f6b38b9a39 | ||
|
|
ced858d05f | ||
|
|
ceb2d9aaa8 | ||
|
|
867a8743a4 | ||
|
|
2f6d1f1be9 |
+5
-1
@@ -1,4 +1,4 @@
|
||||
*.d *.o *.so *.po *.go stamp.* *.stamp *.ustamp *.udeps
|
||||
*.d *.o *.so *.po *.go *.bo stamp.* *.stamp *.ustamp *.udeps
|
||||
*.gz *.Z *.tar *.tgz
|
||||
=*
|
||||
TODO COPYING* AUTHORS copyr-* copying.*
|
||||
@@ -14,6 +14,10 @@ gpl2lgpl.sed
|
||||
distinfo
|
||||
distinfo
|
||||
|
||||
analysis
|
||||
docs
|
||||
|
||||
crypt
|
||||
linuxthreads
|
||||
localedata
|
||||
secure_rpc
|
||||
|
||||
@@ -0,0 +1,62 @@
|
||||
List of known bugs (certainly very incomplete)
|
||||
----------------------------------------------
|
||||
|
||||
Time-stamp: <1997-03-22T04:31:41+0100 drepper>
|
||||
|
||||
This following list contains those bugs which I'm aware of. Please
|
||||
make sure that bugs you report are not listed here. If you can fix one
|
||||
of these bugs/limitations I'll certainly be glad to receive a patch.
|
||||
|
||||
Another source of information about bugs is the problem data base of the
|
||||
GNU project. There is an easy to use WWW interface is available at
|
||||
|
||||
http://pogo.gnu.ai.mit.edu:8080/cgi-bin/wwwgnats.pl
|
||||
|
||||
I would appreciate it very much if you could verify the problem was not
|
||||
reported before by looking though the database. To make the information
|
||||
in this data as useful as possible please report bugs always using the
|
||||
`glibcbug' shell script which gets installed with GNU libc.
|
||||
|
||||
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
Severity: [ *] to [***]
|
||||
|
||||
|
||||
[ **] For GNU libc on Linux, there is still no solution for the UTMP
|
||||
problem.
|
||||
[Among others: PR libc/39]
|
||||
|
||||
[ **] There are problems with signal handling when using LinuxThreads.
|
||||
|
||||
[ **] The `cbrtl' function is inaccurate. The algorithm used for `double'
|
||||
and `float' is not usable for `long double'.
|
||||
|
||||
[ **] Not really a bug, but it could lead to such:
|
||||
The RPC code is ugly ugly ugly. It's more or less verbatim taken
|
||||
from Sun's code and therefore mostly lacks complete prototypes and
|
||||
(more important) the use of `const'. It *definitely* needs to be
|
||||
cleaned.
|
||||
|
||||
[ *] The precision of the `sinhl' and/or `asinhl' function do not seem
|
||||
to be the best.
|
||||
|
||||
[ *] The syslog function should print to the console if the LOG_CONS
|
||||
flag was given.
|
||||
[PR libc/72]
|
||||
|
||||
[ *] On Linux, the <linux/posix_types.h> is not clean enough to satisfy
|
||||
the C++ namespace rules. Declaring `struct fd_set' also makes
|
||||
`fd_set' available in the global namespace which conflicts with
|
||||
the definition of `fd_set' in glibc.
|
||||
[PR libc/79]
|
||||
|
||||
[ *] On Linux, there should be a way to prevent defining the symbol
|
||||
NGROUPS_MAX in the <linux/limits.h> header file. In glibc it
|
||||
is defined in <posix1_lim.h> which must not make the other
|
||||
symbols in <linux/limits.h> available.
|
||||
[PR libc/140]
|
||||
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
Ulrich Drepper
|
||||
drepper@cygnus.com
|
||||
@@ -77,6 +77,16 @@ please let me know.
|
||||
|
||||
[Q21] ``On Linux I've got problems with the declarations in Linux
|
||||
kernel headers.''
|
||||
|
||||
[Q22] ``When I try to compile code which uses IPv6 header and
|
||||
definitions on my Linux 2.x.y system I am in trouble.
|
||||
Nothing seems to work.''
|
||||
|
||||
[Q23] ``When compiling GNU libc I get lots of errors saying functions
|
||||
in glibc are duplicated in libgcc.''
|
||||
|
||||
[Q24] ``I have set up /etc/nis.conf, and the Linux libc 5 with NYS
|
||||
works great. But the glibc NIS+ doesn't seem to work.''
|
||||
|
||||
~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~
|
||||
[Q1] ``What systems does the GNU C Library run on?''
|
||||
@@ -550,7 +560,8 @@ by
|
||||
|
||||
in the above example specs file to make it work for other systems.
|
||||
|
||||
Future versions of GCC will automatically provide the correct specs.
|
||||
Version 2.7.2.2 does and future versions of GCC will automatically
|
||||
provide the correct specs.
|
||||
|
||||
|
||||
~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~
|
||||
@@ -597,10 +608,22 @@ invalid. I.e., an emulated FPU is for the libc as good as a real one.
|
||||
[Q20] ``How can I compile gcc 2.7.2.1 from the gcc source code using
|
||||
glibc 2.x?
|
||||
|
||||
[A20] {HJL} There is no support in gcc for glibc 2.0 before gcc 2.8. It
|
||||
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.
|
||||
[A20] {AJ} There's only support for glibc 2.0 in gcc 2.7.2.2 or later.
|
||||
For 2.7.2.2 you should use the following patch and configure for
|
||||
e.g. i486-linux.
|
||||
-----------------------------------------------------------------------
|
||||
--- configure Tue Feb 11 15:57:17 1997
|
||||
+++ configure Wed Feb 12 23:09:29 1997
|
||||
@@ -1021,7 +1021,7 @@
|
||||
gnu_ld=yes
|
||||
# GNU libc version 2 does not supply these;
|
||||
# we want them from GCC.
|
||||
- extra_parts="crtbegin.o crtend.o"
|
||||
+ extra_parts="crtbegin.o crtbeginS.o crtend.o crtendS.o"
|
||||
;;
|
||||
i[3456]86-go32-msdos | i[3456]86-*-go32)
|
||||
cpu_type=i386
|
||||
-----------------------------------------------------------------------
|
||||
|
||||
|
||||
~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~
|
||||
@@ -623,6 +646,52 @@ glibc has defined a replacement. Otherwise you might get undefined
|
||||
results because of type conflicts.
|
||||
|
||||
|
||||
~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~
|
||||
[Q22] ``When I try to compile code which uses IPv6 header and
|
||||
definitions on my Linux 2.x.y system I am in trouble.
|
||||
Nothing seems to work.''
|
||||
|
||||
[A22] {UD} The problem is that the IPv6 development still has not reached
|
||||
a point where it is stable. There are still lots of incompatible changes
|
||||
made and the libc headers have to follow.
|
||||
|
||||
Currently (as of 970401) according to Philip Blundell <pjb27@cam.ac.uk>
|
||||
the required kernel version is 2.1.30.
|
||||
|
||||
|
||||
~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~
|
||||
[Q23] ``When compiling GNU libc I get lots of errors saying functions
|
||||
in glibc are duplicated in libgcc.''
|
||||
|
||||
[A23] {EY} This is *exactly* the same problem that I was having. The
|
||||
problem was due to the fact that the autoconfigure didn't correctly
|
||||
detect that linker flag --no-whole-archive was supported in my linker.
|
||||
In my case it was because I had run ./configure with bogus CFLAGS, and
|
||||
the test failed.
|
||||
|
||||
One thing that is particularly annoying about this problem is that
|
||||
once this is misdetected, running configure again won't fix it unless
|
||||
you first delete config.cache.
|
||||
|
||||
{UD} Starting with glibc-2.0.3 there should be a better test to avoid
|
||||
some problems of this kind. The setting of CFLAGS is checked at the
|
||||
very beginning and if it is not usable `configure' will bark.
|
||||
|
||||
|
||||
|
||||
~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~
|
||||
[Q24] ``I have set up /etc/nis.conf, and the Linux libc 5 with NYS
|
||||
works great. But the glibc NIS+ doesn't seem to work.''
|
||||
|
||||
[A24] The glibc NIS+ implementation uses a /var/nis/NIS_COLD_START
|
||||
file for storing information about the NIS+ server and their
|
||||
public keys, because the nis.conf file do not contain all
|
||||
necessary information. You have to copy a NIS_COLD_START file
|
||||
from a Solaris client (the NIS_COLD_START file is byte order
|
||||
independend) or generate it new with nisinit from the nis-tools
|
||||
(look at http://www-vt.uni-paderborn.de/~kukuk/linux/nisplus.html).
|
||||
|
||||
|
||||
~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~
|
||||
|
||||
Answers were given by:
|
||||
@@ -631,6 +700,7 @@ Answers were given by:
|
||||
{RM} Roland McGrath, <roland@gnu.ai.mit.edu>
|
||||
{HJL} H.J. Lu, <hjl@gnu.ai.mit.edu>
|
||||
{AJ} Andreas Jaeger, <aj@arthur.pfalz.de>
|
||||
{EY} Eric Youngdale, <eric@andante.jic.com>
|
||||
|
||||
Local Variables:
|
||||
mode:text
|
||||
|
||||
@@ -76,6 +76,23 @@ you run `configure':
|
||||
static library is compiled with no optimization and full debugging
|
||||
information, and installed as `-lc_g'.
|
||||
|
||||
`--enable-bounded'
|
||||
`--disable-bounded'
|
||||
Enable or disable building of the C library with support for bounded
|
||||
pointers. To do this one need the enhanced version of the GNU CC
|
||||
with can generate code for bounded pointers. This version of the
|
||||
C library is necessary to run code which is also compiled using the
|
||||
enhanced gcc for debugging purposes.
|
||||
|
||||
There are two more options:
|
||||
|
||||
`--with-gmp'
|
||||
`--with-gettext'
|
||||
These options are not of much use for the normal installer of the
|
||||
GNU libc. Only maintainers need this to get automatic updates of
|
||||
the files from these packages in the GNU C library source tree.
|
||||
|
||||
|
||||
The simplest way to run `configure' is to do it in the directory
|
||||
that contains the library sources. This prepares to build the library
|
||||
in that very directory.
|
||||
@@ -182,6 +199,9 @@ following patterns:
|
||||
iX86-ANYTHING-gnu
|
||||
iX86-ANYTHING-linux
|
||||
m68k-ANYTHING-linux
|
||||
mips-ANYTHING-linux
|
||||
sparc-ANYTHING-linux
|
||||
powerpc-ANYTHING-linux
|
||||
|
||||
Former versions of this library used to support the following
|
||||
configurations but the current status is unknown:
|
||||
@@ -208,7 +228,7 @@ configurations but the current status is unknown:
|
||||
sparc-sun-solaris2.N
|
||||
sparc-sun-sunos4.N
|
||||
|
||||
Each case of `iX86' can be `i386', `i486', `i586', or `i686'.. All
|
||||
Each case of `iX86' can be `i386', `i486', `i586', or `i686'. All
|
||||
of those configurations produce a library that can run on any of these
|
||||
processors. The library will be optimized for the specified processor,
|
||||
but will not use instructions not available on all of them.
|
||||
@@ -652,10 +672,10 @@ level of the `sysdeps' hierarchy. This directory contains
|
||||
subdirectories (and subdirectory trees) for various Unix variants.
|
||||
|
||||
The functions which are system calls in most Unix systems are
|
||||
implemented in assembly code in files in `sysdeps/unix'. These files
|
||||
are named with a suffix of `.S'; for example, `__open.S'. Files ending
|
||||
in `.S' are run through the C preprocessor before being fed to the
|
||||
assembler.
|
||||
automatically generated from the `syscalls.list' files for the appropriate
|
||||
archirecture. The format of the syscalls.list files is quite easy: only
|
||||
a few informations are necessary line the system call name, the number of
|
||||
arguments and such. The files are run through the C preprocessor.
|
||||
|
||||
These files all use a set of macros that should be defined in
|
||||
`sysdep.h'. The `sysdep.h' file in `sysdeps/unix' partially defines
|
||||
|
||||
@@ -142,10 +142,10 @@ ifdef subdir
|
||||
|
||||
foo:=$(shell echo subdir foo >&2)
|
||||
|
||||
+tsrcs := Makefile $(+tsrcs) \
|
||||
$(addsuffix .c,$(others) $(tests)) \
|
||||
$(wildcard $(addsuffix .input,$(tests)) \
|
||||
$(addsuffix .args,$(tests)))
|
||||
+tsrcs := Makefile $(+tsrcs) \
|
||||
$(addsuffix .c,$(others) $(tests) $(test-srcs)) \
|
||||
$(wildcard $(addsuffix .input,$(tests) $(test-srcs)) \
|
||||
$(addsuffix .args,$(tests) $(test-srcs)))
|
||||
+tardeps := $(strip $(+tsrcs))
|
||||
|
||||
verbose = v
|
||||
|
||||
@@ -87,8 +87,8 @@ sources += $(foreach lib,$(extra-libs),$($(lib)-routines:=.c))
|
||||
# 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))) \
|
||||
all-sources = $(wildcard $(sort $(sources) $(sources:.c=.S) $(sources:.c=.s) \
|
||||
$(others:=.c) $(tests:=.c) $(test-srcs:=.c))) \
|
||||
$(foreach dir,$(all-dirs),\
|
||||
$(wildcard \
|
||||
$(addprefix $(dir)/,\
|
||||
|
||||
+17
-5
@@ -23,6 +23,8 @@ ifneq (,)
|
||||
This makefile requires GNU Make.
|
||||
endif
|
||||
|
||||
all: # Make this the default goal
|
||||
|
||||
ifneq "$(origin +included-Makeconfig)" "file"
|
||||
|
||||
+included-Makeconfig := yes
|
||||
@@ -239,7 +241,8 @@ endif
|
||||
# other than there, so the zoneinfo directory contains only universal data,
|
||||
# localizing the configuration data elsewhere.
|
||||
ifndef localtime-file
|
||||
localtime-file = $(inst_sysconfdir)/localtime
|
||||
localtime-file = $(sysconfdir)/localtime
|
||||
inst_localtime-file = $(install_root)$(localtime-file)
|
||||
endif
|
||||
|
||||
# What to use for leap second specifications in compiling the default
|
||||
@@ -319,10 +322,10 @@ endif
|
||||
ifndef +link
|
||||
+link = $(CC) -nostdlib -nostartfiles -o $@ \
|
||||
$(sysdep-LDFLAGS) $(config-LDFLAGS) $(LDFLAGS) \
|
||||
$(addprefix $(csu-objpfx),start.o) $(+preinit) \
|
||||
$(addprefix $(csu-objpfx),start.o) $(+preinit) $(+prector) \
|
||||
$(filter-out $(addprefix $(csu-objpfx),start.o) $(+preinit) \
|
||||
$(link-extra-libs) $(common-objpfx)libc% $(+postinit),$^) \
|
||||
$(link-extra-libs) $(link-libc) $(+postinit)
|
||||
$(link-extra-libs) $(link-libc) $(+postctor) $(+postinit)
|
||||
endif
|
||||
ifndef config-LDFLAGS
|
||||
ifeq (yes,$(build-shared))
|
||||
@@ -346,7 +349,8 @@ else
|
||||
default-rpath = $(libdir)
|
||||
endif
|
||||
# This is how to find at build-time things that will be installed there.
|
||||
rpath-link = $(common-objdir):$(elfobjdir):$(nssobjdir)
|
||||
rpath-link = $(common-objdir):$(mathobjdir):$(elfobjdir):$(nssobjdir)
|
||||
mathobjdir := $(patsubst ../$(subdir),.,$(common-objpfx)math)
|
||||
elfobjdir := $(patsubst ../$(subdir),.,$(common-objpfx)elf)
|
||||
nssobjdir := $(patsubst ../$(subdir),.,$(common-objpfx)nss)
|
||||
else
|
||||
@@ -355,7 +359,13 @@ endif
|
||||
endif
|
||||
ifndef link-extra-libs
|
||||
ifeq (yes,$(build-shared))
|
||||
ifneq ($(common-objpfx),$(objpfx))
|
||||
link-extra-libs = $(foreach lib,$(LDLIBS-$(@F)),\
|
||||
$(wildcard $(common-objpfx)$(lib).so$($(notdir $(lib)).so-version) \
|
||||
$(objpfx)$(lib).so$($(notdir $(lib)).so-version)))
|
||||
else
|
||||
link-extra-libs = $(foreach lib,$(LDLIBS-$(@F)),$(common-objpfx)$(lib).so$($(notdir $(lib)).so-version))
|
||||
endif
|
||||
else
|
||||
link-extra-libs = $(foreach lib,$(LDLIBS-$(@F)),$(common-objpfx)$(lib).a)
|
||||
endif
|
||||
@@ -366,6 +376,8 @@ endif
|
||||
ifeq ($(elf),yes)
|
||||
+preinit = $(addprefix $(csu-objpfx),crti.o)
|
||||
+postinit = $(addprefix $(csu-objpfx),crtn.o)
|
||||
+prector = `$(CC) --print-file-name=crtbegin.o`
|
||||
+postctor = `$(CC) --print-file-name=crtend.o`
|
||||
endif
|
||||
csu-objpfx = $(common-objpfx)csu/
|
||||
elf-objpfx = $(common-objpfx)elf/
|
||||
@@ -481,7 +493,7 @@ 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
|
||||
all-object-suffixes := .o .so .po .go .bo
|
||||
libtype.o := lib%.a
|
||||
ifeq (yes,$(build-shared))
|
||||
# Under --enable-shared, we will build a shared library of PIC objects.
|
||||
|
||||
@@ -131,6 +131,9 @@ ifeq (yes,$(build-shared))
|
||||
lib: $(common-objpfx)libc.so
|
||||
endif
|
||||
|
||||
# We have a versioning file for libc.so.
|
||||
#libc-map = libc.map
|
||||
|
||||
all-Subdirs-files = $(wildcard $(addsuffix /Subdirs, $(config-sysdirs)))
|
||||
$(objpfx)sysd-dirs: $(+sysdir_pfx)config.make $(all-Subdirs-files)
|
||||
(echo define sysdep-subdirs; \
|
||||
@@ -277,19 +280,28 @@ parent_echo-distinfo:
|
||||
$(addprefix +nodist+,$(generated))
|
||||
|
||||
|
||||
.PHONY: parent-tests
|
||||
tests: parent-tests
|
||||
|
||||
# Run a test on the header files we use.
|
||||
parent-tests: $(objpfx)isomac
|
||||
$(dir $<)$(notdir $<) '$(CC)' '$(+sysdep-includes)' > $<.out
|
||||
|
||||
$(objpfx)isomac: isomac.c
|
||||
$(native-compile)
|
||||
|
||||
# Make the distribution tarfile.
|
||||
|
||||
distribute := README INSTALL FAQ NOTES NEWS PROJECTS \
|
||||
distribute := README INSTALL FAQ NOTES NEWS PROJECTS BUGS \
|
||||
COPYING.LIB COPYING ChangeLog ChangeLog.[0-9] \
|
||||
Makefile Makeconfig Makerules Rules Make-dist MakeTAGS \
|
||||
extra-lib.mk o-iterator.mk \
|
||||
extra-lib.mk o-iterator.mk isomac.c \
|
||||
ansidecl.h mkinstalldirs move-if-change install-sh \
|
||||
configure configure.in aclocal.m4 config.sub config.guess\
|
||||
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 \
|
||||
mcheck.h glibcbug.in xlocale.h
|
||||
rpm/Makefile rpm/template rpm/rpmrc glibcbug.in
|
||||
|
||||
distribute := $(strip $(distribute))
|
||||
generated := $(generated) stubs.h version-info.h
|
||||
@@ -303,6 +315,8 @@ makeinfo --no-validate --no-warn --no-headers $< -o $@
|
||||
endef
|
||||
INSTALL: manual/maint.texi; $(format-me)
|
||||
NOTES: manual/creature.texi; $(format-me)
|
||||
manual/dir-add.texi:
|
||||
$(MAKE) $(PARALLELMFLAGS) -C $(@D) $(@F)
|
||||
|
||||
rpm/%: subdir_distinfo
|
||||
$(MAKE) $(PARALLELMFLAGS) -C $(@D) subdirs='$(subdirs)' $(@F)
|
||||
|
||||
@@ -80,6 +80,12 @@ ar-symtab-name = __.SYMDEF
|
||||
else
|
||||
ar-symtab-name = # The null name is used in ELF archives.
|
||||
endif
|
||||
|
||||
# This variable is used in ``include $(o-iterator)'' after defining
|
||||
# $(o-iterator-doit) to produce some desired rule using $o for the object
|
||||
# suffix, and setting $(object-suffixes-left) to $(object-suffixes); a copy
|
||||
# is produced for each object suffix in use.
|
||||
o-iterator = $(patsubst %,$(..)o-iterator.mk,$(object-suffixes-left))
|
||||
|
||||
# Include any system-specific makefiles.
|
||||
|
||||
@@ -167,23 +173,25 @@ $(common-objpfx)dummy.d:
|
||||
# generated sysdep rules in included from sysd-rules below. When
|
||||
# compiling in the source tree, generated sources go into the current
|
||||
# directory, and those should be chosen before any sources in sysdeps.
|
||||
$(objpfx)%.o: %.S $(before-compile); $(compile-command.S)
|
||||
$(objpfx)%.so: %.S $(before-compile); $(compile-command.S)
|
||||
$(objpfx)%.po: %.S $(before-compile); $(compile-command.S)
|
||||
$(objpfx)%.go: %.S $(before-compile); $(compile-command.S)
|
||||
$(objpfx)%.bo: %.S $(before-compile); $(compile-command.S)
|
||||
define o-iterator-doit
|
||||
$(objpfx)%$o: %.S $(before-compile); $$(compile-command.S)
|
||||
endef
|
||||
object-suffixes-left := $(object-suffixes)
|
||||
include $(o-iterator)
|
||||
$(objpfx)%.d: %.S $(before-compile); $(+make-deps)
|
||||
$(objpfx)%.o: %.s $(before-compile); $(compile-command.s)
|
||||
$(objpfx)%.so: %.s $(before-compile); $(compile-command.s)
|
||||
$(objpfx)%.po: %.s $(before-compile); $(compile-command.s)
|
||||
$(objpfx)%.go: %.s $(before-compile); $(compile-command.s)
|
||||
$(objpfx)%.bo: %.s $(before-compile); $(compile-command.s)
|
||||
|
||||
define o-iterator-doit
|
||||
$(objpfx)%$o: %.s $(before-compile); $$(compile-command.s)
|
||||
endef
|
||||
object-suffixes-left := $(object-suffixes)
|
||||
include $(o-iterator)
|
||||
$(objpfx)%.d: %.s $(common-objpfx)dummy.d; $(make-dummy-dep)
|
||||
$(objpfx)%.o: %.c $(before-compile); $(compile-command.c)
|
||||
$(objpfx)%.so: %.c $(before-compile); $(compile-command.c)
|
||||
$(objpfx)%.po: %.c $(before-compile); $(compile-command.c)
|
||||
$(objpfx)%.go: %.c $(before-compile); $(compile-command.c)
|
||||
$(objpfx)%.bo: %.c $(before-compile); $(compile-command.c)
|
||||
|
||||
define o-iterator-doit
|
||||
$(objpfx)%$o: %.c $(before-compile); $$(compile-command.c)
|
||||
endef
|
||||
object-suffixes-left := $(object-suffixes)
|
||||
include $(o-iterator)
|
||||
$(objpfx)%.d: %.c $(before-compile); $(+make-deps)
|
||||
|
||||
# Omit the objpfx rules when building in the source tree, because
|
||||
@@ -191,23 +199,25 @@ $(objpfx)%.d: %.c $(before-compile); $(+make-deps)
|
||||
ifdef objpfx
|
||||
# Define first rules to find the source files in $(objpfx).
|
||||
# Generated source files will end up there.
|
||||
$(objpfx)%.o: $(objpfx)%.S $(before-compile); $(compile-command.S)
|
||||
$(objpfx)%.so: $(objpfx)%.S $(before-compile); $(compile-command.S)
|
||||
$(objpfx)%.po: $(objpfx)%.S $(before-compile); $(compile-command.S)
|
||||
$(objpfx)%.go: $(objpfx)%.S $(before-compile); $(compile-command.S)
|
||||
$(objpfx)%.bo: $(objpfx)%.S $(before-compile); $(compile-command.S)
|
||||
define o-iterator-doit
|
||||
$(objpfx)%$o: $(objpfx)%.S $(before-compile); $$(compile-command.S)
|
||||
endef
|
||||
object-suffixes-left := $(object-suffixes)
|
||||
include $(o-iterator)
|
||||
$(objpfx)%.d: $(objpfx)%.S $(before-compile); $(+make-deps)
|
||||
$(objpfx)%.o: $(objpfx)%.s $(before-compile); $(compile-command.s)
|
||||
$(objpfx)%.so: $(objpfx)%.s $(before-compile); $(compile-command.s)
|
||||
$(objpfx)%.po: $(objpfx)%.s $(before-compile); $(compile-command.s)
|
||||
$(objpfx)%.go: $(objpfx)%.s $(before-compile); $(compile-command.s)
|
||||
$(objpfx)%.bo: $(objpfx)%.s $(before-compile); $(compile-command.s)
|
||||
|
||||
define o-iterator-doit
|
||||
$(objpfx)%$o: $(objpfx)%.s $(before-compile); $$(compile-command.s)
|
||||
endef
|
||||
object-suffixes-left := $(object-suffixes)
|
||||
include $(o-iterator)
|
||||
$(objpfx)%.d: $(objpfx)%.s $(common-objpfx)dummy.d; $(make-dummy-dep)
|
||||
$(objpfx)%.o: $(objpfx)%.c $(before-compile); $(compile-command.c)
|
||||
$(objpfx)%.so: $(objpfx)%.c $(before-compile); $(compile-command.c)
|
||||
$(objpfx)%.po: $(objpfx)%.c $(before-compile); $(compile-command.c)
|
||||
$(objpfx)%.go: $(objpfx)%.c $(before-compile); $(compile-command.c)
|
||||
$(objpfx)%.bo: $(objpfx)%.c $(before-compile); $(compile-command.c)
|
||||
|
||||
define o-iterator-doit
|
||||
$(objpfx)%$o: $(objpfx)%.c $(before-compile); $$(compile-command.c)
|
||||
endef
|
||||
object-suffixes-left := $(object-suffixes)
|
||||
include $(o-iterator)
|
||||
$(objpfx)%.d: $(objpfx)%.c $(before-compile); $(+make-deps)
|
||||
endif
|
||||
|
||||
@@ -284,8 +294,10 @@ endif
|
||||
|
||||
# GCC can grok options after the file name, and it looks nicer that way.
|
||||
compile.c = $(CC) $< -c $(CFLAGS) $(CPPFLAGS)
|
||||
compile.S = $(CC) $< -c $(CPPFLAGS) -DASSEMBLER $(asm-CPPFLAGS)
|
||||
COMPILE.S = $(CC) -c $(CPPFLAGS) -DASSEMBLER $(asm-CPPFLAGS)
|
||||
compile.S = \
|
||||
$(CC) $< -c $(CPPFLAGS) -DASSEMBLER $(asm-CPPFLAGS) $(ASFLAGS-$(suffix $@))
|
||||
COMPILE.S = \
|
||||
$(CC) -c $(CPPFLAGS) -DASSEMBLER $(asm-CPPFLAGS) $(ASFLAGS-$(suffix $@))
|
||||
COMPILE.s = $(filter-out -pipe,$(CC)) -c $(ASFLAGS)
|
||||
|
||||
# We need this for the output to go in the right place. It will default to
|
||||
@@ -328,6 +340,12 @@ else
|
||||
no-whole-archive =
|
||||
endif
|
||||
|
||||
ifeq ($(versioning),yes)
|
||||
load-map-file = $($(@F:%.so=%)-map:%=-Wl,--version-script=%)
|
||||
else
|
||||
load-map-file =
|
||||
endif
|
||||
|
||||
interp-obj = $(common-objpfx)interp.so
|
||||
$(interp-obj): $(common-objpfx)%.so: $(..)%.c
|
||||
$(compile-command.c)
|
||||
@@ -339,12 +357,14 @@ $(patsubst %,$(objpfx)%.so,$(extra-libs)): $(interp-obj)
|
||||
|
||||
define build-shlib
|
||||
$(LINK.o) -shared -o $@ $(sysdep-LDFLAGS) $(config-LDFLAGS) \
|
||||
-B$(csu-objpfx) \
|
||||
-B$(csu-objpfx) $(load-map-file) \
|
||||
-Wl,-soname=lib$(libprefix)$(@F:lib%.so=%).so$($(@F)-version) \
|
||||
$(LDFLAGS.so) $(LDFLAGS-$(@F:lib%.so=%).so) \
|
||||
-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.
|
||||
@@ -360,12 +380,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
|
||||
@@ -391,12 +405,6 @@ headers := $(headers) $(sysdep_headers)
|
||||
override objects := $(addprefix $(objpfx),$(sources:.c=.o))
|
||||
|
||||
|
||||
# This variable is used in ``include $(o-iterator)'' after defining
|
||||
# $(o-iterator-doit) to produce some desired rule using $o for the object
|
||||
# suffix, and setting $(object-suffixes-left) to $(object-suffixes); a copy
|
||||
# is produced for each object suffix in use.
|
||||
o-iterator = $(patsubst %,$(..)o-iterator.mk,$(object-suffixes-left))
|
||||
|
||||
# The makefile may define $(extra-libs) with `libfoo libbar'
|
||||
# to build libfoo.a et al from the modules listed in $(libfoo-routines).
|
||||
ifdef extra-libs
|
||||
@@ -805,19 +813,23 @@ install: install-no-libc.a-nosubdir
|
||||
|
||||
# Command to compile $< in $(objdir) using the native libraries.
|
||||
define native-compile
|
||||
cwd=`pwd`; cd $(@D); $(BUILD_CC) $(BUILD_CFLAGS) \
|
||||
$(addprefix $$cwd/,$^) -o $(@F)
|
||||
$(make-target-directory)
|
||||
$(patsubst %/,cd %;,$(objpfx)) \
|
||||
$(BUILD_CC) $($(basename $(<F))-CFLAGS) $(ALL_BUILD_CFLAGS) \
|
||||
$(firstword $(filter /%,$< $(shell pwd)/$<)) -o $(@F)
|
||||
endef
|
||||
|
||||
# Command to compile $< in $(common-objdir) using the native libraries.
|
||||
# We must cd to $(objdir) anyway so that $(..)config.h is valid.
|
||||
define common-objdir-compile
|
||||
cd $(objpfx).; \
|
||||
$(BUILD_CC) $(BUILD_CFLAGS) $(<:$(common-objpfx)%=$(..)%) -o $(..)$(@F)
|
||||
$(patsubst %/,cd %;,$(objpfx)) \
|
||||
$(BUILD_CC) $($(basename $(<F))-CFLAGS) $(ALL_BUILD_CFLAGS) \
|
||||
$(firstword $(filter /%,$< $(shell pwd)/$<)) -o $(..)$(@F)
|
||||
endef
|
||||
|
||||
# We always want to use configuration definitions.
|
||||
BUILD_CFLAGS = -include $(common-objpfx)config.h
|
||||
# Note that this is only used for commands running in $(objpfx).
|
||||
ALL_BUILD_CFLAGS = $(BUILD_CFLAGS) -include $(..)config.h
|
||||
|
||||
# Support the GNU standard name for this target.
|
||||
.PHONY: check
|
||||
@@ -845,9 +857,10 @@ mostlyclean: common-mostlyclean
|
||||
|
||||
# Remove the object files.
|
||||
common-mostlyclean:
|
||||
-rm -f $(addprefix $(objpfx),$(tests) $(others) \
|
||||
$(addsuffix .o,$(tests) $(others)) \
|
||||
$(addsuffix .out,$(tests)))
|
||||
-rm -f $(addprefix $(objpfx),$(tests) $(test-srcs) $(others) \
|
||||
$(addsuffix .o,$(tests) $(test-srcs) \
|
||||
$(others)) \
|
||||
$(addsuffix .out,$(tests) $(test-srcs)))
|
||||
-rm -f $(addprefix $(objpfx),$(extra-objs) $(install-lib))
|
||||
-rm -f core $(common-objpfx)stub-$(subdir)
|
||||
$(rmobjs)
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
GNU C Library NEWS -- history of user-visible changes. 1997-02-13
|
||||
GNU C Library NEWS -- history of user-visible changes. 1997-03-18
|
||||
|
||||
Copyright (C) 1992, 93, 94, 95, 96, 97 Free Software Foundation, Inc.
|
||||
See the end for copying conditions.
|
||||
@@ -17,6 +17,25 @@ Version 2.1
|
||||
|
||||
* Miles Bader provided the `argp' function family to support hierachical
|
||||
command line argument parsing, layered on top of getopt.
|
||||
|
||||
* strtod accepts new hexadecimal floating-point format from ISO C 9X
|
||||
|
||||
* printf has two new specifiers %a and %A to print hexadecimal flaoting-point
|
||||
numbers
|
||||
|
||||
* scanf recognizes the %A format for scanning floating point numbers
|
||||
|
||||
* the new header <inttypes.h> from ISO C 9X provides information and
|
||||
interfaces for the available integer types
|
||||
|
||||
* the new header <complex.h> contains definitions of the complex math
|
||||
functions from ISO C 9X
|
||||
|
||||
* Thorsten Kukuk provided an implementation for NIS+, securelevel 0 and 1.
|
||||
The implementation for securelevel 2 will follow as soon as the Diffie-
|
||||
Hellman patent expired.
|
||||
|
||||
* Andreas Jaeger provided a test suite for the math library
|
||||
|
||||
Version 2.0.2
|
||||
|
||||
@@ -25,6 +44,8 @@ Version 2.0.2
|
||||
* add atoll function
|
||||
|
||||
* fix complex problems in Berkeley DB code
|
||||
|
||||
* fix math functions
|
||||
|
||||
Version 2.0.1
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
Open jobs for finishing GNU libc:
|
||||
---------------------------------
|
||||
Status: January 1997
|
||||
Status: April 1997
|
||||
|
||||
If you have time and talent to take over any of the jobs below please
|
||||
contact <bug-glibc@prep.ai.mit.edu>
|
||||
@@ -19,7 +19,16 @@ contact <bug-glibc@prep.ai.mit.edu>
|
||||
standards if they do not contradict each other.
|
||||
|
||||
|
||||
[ 3] Write translations for the GNU libc message for the so far
|
||||
[ 3] The IMHO opinion most important task is to write a more complete
|
||||
test suite. We cannot get too many people working on this. It is
|
||||
not difficult to write a test, find a definition of the function
|
||||
which I normally can provide, if necessary, and start writing tests
|
||||
to test for compliance. Beside this, take a look at the sources
|
||||
and write tests which in total test as many paths of execution as
|
||||
possible.
|
||||
|
||||
|
||||
[ 4] Write translations for the GNU libc message for the so far
|
||||
unsupported languages. GNU libc is fully internationalized and
|
||||
users can immediately benefit from this.
|
||||
|
||||
@@ -28,7 +37,7 @@ contact <bug-glibc@prep.ai.mit.edu>
|
||||
for the current status (of course better use a mirror of prep).
|
||||
|
||||
|
||||
[ 4] Write wordexp() function; this is described in POSIX.2, the
|
||||
[ 5] Write wordexp() function; this is described in POSIX.2, the
|
||||
header <wordexp.h> already exists.
|
||||
|
||||
Implementation idea: use some functions from bash.
|
||||
@@ -36,7 +45,7 @@ contact <bug-glibc@prep.ai.mit.edu>
|
||||
**** Somebody is working on this. Help may or may not be appreciated.
|
||||
|
||||
|
||||
[ 5] Write `long double' versions of the math functions. This should be
|
||||
[ 6] Write `long double' versions of the math functions. This should be
|
||||
done in collaboration with the NetBSD and FreeBSD people.
|
||||
|
||||
The libm is in fact fdlibm (not the same as in Linux libc).
|
||||
@@ -45,7 +54,18 @@ contact <bug-glibc@prep.ai.mit.edu>
|
||||
the rest.
|
||||
|
||||
|
||||
[ 6] If you enjoy assembler programming (as I do --drepper :-) you might
|
||||
[ 7] Several math functions have to be written:
|
||||
|
||||
- exp2
|
||||
|
||||
each with float, double, and long double arguments.
|
||||
|
||||
Beside this most of the complex math functions which are new in
|
||||
ISO C 9X should be improved. Writing some of them in assembler is
|
||||
useful to exploit the parallelism which often is available.
|
||||
|
||||
|
||||
[ 8] If you enjoy assembler programming (as I do --drepper :-) you might
|
||||
be interested in writing optimized versions for some functions.
|
||||
Especially the string handling functions can be optimized a lot.
|
||||
|
||||
@@ -60,42 +80,55 @@ contact <bug-glibc@prep.ai.mit.edu>
|
||||
work.
|
||||
|
||||
|
||||
[ 7] Write nftw() function. Perhaps it might be good to reimplement the
|
||||
[ 9] Write nftw() function. Perhaps it might be good to reimplement the
|
||||
ftw() function as well to share most of the code.
|
||||
|
||||
**** Almost done!
|
||||
|
||||
|
||||
[ 8] Write AVL-tree based tsearch() et.al. functions. Currently only
|
||||
a very simple algorithm is used.
|
||||
There is a public domain version but using this would cause problems
|
||||
with the assignment.
|
||||
|
||||
|
||||
[ 9] Extend regex and/or rx to work with wide characters and complete
|
||||
[10] Extend regex and/or rx to work with wide characters and complete
|
||||
implementation of character class and collation class handling.
|
||||
|
||||
It is planed to do a complete rewrite.
|
||||
|
||||
|
||||
[10] Write access function for netmasks, bootparams, and automount
|
||||
[11] Write access function for netmasks, bootparams, and automount
|
||||
databases for nss_files and nss_db module.
|
||||
The functions should be embedded in the nss scheme. This is not
|
||||
hard and not all services must be supported at once.
|
||||
|
||||
|
||||
[11] Rewrite utmp/wtmp functions to use database functions. This is much
|
||||
[12] Rewrite utmp/wtmp functions to use database functions. This is much
|
||||
better than the normal flat file format.
|
||||
|
||||
**** 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:
|
||||
[13] 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
|
||||
*** Probably underway
|
||||
+ fmtmsg() from SVID
|
||||
*** Probably underway
|
||||
|
||||
More information are available on request.
|
||||
|
||||
|
||||
[14] We need to write a library for on-the-fly transformation of streams
|
||||
of text. In fact, this would be a recode-library (you know, GNU recode).
|
||||
This is needed in several places in the GNU libc and I already have
|
||||
rather concrete plans but so far no possibility to start this.
|
||||
|
||||
|
||||
[15] Cleaning up the header files. Ideally, each header style should
|
||||
follow the "good examples". Each variable and function should have
|
||||
a short description of the function and its parameters. The prototypes
|
||||
should always contain variable names which can help to identify their
|
||||
meaning; better than
|
||||
|
||||
int foo __P ((int, int, int, int));
|
||||
|
||||
Blargh!
|
||||
|
||||
@@ -83,19 +83,19 @@ common-generated := $(common-generated) dummy.o dummy.c empty.c empty.o
|
||||
.PHONY: others tests
|
||||
others: $(addprefix $(objpfx),$(others) $(extra-objs))
|
||||
ifeq ($(cross-compiling),yes)
|
||||
tests: $(addprefix $(objpfx),$(tests))
|
||||
tests: $(addprefix $(objpfx),$(tests) $(test-srcs))
|
||||
else
|
||||
tests: $(tests:%=$(objpfx)%.out)
|
||||
endif
|
||||
|
||||
ifneq "$(strip $(others) $(tests))" ""
|
||||
$(addprefix $(objpfx),$(others) $(tests)): %: %.o \
|
||||
ifneq "$(strip $(others) $(tests) $(test-srcs))" ""
|
||||
$(addprefix $(objpfx),$(others) $(tests) $(test-srcs)): %: %.o \
|
||||
$(sort $(filter $(common-objpfx)libc%,$(link-libc))) \
|
||||
$(addprefix $(csu-objpfx),start.o) $(+preinit) $(+postinit)
|
||||
$(+link)
|
||||
endif
|
||||
|
||||
ifneq "$(strip $(tests))" ""
|
||||
ifneq "$(strip $(tests) $(test-srcs))" ""
|
||||
# These are the implicit rules for making test outputs
|
||||
# from the test programs and whatever input files are present.
|
||||
$(objpfx)%.out: %.args $(objpfx)% %.input
|
||||
|
||||
+1
-1
@@ -24,7 +24,7 @@ subdir := argp
|
||||
headers = argp.h
|
||||
distribute = argp-fmtstream.h argp-namefrob.h
|
||||
routines = $(addprefix argp-, ba fmtstream fs-xinl help parse pv \
|
||||
pvh xinl)
|
||||
pvh xinl eexst)
|
||||
|
||||
tests = argp-test
|
||||
|
||||
|
||||
+1
-1
@@ -23,4 +23,4 @@
|
||||
the ARGP_HELP_BUG_ADDR flag is set (as it is by various standard help
|
||||
messages), embedded in a sentence that says something like `Report bugs to
|
||||
ADDR.'. */
|
||||
char *argp_program_bug_address = 0;
|
||||
const char *argp_program_bug_address = 0;
|
||||
|
||||
@@ -0,0 +1,29 @@
|
||||
/* Default definition for ARGP_ERR_EXIT_STATUS
|
||||
Copyright (C) 1997 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
Written by Miles Bader <miles@gnu.ai.mit.edu>.
|
||||
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Library General Public License as
|
||||
published by the Free Software Foundation; either version 2 of the
|
||||
License, or (at your option) any later version.
|
||||
|
||||
The GNU C Library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Library General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Library General Public
|
||||
License along with the GNU C Library; see the file COPYING.LIB. If not,
|
||||
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||
Boston, MA 02111-1307, USA. */
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include <config.h>
|
||||
#endif
|
||||
|
||||
#include "argp.h"
|
||||
|
||||
/* The exit status that argp will use when exiting due to a parsing error.
|
||||
If not defined or set by the user program, this defaults to 1. */
|
||||
error_t argp_err_exit_status = 1;
|
||||
@@ -157,7 +157,7 @@ __argp_fmtstream_update (argp_fmtstream_t fs)
|
||||
the end of the buffer. */
|
||||
nl = fs->p;
|
||||
}
|
||||
else if (fs->point_col + (nl - buf) < fs->rmargin)
|
||||
else if (fs->point_col + (nl - buf) < (ssize_t) fs->rmargin)
|
||||
{
|
||||
/* The buffer contains a full line that fits within the maximum
|
||||
line width. Reset point and scan the next line. */
|
||||
@@ -309,7 +309,7 @@ __argp_fmtstream_update (argp_fmtstream_t fs)
|
||||
int
|
||||
__argp_fmtstream_ensure (struct argp_fmtstream *fs, size_t amount)
|
||||
{
|
||||
if (fs->end - fs->p < amount)
|
||||
if ((size_t) (fs->end - fs->p) < amount)
|
||||
{
|
||||
ssize_t wrote;
|
||||
|
||||
@@ -330,7 +330,7 @@ __argp_fmtstream_ensure (struct argp_fmtstream *fs, size_t amount)
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (fs->end - fs->buf < amount)
|
||||
if ((size_t) (fs->end - fs->buf) < amount)
|
||||
/* Gotta grow the buffer. */
|
||||
{
|
||||
size_t new_size = fs->end - fs->buf + amount;
|
||||
@@ -354,7 +354,7 @@ __argp_fmtstream_ensure (struct argp_fmtstream *fs, size_t amount)
|
||||
ssize_t
|
||||
__argp_fmtstream_printf (struct argp_fmtstream *fs, const char *fmt, ...)
|
||||
{
|
||||
size_t out;
|
||||
int out;
|
||||
size_t size_guess = PRINTF_SIZE_GUESS; /* How much space to reserve. */
|
||||
|
||||
do
|
||||
|
||||
@@ -238,7 +238,7 @@ ARGP_FS_EI size_t
|
||||
__argp_fmtstream_set_lmargin (argp_fmtstream_t __fs, size_t __lmargin)
|
||||
{
|
||||
size_t __old;
|
||||
if (__fs->p - __fs->buf > __fs->point_offs)
|
||||
if ((size_t) (__fs->p - __fs->buf) > __fs->point_offs)
|
||||
__argp_fmtstream_update (__fs);
|
||||
__old = __fs->lmargin;
|
||||
__fs->lmargin = __lmargin;
|
||||
@@ -250,7 +250,7 @@ ARGP_FS_EI size_t
|
||||
__argp_fmtstream_set_rmargin (argp_fmtstream_t __fs, size_t __rmargin)
|
||||
{
|
||||
size_t __old;
|
||||
if (__fs->p - __fs->buf > __fs->point_offs)
|
||||
if ((size_t) (__fs->p - __fs->buf) > __fs->point_offs)
|
||||
__argp_fmtstream_update (__fs);
|
||||
__old = __fs->rmargin;
|
||||
__fs->rmargin = __rmargin;
|
||||
@@ -262,7 +262,7 @@ ARGP_FS_EI size_t
|
||||
__argp_fmtstream_set_wmargin (argp_fmtstream_t __fs, size_t __wmargin)
|
||||
{
|
||||
size_t __old;
|
||||
if (__fs->p - __fs->buf > __fs->point_offs)
|
||||
if ((size_t) (__fs->p - __fs->buf) > __fs->point_offs)
|
||||
__argp_fmtstream_update (__fs);
|
||||
__old = __fs->wmargin;
|
||||
__fs->wmargin = __wmargin;
|
||||
@@ -273,7 +273,7 @@ __argp_fmtstream_set_wmargin (argp_fmtstream_t __fs, size_t __wmargin)
|
||||
ARGP_FS_EI size_t
|
||||
__argp_fmtstream_point (argp_fmtstream_t __fs)
|
||||
{
|
||||
if (__fs->p - __fs->buf > __fs->point_offs)
|
||||
if ((size_t) (__fs->p - __fs->buf) > __fs->point_offs)
|
||||
__argp_fmtstream_update (__fs);
|
||||
return __fs->point_col >= 0 ? __fs->point_col : 0;
|
||||
}
|
||||
|
||||
+7
-7
@@ -156,7 +156,7 @@ fill_in_uparams (const struct argp_state *state)
|
||||
arg++;
|
||||
SKIPWS (arg);
|
||||
}
|
||||
|
||||
|
||||
if (unspec)
|
||||
if (var[0] == 'n' && var[1] == 'o' && var[2] == '-')
|
||||
{
|
||||
@@ -878,7 +878,7 @@ arg (const struct argp_option *real, const char *req_fmt, const char *opt_fmt,
|
||||
/* Helper functions for hol_entry_help. */
|
||||
|
||||
/* State used during the execution of hol_help. */
|
||||
struct hol_help_state
|
||||
struct hol_help_state
|
||||
{
|
||||
/* PREV_ENTRY should contain the previous entry printed, or 0. */
|
||||
struct hol_entry *prev_entry;
|
||||
@@ -1086,14 +1086,14 @@ hol_entry_help (struct hol_entry *entry, const struct argp_state *state,
|
||||
const char *fstr = filter_doc (tstr, real->key, entry->argp, state);
|
||||
if (fstr && *fstr)
|
||||
{
|
||||
unsigned col = __argp_fmtstream_point (stream);
|
||||
unsigned int col = __argp_fmtstream_point (stream);
|
||||
|
||||
__argp_fmtstream_set_lmargin (stream, uparams.opt_doc_col);
|
||||
__argp_fmtstream_set_wmargin (stream, uparams.opt_doc_col);
|
||||
|
||||
if (col > uparams.opt_doc_col + 3)
|
||||
if (col > (unsigned int) (uparams.opt_doc_col + 3))
|
||||
__argp_fmtstream_putc (stream, '\n');
|
||||
else if (col >= uparams.opt_doc_col)
|
||||
else if (col >= (unsigned int) uparams.opt_doc_col)
|
||||
__argp_fmtstream_puts (stream, " ");
|
||||
else
|
||||
indent_to (stream, uparams.opt_doc_col);
|
||||
@@ -1600,7 +1600,7 @@ __argp_state_help (const struct argp_state *state, FILE *stream, unsigned flags)
|
||||
if (!state || ! (state->flags & ARGP_NO_EXIT))
|
||||
{
|
||||
if (flags & ARGP_HELP_EXIT_ERR)
|
||||
exit (1);
|
||||
exit (argp_err_exit_status);
|
||||
if (flags & ARGP_HELP_EXIT_OK)
|
||||
exit (0);
|
||||
}
|
||||
@@ -1612,7 +1612,7 @@ weak_alias (__argp_state_help, argp_state_help)
|
||||
|
||||
/* If appropriate, print the printf string FMT and following args, preceded
|
||||
by the program name and `:', to stderr, and followed by a `Try ... --help'
|
||||
message, then exit (1). */
|
||||
message, then exit (ARGP_ERR_EXIT_STATUS). */
|
||||
void
|
||||
__argp_error (const struct argp_state *state, const char *fmt, ...)
|
||||
{
|
||||
|
||||
@@ -612,6 +612,10 @@ parser_finalize (struct parser *parser,
|
||||
|
||||
if (err == EBADKEY)
|
||||
err = 0; /* Some parser didn't understand. */
|
||||
|
||||
/* Tell the user that all arguments are parsed. */
|
||||
if (end_index)
|
||||
*end_index = parser->state.next;
|
||||
}
|
||||
else if (end_index)
|
||||
/* Return any remaining arguments to the user. */
|
||||
|
||||
+1
-1
@@ -22,4 +22,4 @@
|
||||
--version is added (unless the ARGP_NO_HELP flag is used), which will
|
||||
print this this string followed by a newline and exit (unless the
|
||||
ARGP_NO_EXIT flag is used). Overridden by ARGP_PROGRAM_VERSION_HOOK. */
|
||||
char *argp_program_version = 0;
|
||||
const char *argp_program_version = 0;
|
||||
|
||||
+6
-2
@@ -240,7 +240,7 @@ struct argp
|
||||
TEXT is NULL for this key. */
|
||||
/* Explanatory note emitted when duplicate option arguments have been
|
||||
suppressed. */
|
||||
#define ARGP_KEY_HELP_DUP_ARGS_NOTE 0x2000005
|
||||
#define ARGP_KEY_HELP_DUP_ARGS_NOTE 0x2000005
|
||||
|
||||
/* When an argp has a non-zero CHILDREN field, it should point to a vector of
|
||||
argp_child structures, each of which describes a subsidiary argp. */
|
||||
@@ -379,7 +379,7 @@ extern error_t __argp_parse __P ((__const struct argp *__argp,
|
||||
option --version is added (unless the ARGP_NO_HELP flag is used), which
|
||||
will print this string followed by a newline and exit (unless the
|
||||
ARGP_NO_EXIT flag is used). Overridden by ARGP_PROGRAM_VERSION_HOOK. */
|
||||
extern const char *argp_program_version;
|
||||
extern __const char *argp_program_version;
|
||||
|
||||
/* If defined or set by the user program to a non-zero value, then a default
|
||||
option --version is added (unless the ARGP_NO_HELP flag is used), which
|
||||
@@ -395,6 +395,10 @@ extern void (*argp_program_version_hook) __P ((FILE *__stream,
|
||||
standard help messages), embedded in a sentence that says something like
|
||||
`Report bugs to ADDR.'. */
|
||||
__const extern char *argp_program_bug_address;
|
||||
|
||||
/* The exit status that argp will use when exiting due to a parsing error.
|
||||
If not defined or set by the user program, this defaults to 1. */
|
||||
extern error_t argp_err_exit_status;
|
||||
|
||||
/* Flags for argp_help. */
|
||||
#define ARGP_HELP_USAGE 0x01 /* a Usage: message. */
|
||||
|
||||
+11
-2
@@ -84,8 +84,17 @@ catopen (const char *cat_name, int flag)
|
||||
}
|
||||
|
||||
nlspath = __secure_getenv ("NLSPATH");
|
||||
result->nlspath = __strdup (nlspath != NULL && *nlspath != '\0'
|
||||
? nlspath : 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);
|
||||
|
||||
if (result->nlspath == NULL)
|
||||
{
|
||||
|
||||
+6
-5
@@ -152,6 +152,7 @@ int
|
||||
main (int argc, char *argv[])
|
||||
{
|
||||
struct catalog *result;
|
||||
int remaining;
|
||||
|
||||
/* Set program name for messages. */
|
||||
error_print_progname = error_print;
|
||||
@@ -166,18 +167,18 @@ main (int argc, char *argv[])
|
||||
result = NULL;
|
||||
|
||||
/* Parse and process arguments. */
|
||||
argp_parse (&argp, argc, argv, 0, 0, NULL);
|
||||
argp_parse (&argp, argc, argv, 0, &remaining, NULL);
|
||||
|
||||
/* Determine output file. */
|
||||
if (output_name == NULL)
|
||||
output_name = optind < argc ? argv[optind++] : "-";
|
||||
output_name = remaining < argc ? argv[remaining++] : "-";
|
||||
|
||||
/* Process all input files. */
|
||||
setlocale (LC_CTYPE, "C");
|
||||
if (optind < argc)
|
||||
if (remaining < argc)
|
||||
do
|
||||
result = read_input_file (result, argv[optind]);
|
||||
while (++optind < argc);
|
||||
result = read_input_file (result, argv[remaining]);
|
||||
while (++remaining < argc);
|
||||
else
|
||||
result = read_input_file (NULL, "-");
|
||||
|
||||
|
||||
Vendored
+25
-7
@@ -68,8 +68,20 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
|
||||
echo m68k-cbm-netbsd${UNAME_RELEASE}
|
||||
exit 0 ;;
|
||||
amiga:OpenBSD:*:*)
|
||||
echo m68k-cbm-openbsd${UNAME_RELEASE}
|
||||
exit 0 ;;
|
||||
echo m68k-unknown-openbsd${UNAME_RELEASE}
|
||||
exit 0 ;;
|
||||
arc:OpenBSD:*:*)
|
||||
echo mips64el-unknown-openbsd${UNAME_RELEASE}
|
||||
exit 0 ;;
|
||||
laguna:OpenBSD:*:*)
|
||||
echo mips64-unknown-openbsd${UNAME_RELEASE}
|
||||
exit 0 ;;
|
||||
pmax:OpenBSD:*:*)
|
||||
echo mips64el-unknown-openbsd${UNAME_RELEASE}
|
||||
exit 0 ;;
|
||||
wgrisc:OpenBSD:*:*)
|
||||
echo mips64el-unknown-openbsd${UNAME_RELEASE}
|
||||
exit 0 ;;
|
||||
arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*)
|
||||
echo arm-acorn-riscix${UNAME_RELEASE}
|
||||
exit 0;;
|
||||
@@ -118,19 +130,25 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
|
||||
echo m68k-atari-netbsd${UNAME_RELEASE}
|
||||
exit 0 ;;
|
||||
atari*:OpenBSD:*:*)
|
||||
echo m68k-atari-openbsd${UNAME_RELEASE}
|
||||
echo m68k-unknown-openbsd${UNAME_RELEASE}
|
||||
exit 0 ;;
|
||||
sun3*:NetBSD:*:*)
|
||||
echo m68k-sun-netbsd${UNAME_RELEASE}
|
||||
exit 0 ;;
|
||||
sun3*:OpenBSD:*:*)
|
||||
echo m68k-sun-openbsd${UNAME_RELEASE}
|
||||
echo m68k-unknown-openbsd${UNAME_RELEASE}
|
||||
exit 0 ;;
|
||||
mac68k:NetBSD:*:*)
|
||||
echo m68k-apple-netbsd${UNAME_RELEASE}
|
||||
exit 0 ;;
|
||||
mac68k:OpenBSD:*:*)
|
||||
echo m68k-apple-openbsd${UNAME_RELEASE}
|
||||
echo m68k-unknown-openbsd${UNAME_RELEASE}
|
||||
exit 0 ;;
|
||||
mvme68k:OpenBSD:*:*)
|
||||
echo m68k-unknown-openbsd${UNAME_RELEASE}
|
||||
exit 0 ;;
|
||||
mvme88k:OpenBSD:*:*)
|
||||
echo m88k-unknown-openbsd${UNAME_RELEASE}
|
||||
exit 0 ;;
|
||||
powerpc:machten:*:*)
|
||||
echo powerpc-apple-machten${UNAME_RELEASE}
|
||||
@@ -378,8 +396,8 @@ EOF
|
||||
hp3[0-9][05]:NetBSD:*:*)
|
||||
echo m68k-hp-netbsd${UNAME_RELEASE}
|
||||
exit 0 ;;
|
||||
hp3[0-9][05]:OpenBSD:*:*)
|
||||
echo m68k-hp-openbsd${UNAME_RELEASE}
|
||||
hp300:OpenBSD:*:*)
|
||||
echo m68k-unknown-openbsd${UNAME_RELEASE}
|
||||
exit 0 ;;
|
||||
i?86:BSD/386:*:* | *:BSD/OS:*:*)
|
||||
echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE}
|
||||
|
||||
@@ -43,6 +43,9 @@
|
||||
directive. */
|
||||
#undef HAVE_ASM_POPSECTION_DIRECTIVE
|
||||
|
||||
/* Define if versioning of the library is wanted. */
|
||||
#undef DO_VERSIONING
|
||||
|
||||
/*
|
||||
*/
|
||||
|
||||
|
||||
@@ -26,6 +26,8 @@ defines = @DEFINES@
|
||||
elf = @elf@
|
||||
have-initfini = @libc_cv_have_initfini@
|
||||
|
||||
versioning = @VERSIONING@
|
||||
|
||||
have-no-whole-archive = @libc_cv_ld_no_whole_archive@
|
||||
have-no-exceptions = @libc_cv_gcc_no_exceptions@
|
||||
have-bash2 = @libc_cv_have_bash2@
|
||||
|
||||
@@ -776,7 +776,8 @@ gnu* | linux* | bsd4.4* | netbsd* | freebsd*)
|
||||
gnu_ld=yes gnu_as=yes ;;
|
||||
esac
|
||||
case "$host_os" in
|
||||
linux*ecoff*)
|
||||
# i586-linuxaout is mangled into i586-pc-linux-gnuaout
|
||||
linux*ecoff* | linux*aout* | gnu*aout* | gnu*ecoff*)
|
||||
;;
|
||||
gnu* | linux* | sysv4* | solaris2*)
|
||||
# These systems (almost) always use the ELF format.
|
||||
@@ -793,6 +794,7 @@ os=$config_os
|
||||
case "$machine" in
|
||||
a29k | am29000) base_machine=a29k machine=a29k ;;
|
||||
alpha*) base_machine=alpha machine=alpha/$machine ;;
|
||||
arm*) base_machine=arm machine=arm/$machine ;;
|
||||
hppa*) base_machine=hppa machine=hppa/$machine ;;
|
||||
i[3456]86) base_machine=i386 machine=i386/$machine ;;
|
||||
m680?0) base_machine=m68k machine=m68k/$machine ;;
|
||||
@@ -810,7 +812,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:814: checking sysdep dirs" >&5
|
||||
echo "configure:816: 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'`"
|
||||
|
||||
@@ -1011,7 +1013,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:1015: checking for a BSD compatible install" >&5
|
||||
echo "configure:1017: 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
|
||||
@@ -1065,7 +1067,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:1069: checking whether ln -s works" >&5
|
||||
echo "configure:1071: 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
|
||||
@@ -1090,7 +1092,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:1094: checking for $ac_word" >&5
|
||||
echo "configure:1096: 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
|
||||
@@ -1120,8 +1122,178 @@ done
|
||||
test -n "$MSGFMT" || MSGFMT=":"
|
||||
|
||||
|
||||
# Extract the first word of "gcc", so it can be a program name with args.
|
||||
set dummy gcc; ac_word=$2
|
||||
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
|
||||
echo "configure:1129: 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
|
||||
if test -n "$CC"; then
|
||||
ac_cv_prog_CC="$CC" # Let the user override the test.
|
||||
else
|
||||
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_prog_CC="gcc"
|
||||
break
|
||||
fi
|
||||
done
|
||||
IFS="$ac_save_ifs"
|
||||
fi
|
||||
fi
|
||||
CC="$ac_cv_prog_CC"
|
||||
if test -n "$CC"; then
|
||||
echo "$ac_t""$CC" 1>&6
|
||||
else
|
||||
echo "$ac_t""no" 1>&6
|
||||
fi
|
||||
|
||||
if test -z "$CC"; then
|
||||
# Extract the first word of "cc", so it can be a program name with args.
|
||||
set dummy cc; ac_word=$2
|
||||
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
|
||||
echo "configure:1158: 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
|
||||
if test -n "$CC"; then
|
||||
ac_cv_prog_CC="$CC" # Let the user override the test.
|
||||
else
|
||||
IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
|
||||
ac_prog_rejected=no
|
||||
for ac_dir in $PATH; do
|
||||
test -z "$ac_dir" && ac_dir=.
|
||||
if test -f $ac_dir/$ac_word; then
|
||||
if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then
|
||||
ac_prog_rejected=yes
|
||||
continue
|
||||
fi
|
||||
ac_cv_prog_CC="cc"
|
||||
break
|
||||
fi
|
||||
done
|
||||
IFS="$ac_save_ifs"
|
||||
if test $ac_prog_rejected = yes; then
|
||||
# We found a bogon in the path, so make sure we never use it.
|
||||
set dummy $ac_cv_prog_CC
|
||||
shift
|
||||
if test $# -gt 0; then
|
||||
# We chose a different compiler from the bogus one.
|
||||
# However, it has the same basename, so the bogon will be chosen
|
||||
# first if we set CC to just the basename; use the full file name.
|
||||
shift
|
||||
set dummy "$ac_dir/$ac_word" "$@"
|
||||
shift
|
||||
ac_cv_prog_CC="$@"
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
CC="$ac_cv_prog_CC"
|
||||
if test -n "$CC"; then
|
||||
echo "$ac_t""$CC" 1>&6
|
||||
else
|
||||
echo "$ac_t""no" 1>&6
|
||||
fi
|
||||
|
||||
test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; }
|
||||
fi
|
||||
|
||||
echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6
|
||||
echo "configure:1206: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
|
||||
|
||||
ac_ext=c
|
||||
# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
|
||||
ac_cpp='$CPP $CPPFLAGS'
|
||||
ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
|
||||
ac_link='${CC-cc} -o conftest $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
|
||||
cross_compiling=$ac_cv_prog_cc_cross
|
||||
|
||||
cat > conftest.$ac_ext <<EOF
|
||||
#line 1216 "configure"
|
||||
#include "confdefs.h"
|
||||
main(){return(0);}
|
||||
EOF
|
||||
if { (eval echo configure:1220: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
|
||||
ac_cv_prog_cc_works=yes
|
||||
# If we can't run a trivial program, we are probably using a cross compiler.
|
||||
if (./conftest; exit) 2>/dev/null; then
|
||||
ac_cv_prog_cc_cross=no
|
||||
else
|
||||
ac_cv_prog_cc_cross=yes
|
||||
fi
|
||||
else
|
||||
echo "configure: failed program was:" >&5
|
||||
cat conftest.$ac_ext >&5
|
||||
ac_cv_prog_cc_works=no
|
||||
fi
|
||||
rm -fr conftest*
|
||||
|
||||
echo "$ac_t""$ac_cv_prog_cc_works" 1>&6
|
||||
if test $ac_cv_prog_cc_works = no; then
|
||||
{ echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; }
|
||||
fi
|
||||
echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
|
||||
echo "configure:1240: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
|
||||
echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6
|
||||
cross_compiling=$ac_cv_prog_cc_cross
|
||||
|
||||
echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6
|
||||
echo "configure:1245: checking whether we are using GNU C" >&5
|
||||
if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then
|
||||
echo $ac_n "(cached) $ac_c" 1>&6
|
||||
else
|
||||
cat > conftest.c <<EOF
|
||||
#ifdef __GNUC__
|
||||
yes;
|
||||
#endif
|
||||
EOF
|
||||
if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:1254: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
|
||||
ac_cv_prog_gcc=yes
|
||||
else
|
||||
ac_cv_prog_gcc=no
|
||||
fi
|
||||
fi
|
||||
|
||||
echo "$ac_t""$ac_cv_prog_gcc" 1>&6
|
||||
|
||||
if test $ac_cv_prog_gcc = yes; then
|
||||
GCC=yes
|
||||
ac_test_CFLAGS="${CFLAGS+set}"
|
||||
ac_save_CFLAGS="$CFLAGS"
|
||||
CFLAGS=
|
||||
echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
|
||||
echo "configure:1269: checking whether ${CC-cc} accepts -g" >&5
|
||||
if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then
|
||||
echo $ac_n "(cached) $ac_c" 1>&6
|
||||
else
|
||||
echo 'void f(){}' > conftest.c
|
||||
if test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then
|
||||
ac_cv_prog_cc_g=yes
|
||||
else
|
||||
ac_cv_prog_cc_g=no
|
||||
fi
|
||||
rm -f conftest*
|
||||
|
||||
fi
|
||||
|
||||
echo "$ac_t""$ac_cv_prog_cc_g" 1>&6
|
||||
if test "$ac_test_CFLAGS" = set; then
|
||||
CFLAGS="$ac_save_CFLAGS"
|
||||
elif test $ac_cv_prog_cc_g = yes; then
|
||||
CFLAGS="-g -O2"
|
||||
else
|
||||
CFLAGS="-O2"
|
||||
fi
|
||||
else
|
||||
GCC=
|
||||
test "${CFLAGS+set}" = set || CFLAGS="-g"
|
||||
fi
|
||||
|
||||
echo $ac_n "checking build system type""... $ac_c" 1>&6
|
||||
echo "configure:1125: checking build system type" >&5
|
||||
echo "configure:1297: checking build system type" >&5
|
||||
|
||||
build_alias=$build
|
||||
case "$build_alias" in
|
||||
@@ -1139,47 +1311,12 @@ build_os=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
|
||||
echo "$ac_t""$build" 1>&6
|
||||
|
||||
if test $host != $build; then
|
||||
ac_tool_prefix=${host_alias}-
|
||||
else
|
||||
ac_tool_prefix=
|
||||
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
|
||||
for ac_prog in gcc cc
|
||||
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:1151: 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
|
||||
if test -n "$CC"; then
|
||||
ac_cv_prog_CC="$CC" # Let the user override the test.
|
||||
else
|
||||
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_prog_CC="${ac_tool_prefix}gcc"
|
||||
break
|
||||
fi
|
||||
done
|
||||
IFS="$ac_save_ifs"
|
||||
test -z "$ac_cv_prog_CC" && ac_cv_prog_CC="gcc"
|
||||
fi
|
||||
fi
|
||||
CC="$ac_cv_prog_CC"
|
||||
if test -n "$CC"; then
|
||||
echo "$ac_t""$CC" 1>&6
|
||||
else
|
||||
echo "$ac_t""no" 1>&6
|
||||
fi
|
||||
|
||||
|
||||
|
||||
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:1183: checking for $ac_word" >&5
|
||||
echo "configure:1320: 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
|
||||
@@ -1190,7 +1327,7 @@ else
|
||||
for ac_dir in $PATH; do
|
||||
test -z "$ac_dir" && ac_dir=.
|
||||
if test -f $ac_dir/$ac_word; then
|
||||
ac_cv_prog_BUILD_CC=""
|
||||
ac_cv_prog_BUILD_CC="$ac_prog"
|
||||
break
|
||||
fi
|
||||
done
|
||||
@@ -1204,9 +1341,12 @@ else
|
||||
echo "$ac_t""no" 1>&6
|
||||
fi
|
||||
|
||||
test -n "$BUILD_CC" && break
|
||||
done
|
||||
|
||||
fi
|
||||
echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
|
||||
echo "configure:1210: checking how to run the C preprocessor" >&5
|
||||
echo "configure:1350: checking how to run the C preprocessor" >&5
|
||||
# On Suns, sometimes $CPP names a directory.
|
||||
if test -n "$CPP" && test -d "$CPP"; then
|
||||
CPP=
|
||||
@@ -1221,13 +1361,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 1225 "configure"
|
||||
#line 1365 "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:1231: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
|
||||
{ (eval echo configure:1371: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
|
||||
ac_err=`grep -v '^ *+' conftest.out`
|
||||
if test -z "$ac_err"; then
|
||||
:
|
||||
@@ -1238,13 +1378,13 @@ else
|
||||
rm -rf conftest*
|
||||
CPP="${CC-cc} -E -traditional-cpp"
|
||||
cat > conftest.$ac_ext <<EOF
|
||||
#line 1242 "configure"
|
||||
#line 1382 "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:1248: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
|
||||
{ (eval echo configure:1388: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
|
||||
ac_err=`grep -v '^ *+' conftest.out`
|
||||
if test -z "$ac_err"; then
|
||||
:
|
||||
@@ -1266,10 +1406,16 @@ else
|
||||
fi
|
||||
echo "$ac_t""$CPP" 1>&6
|
||||
|
||||
if test $host != $build; then
|
||||
ac_tool_prefix=${host_alias}-
|
||||
else
|
||||
ac_tool_prefix=
|
||||
fi
|
||||
|
||||
# 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:1273: checking for $ac_word" >&5
|
||||
echo "configure:1419: 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
|
||||
@@ -1300,7 +1446,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:1304: checking for $ac_word" >&5
|
||||
echo "configure:1450: 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
|
||||
@@ -1331,7 +1477,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:1335: checking for $ac_word" >&5
|
||||
echo "configure:1481: 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
|
||||
@@ -1366,7 +1512,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:1370: checking for $ac_word" >&5
|
||||
echo "configure:1516: 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
|
||||
@@ -1407,7 +1553,7 @@ 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:1411: checking for $ac_word" >&5
|
||||
echo "configure:1557: 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
|
||||
@@ -1449,7 +1595,7 @@ fi
|
||||
|
||||
|
||||
echo $ac_n "checking for signed size_t type""... $ac_c" 1>&6
|
||||
echo "configure:1453: checking for signed size_t type" >&5
|
||||
echo "configure:1599: 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
|
||||
@@ -1473,12 +1619,12 @@ EOF
|
||||
fi
|
||||
|
||||
echo $ac_n "checking for libc-friendly stddef.h""... $ac_c" 1>&6
|
||||
echo "configure:1477: checking for libc-friendly stddef.h" >&5
|
||||
echo "configure:1623: 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 1482 "configure"
|
||||
#line 1628 "configure"
|
||||
#include "confdefs.h"
|
||||
#define __need_size_t
|
||||
#define __need_wchar_t
|
||||
@@ -1493,7 +1639,7 @@ size_t size; wchar_t wchar;
|
||||
if (&size == NULL || &wchar == NULL) abort ();
|
||||
; return 0; }
|
||||
EOF
|
||||
if { (eval echo configure:1497: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
|
||||
if { (eval echo configure:1643: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
|
||||
rm -rf conftest*
|
||||
libc_cv_friendly_stddef=yes
|
||||
else
|
||||
@@ -1512,7 +1658,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:1516: checking whether we need to use -P to assemble .S files" >&5
|
||||
echo "configure:1662: 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
|
||||
@@ -1535,7 +1681,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:1539: checking for assembler global-symbol directive" >&5
|
||||
echo "configure:1685: 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
|
||||
@@ -1565,7 +1711,7 @@ EOF
|
||||
fi
|
||||
|
||||
echo $ac_n "checking for .set assembler directive""... $ac_c" 1>&6
|
||||
echo "configure:1569: checking for .set assembler directive" >&5
|
||||
echo "configure:1715: 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
|
||||
@@ -1598,9 +1744,74 @@ EOF
|
||||
|
||||
fi
|
||||
|
||||
echo $ac_n "checking for .symver assembler directive""... $ac_c" 1>&6
|
||||
echo "configure:1749: checking for .symver assembler directive" >&5
|
||||
if eval "test \"`echo '$''{'libc_cv_asm_symver_directive'+set}'`\" = set"; then
|
||||
echo $ac_n "(cached) $ac_c" 1>&6
|
||||
else
|
||||
cat > conftest.s <<EOF
|
||||
.text
|
||||
_sym:
|
||||
.symver _sym,sym@VERS
|
||||
EOF
|
||||
if ${CC-cc} -c $CFLAGS $CPPFLAGS conftest.s 1>&5 2>&5; then
|
||||
libc_cv_asm_symver_directive=yes
|
||||
else
|
||||
libc_cv_asm_symver_directive=no
|
||||
fi
|
||||
rm -f conftest*
|
||||
fi
|
||||
|
||||
echo "$ac_t""$libc_cv_asm_symver_directive" 1>&6
|
||||
echo $ac_n "checking for ld --version-script""... $ac_c" 1>&6
|
||||
echo "configure:1768: checking for ld --version-script" >&5
|
||||
if eval "test \"`echo '$''{'libc_cv_ld_version_script_option'+set}'`\" = set"; then
|
||||
echo $ac_n "(cached) $ac_c" 1>&6
|
||||
else
|
||||
if test $libc_cv_asm_symver_directive = yes; then
|
||||
cat > conftest.s <<EOF
|
||||
.text
|
||||
_sym:
|
||||
.symver _sym,sym@VERS
|
||||
EOF
|
||||
cat > conftest.map <<EOF
|
||||
VERS {
|
||||
global: sym;
|
||||
};
|
||||
EOF
|
||||
if ${CC-cc} -c $CFLAGS $CPPFLAGS conftest.s 1>&5 2>&5; then
|
||||
if { ac_try='${CC-cc} $CFLAGS --shared -o conftest.so conftest.o
|
||||
-Wl,--version-script,conftest.map'; { (eval echo configure:1785: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; };
|
||||
then
|
||||
libc_cv_ld_version_script_option=yes
|
||||
else
|
||||
libc_cv_ld_version_script_option=no
|
||||
fi
|
||||
else
|
||||
libc_cv_ld_version_script_option=no
|
||||
fi
|
||||
else
|
||||
libc_cv_ld_version_script_option=no
|
||||
fi
|
||||
rm -f conftest*
|
||||
fi
|
||||
|
||||
echo "$ac_t""$libc_cv_ld_version_script_option" 1>&6
|
||||
if test $libc_cv_asm_symver_directive = yes &&
|
||||
test $libc_cv_ld_version_script_option = yes; then
|
||||
VERSIONING=yes
|
||||
cat >> confdefs.h <<\EOF
|
||||
#define DO_VERSIONING 1
|
||||
EOF
|
||||
|
||||
else
|
||||
VERSIONING=no
|
||||
fi
|
||||
|
||||
|
||||
if test $elf = yes; then
|
||||
echo $ac_n "checking for .previous assembler directive""... $ac_c" 1>&6
|
||||
echo "configure:1604: checking for .previous assembler directive" >&5
|
||||
echo "configure:1815: 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
|
||||
@@ -1608,7 +1819,7 @@ else
|
||||
.section foo_section
|
||||
.previous
|
||||
EOF
|
||||
if { ac_try='${CC-cc} -c $CFLAGS conftest.s 1>&5'; { (eval echo configure:1612: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; }; then
|
||||
if { ac_try='${CC-cc} -c $CFLAGS conftest.s 1>&5'; { (eval echo configure:1823: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; }; then
|
||||
libc_cv_asm_previous_directive=yes
|
||||
else
|
||||
libc_cv_asm_previous_directive=no
|
||||
@@ -1624,7 +1835,7 @@ EOF
|
||||
|
||||
else
|
||||
echo $ac_n "checking for .popsection assembler directive""... $ac_c" 1>&6
|
||||
echo "configure:1628: checking for .popsection assembler directive" >&5
|
||||
echo "configure:1839: 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
|
||||
@@ -1632,7 +1843,7 @@ else
|
||||
.pushsection foo_section
|
||||
.popsection
|
||||
EOF
|
||||
if { ac_try='${CC-cc} -c $CFLAGS conftest.s 1>&5'; { (eval echo configure:1636: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; }; then
|
||||
if { ac_try='${CC-cc} -c $CFLAGS conftest.s 1>&5'; { (eval echo configure:1847: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; }; then
|
||||
libc_cv_asm_popsection_directive=yes
|
||||
else
|
||||
libc_cv_asm_popsection_directive=no
|
||||
@@ -1652,12 +1863,12 @@ fi
|
||||
|
||||
if test $elf != yes; then
|
||||
echo $ac_n "checking for .init and .fini sections""... $ac_c" 1>&6
|
||||
echo "configure:1656: checking for .init and .fini sections" >&5
|
||||
echo "configure:1867: 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 1661 "configure"
|
||||
#line 1872 "configure"
|
||||
#include "confdefs.h"
|
||||
|
||||
int main() {
|
||||
@@ -1666,7 +1877,7 @@ asm (".section .init");
|
||||
asm (".text");
|
||||
; return 0; }
|
||||
EOF
|
||||
if { (eval echo configure:1670: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
|
||||
if { (eval echo configure:1881: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
|
||||
rm -rf conftest*
|
||||
libc_cv_have_initfini=yes
|
||||
else
|
||||
@@ -1691,19 +1902,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:1695: checking for _ prefix on C symbol names" >&5
|
||||
echo "configure:1906: 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 1700 "configure"
|
||||
#line 1911 "configure"
|
||||
#include "confdefs.h"
|
||||
asm ("_glibc_foobar:");
|
||||
int main() {
|
||||
glibc_foobar ();
|
||||
; return 0; }
|
||||
EOF
|
||||
if { (eval echo configure:1707: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
|
||||
if { (eval echo configure:1918: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
|
||||
rm -rf conftest*
|
||||
libc_cv_asm_underscores=yes
|
||||
else
|
||||
@@ -1730,7 +1941,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:1734: checking for assembler .weak directive" >&5
|
||||
echo "configure:1945: 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
|
||||
@@ -1753,7 +1964,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:1757: checking for assembler .weakext directive" >&5
|
||||
echo "configure:1968: 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
|
||||
@@ -1790,7 +2001,7 @@ EOF
|
||||
fi
|
||||
|
||||
echo $ac_n "checking for ld --no-whole-archive""... $ac_c" 1>&6
|
||||
echo "configure:1794: checking for ld --no-whole-archive" >&5
|
||||
echo "configure:2005: 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
|
||||
@@ -1801,7 +2012,7 @@ __throw () {}
|
||||
EOF
|
||||
if { ac_try='${CC-cc} $CFLAGS
|
||||
-nostdlib -nostartfiles -Wl,--no-whole-archive
|
||||
-o conftest conftest.c'; { (eval echo configure:1805: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; }; then
|
||||
-o conftest conftest.c'; { (eval echo configure:2016: \"$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
|
||||
@@ -1812,7 +2023,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:1816: checking for gcc -fno-exceptions" >&5
|
||||
echo "configure:2027: 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
|
||||
@@ -1823,7 +2034,7 @@ __throw () {}
|
||||
EOF
|
||||
if { ac_try='${CC-cc} $CFLAGS
|
||||
-nostdlib -nostartfiles -fno-exceptions
|
||||
-o conftest conftest.c'; { (eval echo configure:1827: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; }; then
|
||||
-o conftest conftest.c'; { (eval echo configure:2038: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; }; then
|
||||
libc_cv_gcc_no_exceptions=yes
|
||||
else
|
||||
libc_cv_gcc_no_exceptions=no
|
||||
@@ -1875,7 +2086,7 @@ if test "$uname" = generic; then
|
||||
fi
|
||||
|
||||
echo $ac_n "checking OS release for uname""... $ac_c" 1>&6
|
||||
echo "configure:1879: checking OS release for uname" >&5
|
||||
echo "configure:2090: 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
|
||||
@@ -1897,7 +2108,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:1901: checking OS version for uname" >&5
|
||||
echo "configure:2112: 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
|
||||
@@ -1919,7 +2130,7 @@ else
|
||||
fi
|
||||
|
||||
echo $ac_n "checking stdio selection""... $ac_c" 1>&6
|
||||
echo "configure:1923: checking stdio selection" >&5
|
||||
echo "configure:2134: checking stdio selection" >&5
|
||||
|
||||
case $stdio in
|
||||
libio) cat >> confdefs.h <<\EOF
|
||||
@@ -2004,7 +2215,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 | grep ac_space) 2>&1` in
|
||||
case `(ac_space=' '; set) 2>&1` in
|
||||
*ac_space=\ *)
|
||||
# `set' does not quote correctly, so add quotes (double-quote substitution
|
||||
# turns \\\\ into \\, and sed turns \\ into \).
|
||||
@@ -2124,12 +2335,12 @@ s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g
|
||||
s%@INSTALL_DATA@%$INSTALL_DATA%g
|
||||
s%@LN_S@%$LN_S%g
|
||||
s%@MSGFMT@%$MSGFMT%g
|
||||
s%@CC@%$CC%g
|
||||
s%@build@%$build%g
|
||||
s%@build_alias@%$build_alias%g
|
||||
s%@build_cpu@%$build_cpu%g
|
||||
s%@build_vendor@%$build_vendor%g
|
||||
s%@build_os@%$build_os%g
|
||||
s%@CC@%$CC%g
|
||||
s%@BUILD_CC@%$BUILD_CC%g
|
||||
s%@CPP@%$CPP%g
|
||||
s%@AR@%$AR%g
|
||||
@@ -2138,6 +2349,7 @@ 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%@VERSIONING@%$VERSIONING%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
|
||||
|
||||
+54
-3
@@ -119,7 +119,8 @@ gnu* | linux* | bsd4.4* | netbsd* | freebsd*)
|
||||
gnu_ld=yes gnu_as=yes ;;
|
||||
esac
|
||||
case "$host_os" in
|
||||
linux*ecoff*)
|
||||
# i586-linuxaout is mangled into i586-pc-linux-gnuaout
|
||||
linux*ecoff* | linux*aout* | gnu*aout* | gnu*ecoff*)
|
||||
;;
|
||||
gnu* | linux* | sysv4* | solaris2*)
|
||||
# These systems (almost) always use the ELF format.
|
||||
@@ -138,6 +139,7 @@ changequote(,)dnl
|
||||
case "$machine" in
|
||||
a29k | am29000) base_machine=a29k machine=a29k ;;
|
||||
alpha*) base_machine=alpha machine=alpha/$machine ;;
|
||||
arm*) base_machine=arm machine=arm/$machine ;;
|
||||
hppa*) base_machine=hppa machine=hppa/$machine ;;
|
||||
i[3456]86) base_machine=i386 machine=i386/$machine ;;
|
||||
m680?0) base_machine=m68k machine=m68k/$machine ;;
|
||||
@@ -359,9 +361,10 @@ fi
|
||||
AC_PROG_LN_S
|
||||
AC_CHECK_PROGS(MSGFMT, msgfmt gmsgfmt, :)
|
||||
|
||||
AC_CHECK_TOOL(CC, gcc)
|
||||
AC_PROG_CC
|
||||
AC_CANONICAL_BUILD
|
||||
if test $host != $build; then
|
||||
AC_CHECK_PROG(BUILD_CC, gcc cc)
|
||||
AC_CHECK_PROGS(BUILD_CC, gcc cc)
|
||||
fi
|
||||
AC_PROG_CPP
|
||||
AC_CHECK_TOOL(AR, ar)
|
||||
@@ -489,6 +492,54 @@ if test $libc_cv_asm_set_directive = yes; then
|
||||
AC_DEFINE(HAVE_ASM_SET_DIRECTIVE)
|
||||
fi
|
||||
|
||||
AC_CACHE_CHECK(for .symver assembler directive, libc_cv_asm_symver_directive,
|
||||
[cat > conftest.s <<EOF
|
||||
.text
|
||||
_sym:
|
||||
.symver _sym,sym@VERS
|
||||
EOF
|
||||
if ${CC-cc} -c $CFLAGS $CPPFLAGS conftest.s 1>&AC_FD_CC 2>&AC_FD_CC; then
|
||||
libc_cv_asm_symver_directive=yes
|
||||
else
|
||||
libc_cv_asm_symver_directive=no
|
||||
fi
|
||||
rm -f conftest*])
|
||||
AC_CACHE_CHECK(for ld --version-script, libc_cv_ld_version_script_option, [dnl
|
||||
if test $libc_cv_asm_symver_directive = yes; then
|
||||
cat > conftest.s <<EOF
|
||||
.text
|
||||
_sym:
|
||||
.symver _sym,sym@VERS
|
||||
EOF
|
||||
cat > conftest.map <<EOF
|
||||
VERS {
|
||||
global: sym;
|
||||
};
|
||||
EOF
|
||||
if ${CC-cc} -c $CFLAGS $CPPFLAGS conftest.s 1>&AC_FD_CC 2>&AC_FD_CC; then
|
||||
if AC_TRY_COMMAND([${CC-cc} $CFLAGS --shared -o conftest.so conftest.o
|
||||
-Wl,--version-script,conftest.map]);
|
||||
then
|
||||
libc_cv_ld_version_script_option=yes
|
||||
else
|
||||
libc_cv_ld_version_script_option=no
|
||||
fi
|
||||
else
|
||||
libc_cv_ld_version_script_option=no
|
||||
fi
|
||||
else
|
||||
libc_cv_ld_version_script_option=no
|
||||
fi
|
||||
rm -f conftest*])
|
||||
if test $libc_cv_asm_symver_directive = yes &&
|
||||
test $libc_cv_ld_version_script_option = yes; then
|
||||
VERSIONING=yes
|
||||
AC_DEFINE(DO_VERSIONING)
|
||||
else
|
||||
VERSIONING=no
|
||||
fi
|
||||
AC_SUBST(VERSIONING)
|
||||
|
||||
if test $elf = yes; then
|
||||
AC_CACHE_CHECK(for .previous assembler directive,
|
||||
libc_cv_asm_previous_directive, [dnl
|
||||
|
||||
@@ -4,3 +4,4 @@
|
||||
TODO COPYING* AUTHORS copyr-* copying.*
|
||||
glibc-*
|
||||
distinfo
|
||||
specs
|
||||
|
||||
@@ -43,6 +43,18 @@
|
||||
|
||||
#include <mpool.h>
|
||||
|
||||
#ifdef _LIBC
|
||||
/* In the GNU C library we must not pollute the namespace because libdb is
|
||||
needed by libnss_db. */
|
||||
#define mpool_open __mpool_open
|
||||
#define mpool_filter __mpool_filter
|
||||
#define mpool_new __mpool_new
|
||||
#define mpool_get __mpool_get
|
||||
#define mpool_put __mpool_put
|
||||
#define mpool_sync __mpool_sync
|
||||
#define mpool_close __mpool_close
|
||||
#endif
|
||||
|
||||
#define DEFMINKEYPAGE (2) /* Minimum keys per page */
|
||||
#define MINCACHE (5) /* Minimum cached pages */
|
||||
#define MINPSIZE (512) /* Minimum page size */
|
||||
|
||||
@@ -224,6 +224,7 @@ typedef struct {
|
||||
#endif
|
||||
|
||||
__BEGIN_DECLS
|
||||
DB *__dbopen __P((const char *, int, int, DBTYPE, const void *));
|
||||
DB *dbopen __P((const char *, int, int, DBTYPE, const void *));
|
||||
|
||||
#ifdef __DBINTERFACE_PRIVATE
|
||||
|
||||
+10
@@ -44,6 +44,12 @@ static char sccsid[] = "@(#)db.c 8.4 (Berkeley) 2/21/94";
|
||||
|
||||
#include <db.h>
|
||||
|
||||
#ifdef _LIBC
|
||||
/* In the GNU C library we must not pollute the namespace, because libdb
|
||||
is needed by libnss_db. */
|
||||
#define dbopen __dbopen
|
||||
#endif
|
||||
|
||||
DB *
|
||||
dbopen(fname, flags, mode, type, openinfo)
|
||||
const char *fname;
|
||||
@@ -72,6 +78,10 @@ dbopen(fname, flags, mode, type, openinfo)
|
||||
errno = EINVAL;
|
||||
return (NULL);
|
||||
}
|
||||
#ifdef _LIBC
|
||||
#undef dbopen
|
||||
weak_alias (__dbopen, dbopen)
|
||||
#endif
|
||||
|
||||
static int
|
||||
__dberr __P((void))
|
||||
|
||||
@@ -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--;
|
||||
|
||||
+7
-6
@@ -99,6 +99,7 @@ main (argc, argv)
|
||||
FILE *input_file;
|
||||
DB *db_file;
|
||||
int status;
|
||||
int remaining;
|
||||
|
||||
/* Set locale via LC_ALL. */
|
||||
setlocale (LC_ALL, "");
|
||||
@@ -110,27 +111,27 @@ main (argc, argv)
|
||||
input_name = NULL;
|
||||
|
||||
/* Parse and process arguments. */
|
||||
argp_parse (&argp, argc, argv, 0, 0, NULL);
|
||||
argp_parse (&argp, argc, argv, 0, &remaining, NULL);
|
||||
|
||||
/* Determine file names. */
|
||||
if (do_undo || output_name != NULL)
|
||||
{
|
||||
if (optind + 1 != argc)
|
||||
if (remaining + 1 != argc)
|
||||
{
|
||||
wrong_arguments:
|
||||
error (0, 0, gettext ("wrong number of arguments"));
|
||||
argp_help (&argp, stdout, ARGP_HELP_SEE,
|
||||
program_invocation_short_name);
|
||||
}
|
||||
input_name = argv[optind];
|
||||
input_name = argv[remaining];
|
||||
}
|
||||
else
|
||||
{
|
||||
if (optind + 2 != argc)
|
||||
if (remaining + 2 != argc)
|
||||
goto wrong_arguments;
|
||||
|
||||
input_name = argv[optind++];
|
||||
output_name = argv[optind];
|
||||
input_name = argv[remaining++];
|
||||
output_name = argv[remaining];
|
||||
}
|
||||
|
||||
/* Special handling if we are asked to print the database. */
|
||||
|
||||
@@ -85,13 +85,21 @@ typedef struct MPOOL {
|
||||
} MPOOL;
|
||||
|
||||
__BEGIN_DECLS
|
||||
MPOOL *__mpool_open __P((void *, int, pgno_t, pgno_t));
|
||||
MPOOL *mpool_open __P((void *, int, pgno_t, pgno_t));
|
||||
void __mpool_filter __P((MPOOL *, void (*)(void *, pgno_t, void *),
|
||||
void (*)(void *, pgno_t, void *), void *));
|
||||
void mpool_filter __P((MPOOL *, void (*)(void *, pgno_t, void *),
|
||||
void (*)(void *, pgno_t, void *), void *));
|
||||
void *__mpool_new __P((MPOOL *, pgno_t *));
|
||||
void *mpool_new __P((MPOOL *, pgno_t *));
|
||||
void *__mpool_get __P((MPOOL *, pgno_t, u_int));
|
||||
void *mpool_get __P((MPOOL *, pgno_t, u_int));
|
||||
int __mpool_put __P((MPOOL *, void *, u_int));
|
||||
int mpool_put __P((MPOOL *, void *, u_int));
|
||||
int __mpool_sync __P((MPOOL *));
|
||||
int mpool_sync __P((MPOOL *));
|
||||
int __mpool_close __P((MPOOL *));
|
||||
int mpool_close __P((MPOOL *));
|
||||
#ifdef STATISTICS
|
||||
void mpool_stat __P((MPOOL *));
|
||||
|
||||
@@ -50,6 +50,18 @@ static char sccsid[] = "@(#)mpool.c 8.5 (Berkeley) 7/26/94";
|
||||
#define __MPOOLINTERFACE_PRIVATE
|
||||
#include <mpool.h>
|
||||
|
||||
#ifdef _LIBC
|
||||
/* In the GNU C library we must not pollute the namespace because libdb is
|
||||
needed by libnss_db. */
|
||||
#define mpool_open __mpool_open
|
||||
#define mpool_filter __mpool_filter
|
||||
#define mpool_new __mpool_new
|
||||
#define mpool_get __mpool_get
|
||||
#define mpool_put __mpool_put
|
||||
#define mpool_sync __mpool_sync
|
||||
#define mpool_close __mpool_close
|
||||
#endif
|
||||
|
||||
static BKT *mpool_bkt __P((MPOOL *));
|
||||
static BKT *mpool_look __P((MPOOL *, pgno_t));
|
||||
static int mpool_write __P((MPOOL *, BKT *));
|
||||
@@ -301,6 +313,23 @@ mpool_sync(mp)
|
||||
return (fsync(mp->fd) ? RET_ERROR : RET_SUCCESS);
|
||||
}
|
||||
|
||||
#ifdef _LIBC
|
||||
#undef mpool_open
|
||||
#undef mpool_filter
|
||||
#undef mpool_new
|
||||
#undef mpool_get
|
||||
#undef mpool_put
|
||||
#undef mpool_close
|
||||
#undef mpool_sync
|
||||
weak_alias (__mpool_open, mpool_open)
|
||||
weak_alias (__mpool_filter, mpool_filter)
|
||||
weak_alias (__mpool_new, mpool_new)
|
||||
weak_alias (__mpool_get, mpool_get)
|
||||
weak_alias (__mpool_put, mpool_put)
|
||||
weak_alias (__mpool_close, mpool_close)
|
||||
weak_alias (__mpool_sync, mpool_sync)
|
||||
#endif
|
||||
|
||||
/*
|
||||
* mpool_bkt
|
||||
* Get a page from the cache (or create one).
|
||||
|
||||
+2
-2
@@ -22,6 +22,6 @@
|
||||
int
|
||||
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);
|
||||
}
|
||||
|
||||
+31
-14
@@ -22,6 +22,29 @@
|
||||
#include <dlfcn.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
struct openaux_args
|
||||
{
|
||||
/* The arguments to openaux. */
|
||||
struct link_map *map;
|
||||
int trace_mode;
|
||||
const char *strtab;
|
||||
ElfW(Dyn) *d;
|
||||
|
||||
/* The return value of openaux. */
|
||||
struct link_map *aux;
|
||||
};
|
||||
|
||||
static void
|
||||
openaux (void *a)
|
||||
{
|
||||
struct openaux_args *args = (struct openaux_args *) a;
|
||||
|
||||
args->aux = _dl_map_object (args->map, args->strtab + args->d->d_un.d_val,
|
||||
(args->map->l_type == lt_executable
|
||||
? lt_library : args->map->l_type),
|
||||
args->trace_mode);
|
||||
}
|
||||
|
||||
void
|
||||
_dl_map_object_deps (struct link_map *map,
|
||||
struct link_map **preloads, unsigned int npreloads,
|
||||
@@ -75,27 +98,21 @@ _dl_map_object_deps (struct link_map *map,
|
||||
/* 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
|
||||
struct openaux_args args;
|
||||
args.strtab
|
||||
= ((void *) map->l_addr + map->l_info[DT_STRTAB]->d_un.d_ptr);
|
||||
ElfW(Dyn) *d;
|
||||
args.map = map;
|
||||
args.trace_mode = trace_mode;
|
||||
|
||||
for (d = map->l_ld; d->d_tag != DT_NULL; ++d)
|
||||
if (d->d_tag == DT_AUXILIARY)
|
||||
for (args.d = map->l_ld; args.d->d_tag != DT_NULL; ++args.d)
|
||||
if (args.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))
|
||||
if (! _dl_catch_error (&errstring, &objname, openaux, &args))
|
||||
/* The auxiliary object is actually there. Use it as
|
||||
the first search element, even before MAP itself. */
|
||||
preload (aux);
|
||||
preload (args.aux);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+12
-6
@@ -85,19 +85,25 @@ _dl_signal_error (int errcode,
|
||||
int
|
||||
_dl_catch_error (char **errstring,
|
||||
const char **objname,
|
||||
void (*operate) (void))
|
||||
void (*operate) (void *),
|
||||
void *args)
|
||||
{
|
||||
int errcode;
|
||||
struct catch *old, c = { errstring: NULL, objname: NULL };
|
||||
/* We need not handle `receiver' since setting a `catch' is handle
|
||||
struct catch *old, c;
|
||||
/* We need not handle `receiver' since setting a `catch' is handled
|
||||
before it. */
|
||||
|
||||
/* Some systems (.e.g, SPARC) handle constructors to local variables
|
||||
inefficient. So we initialize `c' by hand. */
|
||||
c.errstring = NULL;
|
||||
c.objname = NULL;
|
||||
|
||||
old = catch;
|
||||
errcode = setjmp (c.env);
|
||||
if (errcode == 0)
|
||||
{
|
||||
catch = &c;
|
||||
(*operate) ();
|
||||
(*operate) (args);
|
||||
catch = old;
|
||||
*errstring = NULL;
|
||||
*objname = NULL;
|
||||
@@ -112,7 +118,7 @@ _dl_catch_error (char **errstring,
|
||||
}
|
||||
|
||||
void
|
||||
_dl_receive_error (receiver_fct fct, void (*operate) (void))
|
||||
_dl_receive_error (receiver_fct fct, void (*operate) (void *), void *args)
|
||||
{
|
||||
struct catch *old_catch;
|
||||
receiver_fct old_receiver;
|
||||
@@ -124,7 +130,7 @@ _dl_receive_error (receiver_fct fct, void (*operate) (void))
|
||||
catch = NULL;
|
||||
receiver = fct;
|
||||
|
||||
(*operate) ();
|
||||
(*operate) (args);
|
||||
|
||||
catch = old_catch;
|
||||
receiver = old_receiver;
|
||||
|
||||
+27
-4
@@ -67,6 +67,18 @@ int _dl_zerofd = -1;
|
||||
#define ANONFD _dl_zerofd
|
||||
#endif
|
||||
|
||||
/* Handle situations where we have a preferred location in memory for
|
||||
the shared objects. */
|
||||
#ifdef ELF_PREFERRED_ADDRESS_DATA
|
||||
ELF_PREFERRED_ADDRESS_DATA;
|
||||
#endif
|
||||
#ifndef ELF_PREFERRED_ADDRESS
|
||||
#define ELF_PREFERRED_ADDRESS(loader, maplength, mapstartpref) (mapstartpref)
|
||||
#endif
|
||||
#ifndef ELF_FIXED_ADDRESS
|
||||
#define ELF_FIXED_ADDRESS(loader, mapstart) ((void) 0)
|
||||
#endif
|
||||
|
||||
size_t _dl_pagesize;
|
||||
|
||||
|
||||
@@ -315,11 +327,16 @@ _dl_map_object_from_fd (char *name, int fd, char *realname,
|
||||
So we map the first segment without MAP_FIXED, but with its
|
||||
extent increased to cover all the segments. Then we remove
|
||||
access from excess portion, and there is known sufficient space
|
||||
there to remap from the later segments. */
|
||||
there to remap from the later segments.
|
||||
|
||||
As a refinement, sometimes we have an address that we would
|
||||
prefer to map such objects at; but this is only a preference,
|
||||
the OS can do whatever it likes. */
|
||||
caddr_t mapat;
|
||||
mapat = map_segment (c->mapstart,
|
||||
loadcmds[nloadcmds - 1].allocend - c->mapstart,
|
||||
c->prot, 0, c->mapoff);
|
||||
ElfW(Addr) mappref;
|
||||
size_t maplength = loadcmds[nloadcmds - 1].allocend - c->mapstart;
|
||||
mappref = ELF_PREFERRED_ADDRESS (loader, maplength, c->mapstart);
|
||||
mapat = map_segment (mappref, maplength, c->prot, 0, c->mapoff);
|
||||
l->l_addr = (ElfW(Addr)) mapat - c->mapstart;
|
||||
|
||||
/* Change protection on the excess portion to disallow all access;
|
||||
@@ -332,6 +349,12 @@ _dl_map_object_from_fd (char *name, int fd, char *realname,
|
||||
0);
|
||||
goto postmap;
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Notify ELF_PREFERRED_ADDRESS that we have to load this one
|
||||
fixed. */
|
||||
ELF_FIXED_ADDRESS (loader, c->mapstart);
|
||||
}
|
||||
|
||||
while (c < &loadcmds[nloadcmds])
|
||||
{
|
||||
|
||||
+26
-28
@@ -22,7 +22,8 @@
|
||||
#include <assert.h>
|
||||
#include <string.h>
|
||||
|
||||
#include <dl-hash.h>
|
||||
#include "dl-hash.h"
|
||||
#include <dl-machine.h>
|
||||
#include "../stdio-common/_itoa.h"
|
||||
|
||||
#define VERSTAG(tag) (DT_NUM + DT_PROCNUM + DT_VERSIONTAGIDX (tag))
|
||||
@@ -57,10 +58,10 @@ struct sym_val
|
||||
something bad happened. */
|
||||
static inline int
|
||||
do_lookup (const char *undef_name, unsigned long int hash,
|
||||
const ElfW(Sym) **ref, struct sym_val *result,
|
||||
const ElfW(Sym) *ref, struct sym_val *result,
|
||||
struct link_map *list[], size_t i, size_t n,
|
||||
const char *reference_name, const struct r_found_version *version,
|
||||
struct link_map *skip, int flags)
|
||||
struct link_map *skip, int reloc_type)
|
||||
{
|
||||
struct link_map *map;
|
||||
|
||||
@@ -78,7 +79,8 @@ do_lookup (const char *undef_name, unsigned long int hash,
|
||||
continue;
|
||||
|
||||
/* Don't search the executable when resolving a copy reloc. */
|
||||
if (flags & DL_LOOKUP_NOEXEC && map->l_type == lt_executable)
|
||||
if (elf_machine_lookup_noexec_p (reloc_type) &&
|
||||
map->l_type == lt_executable)
|
||||
continue;
|
||||
|
||||
symtab = ((void *) map->l_addr + map->l_info[DT_SYMTAB]->d_un.d_ptr);
|
||||
@@ -98,7 +100,7 @@ do_lookup (const char *undef_name, unsigned long int hash,
|
||||
const ElfW(Sym) *sym = &symtab[symidx];
|
||||
|
||||
if (sym->st_value == 0 || /* No value. */
|
||||
((flags & DL_LOOKUP_NOPLT) != 0 /* Reject PLT entry. */
|
||||
(elf_machine_lookup_noplt_p (reloc_type) /* Reject PLT entry. */
|
||||
&& sym->st_shndx == SHN_UNDEF))
|
||||
continue;
|
||||
|
||||
@@ -113,7 +115,7 @@ do_lookup (const char *undef_name, unsigned long int hash,
|
||||
continue;
|
||||
}
|
||||
|
||||
if (sym != *ref && strcmp (strtab + sym->st_name, undef_name))
|
||||
if (sym != ref && strcmp (strtab + sym->st_name, undef_name))
|
||||
/* Not the symbol we are looking for. */
|
||||
continue;
|
||||
|
||||
@@ -188,16 +190,13 @@ do_lookup (const char *undef_name, unsigned long int hash,
|
||||
}
|
||||
|
||||
/* Search loaded objects' symbol tables for a definition of the symbol
|
||||
UNDEF_NAME. FLAGS is a set of flags. If DL_LOOKUP_NOEXEC is set,
|
||||
then don't search the executable for a definition; this used for
|
||||
copy relocs. If DL_LOOKUP_NOPLT is set, then a PLT entry cannot
|
||||
satisfy the reference; some different binding must be found. */
|
||||
UNDEF_NAME. */
|
||||
|
||||
ElfW(Addr)
|
||||
_dl_lookup_symbol (const char *undef_name, const ElfW(Sym) **ref,
|
||||
struct link_map *symbol_scope[],
|
||||
const char *reference_name,
|
||||
int flags)
|
||||
int reloc_type)
|
||||
{
|
||||
const unsigned long int hash = _dl_elf_hash (undef_name);
|
||||
struct sym_val current_value = { 0, NULL };
|
||||
@@ -205,9 +204,9 @@ _dl_lookup_symbol (const char *undef_name, const ElfW(Sym) **ref,
|
||||
|
||||
/* Search the relevant loaded objects for a definition. */
|
||||
for (scope = symbol_scope; *scope; ++scope)
|
||||
if (do_lookup (undef_name, hash, ref, ¤t_value,
|
||||
if (do_lookup (undef_name, hash, *ref, ¤t_value,
|
||||
(*scope)->l_searchlist, 0, (*scope)->l_nsearchlist,
|
||||
reference_name, NULL, NULL, flags))
|
||||
reference_name, NULL, NULL, reloc_type))
|
||||
break;
|
||||
|
||||
if (current_value.s == NULL &&
|
||||
@@ -230,8 +229,7 @@ ElfW(Addr)
|
||||
_dl_lookup_symbol_skip (const char *undef_name, const ElfW(Sym) **ref,
|
||||
struct link_map *symbol_scope[],
|
||||
const char *reference_name,
|
||||
struct link_map *skip_map,
|
||||
int flags)
|
||||
struct link_map *skip_map)
|
||||
{
|
||||
const unsigned long int hash = _dl_elf_hash (undef_name);
|
||||
struct sym_val current_value = { 0, NULL };
|
||||
@@ -243,13 +241,13 @@ _dl_lookup_symbol_skip (const char *undef_name, const ElfW(Sym) **ref,
|
||||
for (i = 0; (*scope)->l_dupsearchlist[i] != skip_map; ++i)
|
||||
assert (i < (*scope)->l_ndupsearchlist);
|
||||
|
||||
if (! do_lookup (undef_name, hash, ref, ¤t_value,
|
||||
if (! do_lookup (undef_name, hash, *ref, ¤t_value,
|
||||
(*scope)->l_dupsearchlist, i, (*scope)->l_ndupsearchlist,
|
||||
reference_name, NULL, skip_map, flags))
|
||||
reference_name, NULL, skip_map, 0))
|
||||
while (*++scope)
|
||||
if (do_lookup (undef_name, hash, ref, ¤t_value,
|
||||
if (do_lookup (undef_name, hash, *ref, ¤t_value,
|
||||
(*scope)->l_dupsearchlist, 0, (*scope)->l_ndupsearchlist,
|
||||
reference_name, NULL, skip_map, flags))
|
||||
reference_name, NULL, skip_map, 0))
|
||||
break;
|
||||
|
||||
*ref = current_value.s;
|
||||
@@ -266,7 +264,8 @@ ElfW(Addr)
|
||||
_dl_lookup_versioned_symbol (const char *undef_name, const ElfW(Sym) **ref,
|
||||
struct link_map *symbol_scope[],
|
||||
const char *reference_name,
|
||||
const struct r_found_version *version, int flags)
|
||||
const struct r_found_version *version,
|
||||
int reloc_type)
|
||||
{
|
||||
const unsigned long int hash = _dl_elf_hash (undef_name);
|
||||
struct sym_val current_value = { 0, NULL };
|
||||
@@ -275,9 +274,9 @@ _dl_lookup_versioned_symbol (const char *undef_name, const ElfW(Sym) **ref,
|
||||
/* Search the relevant loaded objects for a definition. */
|
||||
for (scope = symbol_scope; *scope; ++scope)
|
||||
{
|
||||
int res = do_lookup (undef_name, hash, ref, ¤t_value,
|
||||
int res = do_lookup (undef_name, hash, *ref, ¤t_value,
|
||||
(*scope)->l_searchlist, 0, (*scope)->l_nsearchlist,
|
||||
reference_name, version, NULL, flags);
|
||||
reference_name, version, NULL, reloc_type);
|
||||
if (res > 0)
|
||||
break;
|
||||
|
||||
@@ -312,8 +311,7 @@ _dl_lookup_versioned_symbol_skip (const char *undef_name,
|
||||
struct link_map *symbol_scope[],
|
||||
const char *reference_name,
|
||||
const struct r_found_version *version,
|
||||
struct link_map *skip_map,
|
||||
int flags)
|
||||
struct link_map *skip_map)
|
||||
{
|
||||
const unsigned long int hash = _dl_elf_hash (undef_name);
|
||||
struct sym_val current_value = { 0, NULL };
|
||||
@@ -325,13 +323,13 @@ _dl_lookup_versioned_symbol_skip (const char *undef_name,
|
||||
for (i = 0; (*scope)->l_dupsearchlist[i] != skip_map; ++i)
|
||||
assert (i < (*scope)->l_ndupsearchlist);
|
||||
|
||||
if (! do_lookup (undef_name, hash, ref, ¤t_value,
|
||||
if (! do_lookup (undef_name, hash, *ref, ¤t_value,
|
||||
(*scope)->l_dupsearchlist, i, (*scope)->l_ndupsearchlist,
|
||||
reference_name, version, skip_map, flags))
|
||||
reference_name, version, skip_map, 0))
|
||||
while (*++scope)
|
||||
if (do_lookup (undef_name, hash, ref, ¤t_value,
|
||||
if (do_lookup (undef_name, hash, *ref, ¤t_value,
|
||||
(*scope)->l_dupsearchlist, 0, (*scope)->l_ndupsearchlist,
|
||||
reference_name, version, skip_map, flags))
|
||||
reference_name, version, skip_map, 0))
|
||||
break;
|
||||
|
||||
*ref = current_value.s;
|
||||
|
||||
+12
-1
@@ -1,5 +1,5 @@
|
||||
/* Minimal replacements for basic facilities used in the 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
|
||||
@@ -77,6 +77,17 @@ malloc (size_t n)
|
||||
return alloc_last_block;
|
||||
}
|
||||
|
||||
/* We use this function occasionally since the real implementation may
|
||||
be optimized when it can assume the memory it returns already is
|
||||
set to NUL. */
|
||||
void * weak_function
|
||||
calloc (size_t nmemb, size_t size)
|
||||
{
|
||||
size_t total = nmemb * size;
|
||||
void *result = malloc (total);
|
||||
return memset (result, '\0', total);
|
||||
}
|
||||
|
||||
/* This will rarely be called. */
|
||||
void weak_function
|
||||
free (void *ptr)
|
||||
|
||||
@@ -153,7 +153,11 @@ fixup (
|
||||
*_dl_global_scope_end = NULL;
|
||||
|
||||
/* Return the address that was written by the relocation. */
|
||||
#ifdef ELF_FIXUP_RETURNS_ADDRESS
|
||||
return (ElfW(Addr))(l->l_addr + reloc->r_offset);
|
||||
#else
|
||||
return *(ElfW(Addr) *) (l->l_addr + reloc->r_offset);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
|
||||
+2
-2
@@ -1,5 +1,5 @@
|
||||
/* Support for dynamic linking code in static libc.
|
||||
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
|
||||
@@ -62,7 +62,7 @@ _dl_sysdep_read_whole_file (const char *file, size_t *sizep, int prot)
|
||||
int fd = __open (file, O_RDONLY);
|
||||
if (fd < 0)
|
||||
return NULL;
|
||||
if (__fstat (fd, &st) < 0)
|
||||
if (__fxstat (_STAT_VER, fd, &st) < 0)
|
||||
result = NULL;
|
||||
else
|
||||
{
|
||||
|
||||
+4
-6
@@ -199,7 +199,7 @@ _dl_check_map_versions (struct link_map *map, int verbose)
|
||||
aux->vna_flags & VER_FLG_WEAK);
|
||||
|
||||
/* Compare the version index. */
|
||||
if ((aux->vna_other & 0x7fff) > ndx_high)
|
||||
if ((unsigned int) (aux->vna_other & 0x7fff) > ndx_high)
|
||||
ndx_high = aux->vna_other & 0x7fff;
|
||||
|
||||
if (aux->vna_next == 0)
|
||||
@@ -230,7 +230,7 @@ _dl_check_map_versions (struct link_map *map, int verbose)
|
||||
ent = (ElfW(Verdef) *) (map->l_addr + def->d_un.d_ptr);
|
||||
while (1)
|
||||
{
|
||||
if ((ent->vd_ndx & 0x7fff) > ndx_high)
|
||||
if ((unsigned int) (ent->vd_ndx & 0x7fff) > ndx_high)
|
||||
ndx_high = ent->vd_ndx & 0x7fff;
|
||||
|
||||
if (ent->vd_next == 0)
|
||||
@@ -247,9 +247,7 @@ _dl_check_map_versions (struct link_map *map, int verbose)
|
||||
which can be indexed by the version index in the VERSYM
|
||||
section. */
|
||||
map->l_versions = (struct r_found_version *)
|
||||
malloc ((ndx_high + 1) * sizeof (*map->l_versions));
|
||||
memset (map->l_versions, '\0',
|
||||
(ndx_high + 1) * sizeof (*map->l_versions));
|
||||
calloc (ndx_high + 1, sizeof (*map->l_versions));
|
||||
if (map->l_versions == NULL)
|
||||
{
|
||||
_dl_signal_error (ENOMEM, (*map->l_name ? map->l_name : _dl_argv[0]),
|
||||
@@ -334,7 +332,7 @@ _dl_check_all_versions (struct link_map *map, int verbose)
|
||||
int result = 0;
|
||||
|
||||
for (l = map; l != NULL; l = l->l_next)
|
||||
result |= _dl_check_map_versions (l, verbose);
|
||||
result |= l->l_opencount != 0 && _dl_check_map_versions (l, verbose);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
+7
-6
@@ -20,13 +20,14 @@
|
||||
#include <link.h>
|
||||
#include <dlfcn.h>
|
||||
|
||||
static void
|
||||
dlclose_doit (void *handle)
|
||||
{
|
||||
_dl_close (handle);
|
||||
}
|
||||
|
||||
int
|
||||
dlclose (void *handle)
|
||||
{
|
||||
void doit (void)
|
||||
{
|
||||
_dl_close (handle);
|
||||
}
|
||||
|
||||
return _dlerror_run (doit) ? -1 : 0;
|
||||
return _dlerror_run (dlclose_doit, handle) ? -1 : 0;
|
||||
}
|
||||
|
||||
+2
-2
@@ -64,7 +64,7 @@ dlerror (void)
|
||||
}
|
||||
|
||||
int
|
||||
_dlerror_run (void (*operate) (void))
|
||||
_dlerror_run (void (*operate) (void *), void *args)
|
||||
{
|
||||
if (last_errstring != NULL)
|
||||
/* Free the error string from the last failed command. This can
|
||||
@@ -72,6 +72,6 @@ _dlerror_run (void (*operate) (void))
|
||||
free (last_errstring);
|
||||
|
||||
last_errcode = _dl_catch_error (&last_errstring, &last_object_name,
|
||||
operate);
|
||||
operate, args);
|
||||
return last_errstring != NULL;
|
||||
}
|
||||
|
||||
+23
-7
@@ -21,15 +21,31 @@
|
||||
#include <link.h>
|
||||
#include <dlfcn.h>
|
||||
|
||||
struct dlopen_args
|
||||
{
|
||||
/* The arguments for dlopen_doit. */
|
||||
const char *file;
|
||||
int mode;
|
||||
/* The return value of dlopen_doit. */
|
||||
struct link_map *new;
|
||||
};
|
||||
|
||||
|
||||
static void
|
||||
dlopen_doit (void *a)
|
||||
{
|
||||
struct dlopen_args *args = (struct dlopen_args *) a;
|
||||
|
||||
args->new = _dl_open (args->file ?: "", args->mode);
|
||||
}
|
||||
|
||||
|
||||
void *
|
||||
dlopen (const char *file, int mode)
|
||||
{
|
||||
struct link_map *new;
|
||||
struct dlopen_args args;
|
||||
args.file = file;
|
||||
args.mode = mode;
|
||||
|
||||
void doit (void)
|
||||
{
|
||||
new = _dl_open (file ?: "", mode);
|
||||
}
|
||||
|
||||
return _dlerror_run (doit) ? NULL : new;
|
||||
return _dlerror_run (dlopen_doit, &args) ? NULL : args.new;
|
||||
}
|
||||
|
||||
+62
-39
@@ -22,48 +22,71 @@
|
||||
#include <dlfcn.h>
|
||||
#include <setjmp.h>
|
||||
|
||||
struct dlsym_args
|
||||
{
|
||||
/* The arguments to dlsym_doit. */
|
||||
void *handle;
|
||||
const char *name;
|
||||
struct r_found_version version;
|
||||
ElfW(Addr) caller;
|
||||
/* The return values of dlsym_doit. */
|
||||
ElfW(Addr) loadbase;
|
||||
const ElfW(Sym) *ref;
|
||||
};
|
||||
|
||||
|
||||
static void
|
||||
dlsym_doit (void *a)
|
||||
{
|
||||
struct dlsym_args *args = (struct dlsym_args *) a;
|
||||
args->ref = NULL;
|
||||
|
||||
if (args->handle == NULL)
|
||||
/* Search the global scope. */
|
||||
args->loadbase = _dl_lookup_symbol (args->name, &args->ref,
|
||||
&(_dl_global_scope
|
||||
?: _dl_default_scope)[2],
|
||||
NULL, 0);
|
||||
else if (args->handle == RTLD_NEXT)
|
||||
{
|
||||
struct link_map *l, *match;
|
||||
|
||||
/* Find the highest-addressed object that CALLER is not below. */
|
||||
match = NULL;
|
||||
for (l = _dl_loaded; l; l = l->l_next)
|
||||
if (args->caller >= l->l_addr && (!match || match->l_addr < l->l_addr))
|
||||
match = l;
|
||||
|
||||
if (! match)
|
||||
_dl_signal_error (0, NULL, _("\
|
||||
RTLD_NEXT used in code not dynamically loaded"));
|
||||
|
||||
l = match;
|
||||
while (l->l_loader)
|
||||
l = l->l_loader;
|
||||
|
||||
args->loadbase = _dl_lookup_symbol_skip (args->name, &args->ref,
|
||||
&_dl_loaded, NULL, l);
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Search the scope of the given object. */
|
||||
struct link_map *map = args->handle;
|
||||
struct link_map *mapscope[2] = { map, NULL };
|
||||
args->loadbase = _dl_lookup_symbol (args->name, &args->ref, mapscope,
|
||||
map->l_name, 0);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void *
|
||||
dlsym (void *handle, const char *name)
|
||||
{
|
||||
ElfW(Addr) caller = (ElfW(Addr)) __builtin_return_address (0);
|
||||
ElfW(Addr) loadbase;
|
||||
const ElfW(Sym) *ref = NULL;
|
||||
void doit (void)
|
||||
{
|
||||
if (handle == NULL)
|
||||
/* Search the global scope. */
|
||||
loadbase = _dl_lookup_symbol
|
||||
(name, &ref, &(_dl_global_scope ?: _dl_default_scope)[2], NULL, 0);
|
||||
else if (handle == RTLD_NEXT)
|
||||
{
|
||||
struct link_map *l, *match;
|
||||
struct dlsym_args args;
|
||||
args.caller = (ElfW(Addr)) __builtin_return_address (0);
|
||||
args.handle = handle;
|
||||
args.name = name;
|
||||
|
||||
/* Find the highest-addressed object that CALLER is not below. */
|
||||
match = NULL;
|
||||
for (l = _dl_loaded; l; l = l->l_next)
|
||||
if (caller >= l->l_addr && (!match || match->l_addr < l->l_addr))
|
||||
match = l;
|
||||
|
||||
if (! match)
|
||||
_dl_signal_error (0, NULL, _("\
|
||||
RTLD_NEXT used in code not dynamically loaded"));
|
||||
|
||||
l = match;
|
||||
while (l->l_loader)
|
||||
l = l->l_loader;
|
||||
|
||||
loadbase = _dl_lookup_symbol_skip
|
||||
(name, &ref, &_dl_loaded, NULL, l, 0);
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Search the scope of the given object. */
|
||||
struct link_map *map = handle;
|
||||
struct link_map *mapscope[2] = { map, NULL };
|
||||
loadbase = _dl_lookup_symbol (name, &ref, mapscope, map->l_name, 0);
|
||||
}
|
||||
}
|
||||
|
||||
return _dlerror_run (doit) ? NULL : (void *) (loadbase + ref->st_value);
|
||||
return (_dlerror_run (dlsym_doit, &args)
|
||||
? NULL : (void *) (args.loadbase + args.ref->st_value));
|
||||
}
|
||||
|
||||
+69
-44
@@ -24,57 +24,82 @@
|
||||
|
||||
#include <dl-hash.h>
|
||||
|
||||
struct dlvsym_args
|
||||
{
|
||||
/* The arguments to dlvsym_doit. */
|
||||
void *handle;
|
||||
const char *name;
|
||||
struct r_found_version version;
|
||||
ElfW(Addr) caller;
|
||||
/* The return values of dlvsym_doit. */
|
||||
ElfW(Addr) loadbase;
|
||||
const ElfW(Sym) *ref;
|
||||
};
|
||||
|
||||
|
||||
static void
|
||||
dlvsym_doit (void *a)
|
||||
{
|
||||
struct dlvsym_args *args = (struct dlvsym_args *)a;
|
||||
args->ref = NULL;
|
||||
|
||||
if (args->handle == NULL)
|
||||
/* Search the global scope. */
|
||||
args->loadbase = _dl_lookup_versioned_symbol (args->name, &args->ref,
|
||||
&(_dl_global_scope
|
||||
?: _dl_default_scope)[2],
|
||||
NULL, &args->version, 0);
|
||||
else if (args->handle == RTLD_NEXT)
|
||||
{
|
||||
struct link_map *l, *match;
|
||||
|
||||
/* Find the highest-addressed object that CALLER is not below. */
|
||||
match = NULL;
|
||||
for (l = _dl_loaded; l; l = l->l_next)
|
||||
if (args->caller >= l->l_addr && (!match || match->l_addr < l->l_addr))
|
||||
match = l;
|
||||
|
||||
if (! match)
|
||||
_dl_signal_error (0, NULL, _("\
|
||||
RTLD_NEXT used in code not dynamically loaded"));
|
||||
|
||||
l = match;
|
||||
while (l->l_loader)
|
||||
l = l->l_loader;
|
||||
|
||||
args->loadbase = _dl_lookup_versioned_symbol_skip (args->name,
|
||||
&args->ref,
|
||||
&_dl_loaded,
|
||||
NULL, &args->version,
|
||||
l);
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Search the scope of the given object. */
|
||||
struct link_map *map = args->handle;
|
||||
struct link_map *mapscope[2] = { map, NULL };
|
||||
args->loadbase = _dl_lookup_versioned_symbol (args->name, &args->ref,
|
||||
mapscope, map->l_name,
|
||||
&args->version, 0);
|
||||
}
|
||||
}
|
||||
|
||||
void *
|
||||
__dlvsym (void *handle, const char *name, const char *version_str)
|
||||
{
|
||||
ElfW(Addr) caller = (ElfW(Addr)) __builtin_return_address (0);
|
||||
ElfW(Addr) loadbase;
|
||||
struct r_found_version version;
|
||||
const ElfW(Sym) *ref = NULL;
|
||||
void doit (void)
|
||||
{
|
||||
if (handle == NULL)
|
||||
/* Search the global scope. */
|
||||
loadbase = _dl_lookup_versioned_symbol
|
||||
(name, &ref, &(_dl_global_scope ?: _dl_default_scope)[2], NULL,
|
||||
&version, 0);
|
||||
else if (handle == RTLD_NEXT)
|
||||
{
|
||||
struct link_map *l, *match;
|
||||
struct dlvsym_args args;
|
||||
|
||||
/* Find the highest-addressed object that CALLER is not below. */
|
||||
match = NULL;
|
||||
for (l = _dl_loaded; l; l = l->l_next)
|
||||
if (caller >= l->l_addr && (!match || match->l_addr < l->l_addr))
|
||||
match = l;
|
||||
|
||||
if (! match)
|
||||
_dl_signal_error (0, NULL, _("\
|
||||
RTLD_NEXT used in code not dynamically loaded"));
|
||||
|
||||
l = match;
|
||||
while (l->l_loader)
|
||||
l = l->l_loader;
|
||||
|
||||
loadbase = _dl_lookup_versioned_symbol_skip
|
||||
(name, &ref, &_dl_loaded, NULL, &version, l, 0);
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Search the scope of the given object. */
|
||||
struct link_map *map = handle;
|
||||
struct link_map *mapscope[2] = { map, NULL };
|
||||
loadbase = _dl_lookup_versioned_symbol
|
||||
(name, &ref, mapscope, map->l_name, &version, 0);
|
||||
}
|
||||
}
|
||||
args.handle = handle;
|
||||
args.name = name;
|
||||
args.caller = (ElfW(Addr)) __builtin_return_address (0);
|
||||
|
||||
/* Compute hash value to the version string. */
|
||||
version.name = version_str;
|
||||
version.hash = _dl_elf_hash (version_str);
|
||||
args.version.name = version_str;
|
||||
args.version.hash = _dl_elf_hash (version_str);
|
||||
/* We don't have a specific file where the symbol can be found. */
|
||||
version.filename = NULL;
|
||||
args.version.filename = NULL;
|
||||
|
||||
return _dlerror_run (doit) ? NULL : (void *) (loadbase + ref->st_value);
|
||||
return (_dlerror_run (dlvsym_doit, &args)
|
||||
? NULL : (void *) (args.loadbase + args.ref->st_value));
|
||||
}
|
||||
weak_alias (__dlvsym, dlvsym)
|
||||
|
||||
@@ -915,6 +915,71 @@ typedef Elf32_Addr Elf32_Conflict;
|
||||
#define R_ALPHA_JMP_SLOT 26 /* Create PLT entry */
|
||||
#define R_ALPHA_RELATIVE 27 /* Adjust by program base */
|
||||
|
||||
|
||||
/* PowerPC specific declarations */
|
||||
|
||||
/* PowerPC relocations defined by the ABIs */
|
||||
#define R_PPC_NONE 0
|
||||
#define R_PPC_ADDR32 1
|
||||
#define R_PPC_ADDR24 2
|
||||
#define R_PPC_ADDR16 3
|
||||
#define R_PPC_ADDR16_LO 4
|
||||
#define R_PPC_ADDR16_HI 5
|
||||
#define R_PPC_ADDR16_HA 6
|
||||
#define R_PPC_ADDR14 7
|
||||
#define R_PPC_ADDR14_BRTAKEN 8
|
||||
#define R_PPC_ADDR14_BRNTAKEN 9
|
||||
#define R_PPC_REL24 10
|
||||
#define R_PPC_REL14 11
|
||||
#define R_PPC_REL14_BRTAKEN 12
|
||||
#define R_PPC_REL14_BRNTAKEN 13
|
||||
#define R_PPC_GOT16 14
|
||||
#define R_PPC_GOT16_LO 15
|
||||
#define R_PPC_GOT16_HI 16
|
||||
#define R_PPC_GOT16_HA 17
|
||||
#define R_PPC_PLTREL24 18
|
||||
#define R_PPC_COPY 19
|
||||
#define R_PPC_GLOB_DAT 20
|
||||
#define R_PPC_JMP_SLOT 21
|
||||
#define R_PPC_RELATIVE 22
|
||||
#define R_PPC_LOCAL24PC 23
|
||||
#define R_PPC_UADDR32 24
|
||||
#define R_PPC_UADDR16 25
|
||||
#define R_PPC_REL32 26
|
||||
#define R_PPC_PLT32 27
|
||||
#define R_PPC_PLTREL32 28
|
||||
#define R_PPC_PLT16_LO 29
|
||||
#define R_PPC_PLT16_HI 30
|
||||
#define R_PPC_PLT16_HA 31
|
||||
#define R_PPC_SDAREL16 32
|
||||
#define R_PPC_SECTOFF 33
|
||||
#define R_PPC_SECTOFF_LO 34
|
||||
#define R_PPC_SECTOFF_HI 35
|
||||
#define R_PPC_SECTOFF_HA 36
|
||||
|
||||
/* The remaining relocs are from the Embedded ELF ABI, and are not
|
||||
in the SVR4 ELF ABI. */
|
||||
#define R_PPC_EMB_NADDR32 101
|
||||
#define R_PPC_EMB_NADDR16 102
|
||||
#define R_PPC_EMB_NADDR16_LO 103
|
||||
#define R_PPC_EMB_NADDR16_HI 104
|
||||
#define R_PPC_EMB_NADDR16_HA 105
|
||||
#define R_PPC_EMB_SDAI16 106
|
||||
#define R_PPC_EMB_SDA2I16 107
|
||||
#define R_PPC_EMB_SDA2REL 108
|
||||
#define R_PPC_EMB_SDA21 109
|
||||
#define R_PPC_EMB_MRKREF 110
|
||||
#define R_PPC_EMB_RELSEC16 111
|
||||
#define R_PPC_EMB_RELST_LO 112
|
||||
#define R_PPC_EMB_RELST_HI 113
|
||||
#define R_PPC_EMB_RELST_HA 114
|
||||
#define R_PPC_EMB_BIT_FLD 115
|
||||
#define R_PPC_EMB_RELSDA 116
|
||||
|
||||
/* This is a phony reloc to handle any old fashioned TOC16 references
|
||||
that may still be in object files. */
|
||||
#define R_PPC_TOC16 255
|
||||
|
||||
__END_DECLS
|
||||
|
||||
#endif /* elf.h */
|
||||
|
||||
+33
-13
@@ -69,6 +69,7 @@ Report bugs using the \`glibcbug' script to <bugs@gnu.ai.mit.edu>."
|
||||
esac
|
||||
done
|
||||
|
||||
add_env="LD_TRACE_LOADED_OBJECTS=1 LD_WARN=$warn LD_BIND_NOW=$bind_now"
|
||||
case $# in
|
||||
0)
|
||||
echo >&2 $"ldd: missing file arguments"
|
||||
@@ -86,20 +87,29 @@ case $# in
|
||||
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 LD_WARN=$warn LD_BIND_NOW=$bind_now \
|
||||
exec ${RTLD} ${RELOCS} "$file" || exit 1
|
||||
else
|
||||
echo $" not a dynamic executable"
|
||||
exit 1
|
||||
fi
|
||||
${RTLD} --verify "$file"
|
||||
case $? in
|
||||
0)
|
||||
eval $add_env exec '"$file"' || exit 1
|
||||
;;
|
||||
1)
|
||||
echo $" not a dynamic executable"
|
||||
exit 1
|
||||
;;
|
||||
2)
|
||||
eval $add_env exec \${RTLD} '"$file"' || exit 1
|
||||
;;
|
||||
*)
|
||||
echo $"ldd: ${RTLD} exited with unknown exit code ($?)" >&2
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
else
|
||||
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}:"
|
||||
@@ -113,13 +123,23 @@ case $# in
|
||||
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 LD_WARN=$warn LD_BIND_NOW=$bind_now \
|
||||
${RTLD} ${RELOCS} "$file" || result=1
|
||||
else
|
||||
${RTLD} --verify "$file"
|
||||
case $? in
|
||||
0)
|
||||
eval $add_env '"$file"' || result=1
|
||||
;;
|
||||
1)
|
||||
echo $" not a dynamic executable"
|
||||
result=1
|
||||
fi
|
||||
;;
|
||||
2)
|
||||
eval $add_env ${RTLD} '"$file"' || result=1
|
||||
;;
|
||||
*)
|
||||
echo $"ldd: ${RTLD} exited with unknown exit code ($?)" >&2
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
else
|
||||
echo $"ldd: error: you do not have read permission for" "\`$file'"
|
||||
result=1
|
||||
|
||||
+31
-10
@@ -66,6 +66,7 @@ Try \`ldd --help' for more information."
|
||||
esac
|
||||
done
|
||||
|
||||
add_env="LD_TRACE_LOADED_OBJECTS=1 LD_WARN=$warn LD_BIND_NOW=$bind_now"
|
||||
case $# in
|
||||
0)
|
||||
echo >&2 "\
|
||||
@@ -85,13 +86,23 @@ Try \`ldd --help' for more information."
|
||||
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 LD_WARN=$warn LD_BIND_NOW=$bind_now \
|
||||
exec ${RTLD} "$file" || exit 1
|
||||
else
|
||||
${RTLD} --verify "$file"
|
||||
case $? in
|
||||
0)
|
||||
eval $add_env exec '"$file"' || exit 1
|
||||
;;
|
||||
1)
|
||||
echo ' not a dynamic executable'
|
||||
exit 1
|
||||
fi
|
||||
;;
|
||||
2)
|
||||
eval $add_env exec \${RTLD} '"$file"' || exit 1
|
||||
;;
|
||||
*)
|
||||
echo "ldd: ${RTLD} exited with unknown exit code ($?)" >&2
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
else
|
||||
echo "ldd: error: you do not have read permission for \`$file'"
|
||||
exit 1
|
||||
@@ -114,13 +125,23 @@ Try \`ldd --help' for more information."
|
||||
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 LD_WARN=$warn LD_BIND_NOW=$bind_now \
|
||||
${RTLD} "$file" || result=1
|
||||
else
|
||||
${RTLD} --verify "$file"
|
||||
case $? in
|
||||
0)
|
||||
eval $add_env '"$file"' || result=1
|
||||
;;
|
||||
1)
|
||||
echo ' not a dynamic executable'
|
||||
result=1
|
||||
fi
|
||||
;;
|
||||
2)
|
||||
eval $add_env ${RTLD} '"$file"' || result=1
|
||||
;;
|
||||
*)
|
||||
echo "ldd: ${RTLD} exited with unknown exit code ($?)" >&2
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
else
|
||||
echo "ldd: error: you do not have read permission for \`$file'"
|
||||
result=1
|
||||
|
||||
+22
-19
@@ -18,9 +18,12 @@
|
||||
Boston, MA 02111-1307, USA. */
|
||||
|
||||
#ifndef _LINK_H
|
||||
|
||||
#define _LINK_H 1
|
||||
#include <features.h>
|
||||
|
||||
#define __need_size_t
|
||||
#define __need_NULL
|
||||
#include <stddef.h>
|
||||
|
||||
#include <elf.h>
|
||||
@@ -235,21 +238,26 @@ extern void _dl_signal_error (int errcode,
|
||||
error, *ERRSTRING is set to null. If there is an error, *ERRSTRING and
|
||||
*OBJECT are set to the strings passed to _dl_signal_error, and the error
|
||||
code passed is the return value. ERRSTRING if nonzero points to a
|
||||
malloc'ed string which the caller has to free after use. */
|
||||
malloc'ed string which the caller has to free after use.
|
||||
ARGS is passed as argument to OPERATE. */
|
||||
extern int _dl_catch_error (char **errstring,
|
||||
const char **object,
|
||||
void (*operate) (void));
|
||||
void (*operate) (void *),
|
||||
void *args);
|
||||
|
||||
/* 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));
|
||||
function returns.
|
||||
ARGS is passed as argument to OPERATE. */
|
||||
extern void _dl_receive_error (receiver_fct fct, void (*operate) (void *),
|
||||
void *args);
|
||||
|
||||
|
||||
/* Helper function for <dlfcn.h> functions. Runs the OPERATE function via
|
||||
_dl_catch_error. Returns zero for success, nonzero for failure; and
|
||||
arranges for `dlerror' to return the error details. */
|
||||
extern int _dlerror_run (void (*operate) (void));
|
||||
arranges for `dlerror' to return the error details.
|
||||
ARGS is passed as argument to OPERATE. */
|
||||
extern int _dlerror_run (void (*operate) (void *), void *args);
|
||||
|
||||
|
||||
/* Open the shared object NAME and map in its segments.
|
||||
@@ -287,18 +295,15 @@ extern void _dl_close (struct link_map *map);
|
||||
null-terminated list of object scopes to search; each object's
|
||||
l_searchlist (i.e. the segment of the dependency tree starting at that
|
||||
object) is searched in turn. REFERENCE_NAME should name the object
|
||||
containing the reference; it is used in error messages. FLAGS is a
|
||||
set of flags: */
|
||||
#define DL_LOOKUP_NOEXEC 1 /* Don't search the executable for a
|
||||
definition; this is used for copy
|
||||
relocs. */
|
||||
#define DL_LOOKUP_NOPLT 2 /* The reference must not be resolved
|
||||
to a PLT entry. */
|
||||
containing the reference; it is used in error messages.
|
||||
RELOC_TYPE is a machine-dependent reloc type, which is passed to
|
||||
the `elf_machine_lookup_*_p' macros in dl-machine.h to affect which
|
||||
symbols can be chosen. */
|
||||
extern ElfW(Addr) _dl_lookup_symbol (const char *undef,
|
||||
const ElfW(Sym) **sym,
|
||||
struct link_map *symbol_scope[],
|
||||
const char *reference_name,
|
||||
int flags);
|
||||
int reloc_type);
|
||||
|
||||
/* Lookup versioned symbol. */
|
||||
extern ElfW(Addr) _dl_lookup_versioned_symbol (const char *undef,
|
||||
@@ -306,15 +311,14 @@ extern ElfW(Addr) _dl_lookup_versioned_symbol (const char *undef,
|
||||
struct link_map *symbol_scope[],
|
||||
const char *reference_name,
|
||||
const struct r_found_version *version,
|
||||
int flags);
|
||||
int reloc_type);
|
||||
|
||||
/* For handling RTLD_NEXT we must be able to skip shared objects. */
|
||||
extern ElfW(Addr) _dl_lookup_symbol_skip (const char *undef,
|
||||
const ElfW(Sym) **sym,
|
||||
struct link_map *symbol_scope[],
|
||||
const char *reference_name,
|
||||
struct link_map *skip_this,
|
||||
int flags);
|
||||
struct link_map *skip_this);
|
||||
|
||||
/* For handling RTLD_NEXT with versioned symbols we must be able to
|
||||
skip shared objects. */
|
||||
@@ -323,8 +327,7 @@ extern ElfW(Addr) _dl_lookup_versioned_symbol_skip (const char *undef,
|
||||
struct link_map *symbol_scope[],
|
||||
const char *reference_name,
|
||||
const struct r_found_version *version,
|
||||
struct link_map *skip_this,
|
||||
int flags);
|
||||
struct link_map *skip_this);
|
||||
|
||||
/* Look up symbol NAME in MAP's scope and return its run-time address. */
|
||||
extern ElfW(Addr) _dl_symbol_value (struct link_map *map, const char *name);
|
||||
|
||||
+117
-77
@@ -79,7 +79,7 @@ RTLD_START
|
||||
#error "sysdeps/MACHINE/dl-machine.h fails to define RTLD_START"
|
||||
#endif
|
||||
|
||||
ElfW(Addr)
|
||||
static ElfW(Addr)
|
||||
_dl_start (void *arg)
|
||||
{
|
||||
struct link_map bootstrap_map;
|
||||
@@ -106,6 +106,7 @@ _dl_start (void *arg)
|
||||
|
||||
ELF_DYNAMIC_RELOCATE (&bootstrap_map, 0);
|
||||
|
||||
elf_machine_runtime_setup (&bootstrap_map, 0);
|
||||
|
||||
/* Now life is sane; we can call functions and access global data.
|
||||
Set up to use the operating system facilities, and find out from
|
||||
@@ -139,6 +140,55 @@ _dl_start (void *arg)
|
||||
|
||||
void _start (void);
|
||||
|
||||
/* Some helper functions. */
|
||||
|
||||
/* Arguments to relocate_doit. */
|
||||
struct relocate_args
|
||||
{
|
||||
struct link_map *l;
|
||||
int lazy;
|
||||
};
|
||||
|
||||
struct map_args
|
||||
{
|
||||
/* Argument to map_doit. */
|
||||
char *str;
|
||||
/* Return value of map_doit. */
|
||||
struct link_map *main_map;
|
||||
};
|
||||
|
||||
/* Arguments to version_check_doit. */
|
||||
struct version_check_args
|
||||
{
|
||||
struct link_map *main_map;
|
||||
int doexit;
|
||||
};
|
||||
|
||||
static void
|
||||
relocate_doit (void *a)
|
||||
{
|
||||
struct relocate_args *args = (struct relocate_args *) a;
|
||||
|
||||
_dl_relocate_object (args->l, _dl_object_relocation_scope (args->l),
|
||||
args->lazy);
|
||||
}
|
||||
|
||||
static void
|
||||
map_doit (void *a)
|
||||
{
|
||||
struct map_args *args = (struct map_args *)a;
|
||||
args->main_map = _dl_map_object (NULL, args->str, lt_library, 0);
|
||||
}
|
||||
|
||||
static void
|
||||
version_check_doit (void *a)
|
||||
{
|
||||
struct version_check_args *args = (struct version_check_args *)a;
|
||||
if (_dl_check_all_versions (args->main_map, 1) && args->doexit)
|
||||
/* We cannot start the application. Abort now. */
|
||||
_exit (1);
|
||||
}
|
||||
|
||||
unsigned int _dl_skip_args; /* Nonzero if we were run directly. */
|
||||
|
||||
static void
|
||||
@@ -147,7 +197,7 @@ dl_main (const ElfW(Phdr) *phdr,
|
||||
ElfW(Addr) *user_entry)
|
||||
{
|
||||
const ElfW(Phdr) *ph;
|
||||
struct link_map *l;
|
||||
struct link_map *main_map;
|
||||
int lazy;
|
||||
enum { normal, list, verify, trace } mode;
|
||||
struct link_map **preloads;
|
||||
@@ -155,6 +205,7 @@ dl_main (const ElfW(Phdr) *phdr,
|
||||
const char *preloadlist;
|
||||
size_t file_size;
|
||||
char *file;
|
||||
int has_interp = 0;
|
||||
|
||||
mode = getenv ("LD_TRACE_LOADED_OBJECTS") != NULL ? trace : normal;
|
||||
|
||||
@@ -232,14 +283,13 @@ of this helper program; chances are you did not intend to run this program.\n",
|
||||
|
||||
if (mode == verify)
|
||||
{
|
||||
void doit (void)
|
||||
{
|
||||
l = _dl_map_object (NULL, _dl_argv[0], lt_library, 0);
|
||||
}
|
||||
char *err_str = NULL;
|
||||
const char *obj_name __attribute__ ((unused));
|
||||
struct map_args args;
|
||||
|
||||
(void) _dl_catch_error (&err_str, &obj_name, doit);
|
||||
args.str = _dl_argv[0];
|
||||
(void) _dl_catch_error (&err_str, &obj_name, map_doit, &args);
|
||||
main_map = args.main_map;
|
||||
if (err_str != NULL)
|
||||
{
|
||||
free (err_str);
|
||||
@@ -247,37 +297,24 @@ of this helper program; chances are you did not intend to run this program.\n",
|
||||
}
|
||||
}
|
||||
else
|
||||
l = _dl_map_object (NULL, _dl_argv[0], lt_library, 0);
|
||||
main_map = _dl_map_object (NULL, _dl_argv[0], lt_library, 0);
|
||||
|
||||
phdr = l->l_phdr;
|
||||
phent = l->l_phnum;
|
||||
l->l_name = (char *) "";
|
||||
*user_entry = l->l_entry;
|
||||
phdr = main_map->l_phdr;
|
||||
phent = main_map->l_phnum;
|
||||
main_map->l_name = (char *) "";
|
||||
*user_entry = main_map->l_entry;
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Create a link_map for the executable itself.
|
||||
This will be what dlopen on "" returns. */
|
||||
l = _dl_new_object ((char *) "", "", lt_executable);
|
||||
if (l == NULL)
|
||||
main_map = _dl_new_object ((char *) "", "", lt_executable);
|
||||
if (main_map == NULL)
|
||||
_dl_sysdep_fatal ("cannot allocate memory for link map", NULL);
|
||||
l->l_phdr = phdr;
|
||||
l->l_phnum = phent;
|
||||
l->l_entry = *user_entry;
|
||||
}
|
||||
|
||||
if (l != _dl_loaded)
|
||||
{
|
||||
/* GDB assumes that the first element on the chain is the
|
||||
link_map for the executable itself, and always skips it.
|
||||
Make sure the first one is indeed that one. */
|
||||
l->l_prev->l_next = l->l_next;
|
||||
if (l->l_next)
|
||||
l->l_next->l_prev = l->l_prev;
|
||||
l->l_prev = NULL;
|
||||
l->l_next = _dl_loaded;
|
||||
_dl_loaded->l_prev = l;
|
||||
_dl_loaded = l;
|
||||
main_map->l_phdr = phdr;
|
||||
main_map->l_phnum = phent;
|
||||
main_map->l_entry = *user_entry;
|
||||
main_map->l_opencount = 1;
|
||||
}
|
||||
|
||||
/* Scan the program header table for the dynamic section. */
|
||||
@@ -287,7 +324,7 @@ of this helper program; chances are you did not intend to run this program.\n",
|
||||
case PT_DYNAMIC:
|
||||
/* This tells us where to find the dynamic section,
|
||||
which tells us everything we need to do. */
|
||||
l->l_ld = (void *) l->l_addr + ph->p_vaddr;
|
||||
main_map->l_ld = (void *) main_map->l_addr + ph->p_vaddr;
|
||||
break;
|
||||
case PT_INTERP:
|
||||
/* This "interpreter segment" was used by the program loader to
|
||||
@@ -296,9 +333,10 @@ of this helper program; chances are you did not intend to run this program.\n",
|
||||
dlopen call or DT_NEEDED entry, for something that wants to link
|
||||
against the dynamic linker as a shared library, will know that
|
||||
the shared object is already loaded. */
|
||||
_dl_rtld_libname.name = (const char *) l->l_addr + ph->p_vaddr;
|
||||
_dl_rtld_libname.name = (const char *) main_map->l_addr + ph->p_vaddr;
|
||||
_dl_rtld_libname.next = NULL;
|
||||
_dl_rtld_map.l_libname = &_dl_rtld_libname;
|
||||
has_interp = 1;
|
||||
break;
|
||||
}
|
||||
if (! _dl_rtld_map.l_libname && _dl_rtld_map.l_name)
|
||||
@@ -315,25 +353,24 @@ of this helper program; chances are you did not intend to run this program.\n",
|
||||
if (mode == verify)
|
||||
/* We were called just to verify that this is a dynamic executable
|
||||
using us as the program interpreter. */
|
||||
_exit (l->l_ld == NULL ? EXIT_FAILURE : EXIT_SUCCESS);
|
||||
_exit (main_map->l_ld == NULL ? 1 : has_interp ? 0 : 2);
|
||||
|
||||
/* Extract the contents of the dynamic section for easy access. */
|
||||
elf_get_dynamic_info (l->l_ld, l->l_info);
|
||||
if (l->l_info[DT_HASH])
|
||||
elf_get_dynamic_info (main_map->l_ld, main_map->l_info);
|
||||
if (main_map->l_info[DT_HASH])
|
||||
/* Set up our cache of pointers into the hash table. */
|
||||
_dl_setup_hash (l);
|
||||
_dl_setup_hash (main_map);
|
||||
|
||||
/* Put the link_map for ourselves on the chain so it can be found by
|
||||
name. */
|
||||
name. Note that at this point the global chain of link maps contains
|
||||
exactly one element, which is pointed to by main_map. */
|
||||
if (! _dl_rtld_map.l_name)
|
||||
/* If not invoked directly, the dynamic linker shared object file was
|
||||
found by the PT_INTERP name. */
|
||||
_dl_rtld_map.l_name = (char *) _dl_rtld_map.l_libname->name;
|
||||
_dl_rtld_map.l_type = lt_library;
|
||||
while (l->l_next)
|
||||
l = l->l_next;
|
||||
l->l_next = &_dl_rtld_map;
|
||||
_dl_rtld_map.l_prev = l;
|
||||
main_map->l_next = &_dl_rtld_map;
|
||||
_dl_rtld_map.l_prev = main_map;
|
||||
|
||||
/* We have two ways to specify objects to preload: via environment
|
||||
variable and via the file /etc/ld.so.preload. The later can also
|
||||
@@ -443,7 +480,7 @@ of this helper program; chances are you did not intend to run this program.\n",
|
||||
/* Load all the libraries specified by DT_NEEDED entries. If LD_PRELOAD
|
||||
specified some libraries to load, these are inserted before the actual
|
||||
dependencies in the executable's searchlist for symbol resolution. */
|
||||
_dl_map_object_deps (l, preloads, npreloads, mode == trace);
|
||||
_dl_map_object_deps (main_map, preloads, npreloads, mode == trace);
|
||||
|
||||
#ifndef MAP_ANON
|
||||
/* We are done mapping things, so close the zero-fill descriptor. */
|
||||
@@ -463,11 +500,11 @@ of this helper program; chances are you did not intend to run this program.\n",
|
||||
chain in symbol search order because gdb uses the chain's order as
|
||||
its symbol search order. */
|
||||
unsigned int i = 1;
|
||||
while (l->l_searchlist[i] != &_dl_rtld_map)
|
||||
while (main_map->l_searchlist[i] != &_dl_rtld_map)
|
||||
++i;
|
||||
_dl_rtld_map.l_prev = l->l_searchlist[i - 1];
|
||||
_dl_rtld_map.l_next = (i + 1 < l->l_nsearchlist ?
|
||||
l->l_searchlist[i + 1] : NULL);
|
||||
_dl_rtld_map.l_prev = main_map->l_searchlist[i - 1];
|
||||
_dl_rtld_map.l_next = (i + 1 < main_map->l_nsearchlist ?
|
||||
main_map->l_searchlist[i + 1] : NULL);
|
||||
assert (_dl_rtld_map.l_prev->l_next == _dl_rtld_map.l_next);
|
||||
_dl_rtld_map.l_prev->l_next = &_dl_rtld_map;
|
||||
if (_dl_rtld_map.l_next)
|
||||
@@ -480,14 +517,10 @@ of this helper program; chances are you did not intend to run this program.\n",
|
||||
/* Now let us see whether all libraries are available in the
|
||||
versions we need. */
|
||||
{
|
||||
void doit (void)
|
||||
{
|
||||
if (_dl_check_all_versions (l, 1) && mode == normal)
|
||||
/* We cannot start the application. Abort now. */
|
||||
_exit (1);
|
||||
}
|
||||
|
||||
_dl_receive_error (print_missing_version, doit);
|
||||
struct version_check_args args;
|
||||
args.doexit = mode == normal;
|
||||
args.main_map = main_map;
|
||||
_dl_receive_error (print_missing_version, version_check_doit, &args);
|
||||
}
|
||||
|
||||
if (mode != normal)
|
||||
@@ -502,22 +535,26 @@ of this helper program; chances are you did not intend to run this program.\n",
|
||||
if (! _dl_loaded->l_info[DT_NEEDED])
|
||||
_dl_sysdep_message ("\t", "statically linked\n", NULL);
|
||||
else
|
||||
for (l = _dl_loaded->l_next; l; l = l->l_next)
|
||||
if (l->l_opencount == 0)
|
||||
/* The library was not found. */
|
||||
_dl_sysdep_message ("\t", l->l_libname->name, " => not found\n",
|
||||
NULL);
|
||||
else
|
||||
{
|
||||
char buf[20], *bp;
|
||||
buf[sizeof buf - 1] = '\0';
|
||||
bp = _itoa (l->l_addr, &buf[sizeof buf - 1], 16, 0);
|
||||
while ((size_t) (&buf[sizeof buf - 1] - bp)
|
||||
< sizeof l->l_addr * 2)
|
||||
*--bp = '0';
|
||||
_dl_sysdep_message ("\t", l->l_libname->name, " => ", l->l_name,
|
||||
" (0x", bp, ")\n", NULL);
|
||||
}
|
||||
{
|
||||
struct link_map *l;
|
||||
|
||||
for (l = _dl_loaded->l_next; l; l = l->l_next)
|
||||
if (l->l_opencount == 0)
|
||||
/* The library was not found. */
|
||||
_dl_sysdep_message ("\t", l->l_libname->name, " => not found\n",
|
||||
NULL);
|
||||
else
|
||||
{
|
||||
char buf[20], *bp;
|
||||
buf[sizeof buf - 1] = '\0';
|
||||
bp = _itoa (l->l_addr, &buf[sizeof buf - 1], 16, 0);
|
||||
while ((size_t) (&buf[sizeof buf - 1] - bp)
|
||||
< sizeof l->l_addr * 2)
|
||||
*--bp = '0';
|
||||
_dl_sysdep_message ("\t", l->l_libname->name, " => ",
|
||||
l->l_name, " (0x", bp, ")\n", NULL);
|
||||
}
|
||||
}
|
||||
|
||||
if (mode != trace)
|
||||
for (i = 1; i < _dl_argc; ++i)
|
||||
@@ -526,7 +563,7 @@ of this helper program; chances are you did not intend to run this program.\n",
|
||||
ElfW(Addr) loadbase = _dl_lookup_symbol (_dl_argv[i], &ref,
|
||||
&_dl_default_scope[2],
|
||||
"argument",
|
||||
DL_LOOKUP_NOPLT);
|
||||
ELF_MACHINE_RELOC_NOPLT);
|
||||
char buf[20], *bp;
|
||||
buf[sizeof buf - 1] = '\0';
|
||||
bp = _itoa (ref->st_value, &buf[sizeof buf - 1], 16, 0);
|
||||
@@ -542,10 +579,10 @@ of this helper program; chances are you did not intend to run this program.\n",
|
||||
else if (lazy >= 0)
|
||||
{
|
||||
/* We have to do symbol dependency testing. */
|
||||
void doit (void)
|
||||
{
|
||||
_dl_relocate_object (l, _dl_object_relocation_scope (l), lazy);
|
||||
}
|
||||
struct relocate_args args;
|
||||
struct link_map *l;
|
||||
|
||||
args.lazy = lazy;
|
||||
|
||||
l = _dl_loaded;
|
||||
while (l->l_next)
|
||||
@@ -554,7 +591,8 @@ of this helper program; chances are you did not intend to run this program.\n",
|
||||
{
|
||||
if (l != &_dl_rtld_map && l->l_opencount > 0)
|
||||
{
|
||||
_dl_receive_error (print_unresolved, doit);
|
||||
args.l = l;
|
||||
_dl_receive_error (print_unresolved, relocate_doit, &args);
|
||||
*_dl_global_scope_end = NULL;
|
||||
}
|
||||
l = l->l_prev;
|
||||
@@ -574,6 +612,7 @@ of this helper program; chances are you did not intend to run this program.\n",
|
||||
the dynamic linker out of order because it has no copy relocs (we
|
||||
know that because it is self-contained). */
|
||||
|
||||
struct link_map *l;
|
||||
l = _dl_loaded;
|
||||
while (l->l_next)
|
||||
l = l->l_next;
|
||||
@@ -603,6 +642,7 @@ of this helper program; chances are you did not intend to run this program.\n",
|
||||
{
|
||||
/* Initialize _r_debug. */
|
||||
struct r_debug *r = _dl_debug_initialize (_dl_rtld_map.l_addr);
|
||||
struct link_map *l;
|
||||
|
||||
l = _dl_loaded;
|
||||
|
||||
|
||||
+15
-4
@@ -24,6 +24,7 @@
|
||||
to specify the desired environment:
|
||||
|
||||
__STRICT_ANSI__ ISO Standard C.
|
||||
_ISOC9X_SOURCE Extensions to ISO C 89 from ISO C 9x.
|
||||
_POSIX_SOURCE IEEE Std 1003.1.
|
||||
_POSIX_C_SOURCE If ==1, like _POSIX_SOURCE; if >=2 add IEEE Std 1003.2;
|
||||
if >=199309L, add IEEE Std 1003.1b-1993
|
||||
@@ -44,6 +45,7 @@
|
||||
These are defined by this file and are used by the
|
||||
header files to decide what to declare or define:
|
||||
|
||||
__USE_ISOC9X Define ISO C 9X things.
|
||||
__USE_POSIX Define IEEE Std 1003.1 things.
|
||||
__USE_POSIX2 Define IEEE Std 1003.2 things.
|
||||
__USE_POSIX199309 Define IEEE Std 1003.1b things.
|
||||
@@ -69,6 +71,7 @@
|
||||
|
||||
|
||||
/* Undefine everything, so we get a clean slate. */
|
||||
#undef __USE_ISOC9X
|
||||
#undef __USE_POSIX
|
||||
#undef __USE_POSIX2
|
||||
#undef __USE_POSIX199309
|
||||
@@ -102,6 +105,8 @@
|
||||
|
||||
/* If _GNU_SOURCE was defined by the user, turn on all the other features. */
|
||||
#ifdef _GNU_SOURCE
|
||||
#undef _ISOC9X_SOURCE
|
||||
#define _ISOC9X_SOURCE 1
|
||||
#undef _POSIX_SOURCE
|
||||
#define _POSIX_SOURCE 1
|
||||
#undef _POSIX_C_SOURCE
|
||||
@@ -118,14 +123,20 @@
|
||||
|
||||
/* If nothing (other than _GNU_SOURCE) is defined,
|
||||
define _BSD_SOURCE and _SVID_SOURCE. */
|
||||
#if (!defined __STRICT_ANSI__ && !defined _POSIX_SOURCE && \
|
||||
!defined _POSIX_C_SOURCE && !defined _XOPEN_SOURCE && \
|
||||
!defined _XOPEN_SOURCE_EXTENDED && !defined _BSD_SOURCE && \
|
||||
!defined _SVID_SOURCE)
|
||||
#if (!defined __STRICT_ANSI__ && !defined _ISOC9X_SOURCE && \
|
||||
!defined _POSIX_SOURCE && !defined _POSIX_C_SOURCE && \
|
||||
!defined _XOPEN_SOURCE && !defined _XOPEN_SOURCE_EXTENDED && \
|
||||
!defined _BSD_SOURCE && !defined _SVID_SOURCE)
|
||||
#define _BSD_SOURCE 1
|
||||
#define _SVID_SOURCE 1
|
||||
#endif
|
||||
|
||||
/* This is to enable the ISO C 9x extension. It will go away as soon
|
||||
as this standard is officially released. */
|
||||
#ifdef _ISOC9X_SOURCE
|
||||
#define __USE_ISOC9X 1
|
||||
#endif
|
||||
|
||||
/* If none of the ANSI/POSIX macros are defined, use POSIX.1 and POSIX.2
|
||||
(and IEEE Std 1003.1b-1993 unless _XOPEN_SOURCE is defined). */
|
||||
#if (!defined __STRICT_ANSI__ && !defined _POSIX_SOURCE && \
|
||||
|
||||
+1
-1
@@ -232,7 +232,7 @@ sed -e "
|
||||
/^>Fix:/,/^>[A-Za-z-]*:/s;$FIX_C;;
|
||||
" $TEMP > $TEMP.x
|
||||
|
||||
if $MAIL_AGENT $BUGGLIBC < $TEMP.x; then
|
||||
if $MAIL_AGENT < $TEMP.x; then
|
||||
echo "$COMMAND: problem report sent"
|
||||
xs=0; exit
|
||||
else
|
||||
|
||||
+87
-40
@@ -34,6 +34,7 @@
|
||||
#include <sys/time.h>
|
||||
#include <sys/gmon.h>
|
||||
#include <sys/gmon_out.h>
|
||||
#include <sys/uio.h>
|
||||
|
||||
#include <stdio.h>
|
||||
#include <fcntl.h>
|
||||
@@ -124,7 +125,7 @@ monstartup (lowpc, highpc)
|
||||
cp = malloc (p->kcountsize + p->fromssize + p->tossize);
|
||||
if (! cp)
|
||||
{
|
||||
ERR("monstartup: out of memory\n");
|
||||
ERR(_("monstartup: out of memory\n"));
|
||||
return;
|
||||
}
|
||||
bzero(cp, p->kcountsize + p->fromssize + p->tossize);
|
||||
@@ -165,21 +166,26 @@ static void
|
||||
write_hist (fd)
|
||||
int fd;
|
||||
{
|
||||
const u_char tag = GMON_TAG_TIME_HIST;
|
||||
struct gmon_hist_hdr thdr;
|
||||
u_char tag = GMON_TAG_TIME_HIST;
|
||||
struct gmon_hist_hdr thdr __attribute__ ((aligned (__alignof__ (char *))));
|
||||
|
||||
if (_gmonparam.kcountsize > 0)
|
||||
{
|
||||
thdr.low_pc = _gmonparam.lowpc;
|
||||
thdr.high_pc = _gmonparam.highpc;
|
||||
thdr.hist_size = _gmonparam.kcountsize / sizeof(HISTCOUNTER);
|
||||
thdr.prof_rate = __profile_frequency();
|
||||
strncpy(thdr.dimen, "seconds", sizeof(thdr.dimen));
|
||||
struct iovec iov[3] =
|
||||
{
|
||||
{ &tag, sizeof (tag) },
|
||||
{ &thdr, sizeof (struct gmon_hist_hdr) },
|
||||
{ _gmonparam.kcount, _gmonparam.kcountsize }
|
||||
};
|
||||
|
||||
*(char **) thdr.low_pc = (char *) _gmonparam.lowpc;
|
||||
*(char **) thdr.high_pc = (char *) _gmonparam.highpc;
|
||||
*(int *) thdr.hist_size = _gmonparam.kcountsize / sizeof (HISTCOUNTER);
|
||||
*(int *) thdr.prof_rate = __profile_frequency ();
|
||||
strncpy (thdr.dimen, "seconds", sizeof (thdr.dimen));
|
||||
thdr.dimen_abbrev = 's';
|
||||
|
||||
write(fd, &tag, sizeof(tag));
|
||||
write(fd, &thdr, sizeof(thdr));
|
||||
write(fd, _gmonparam.kcount, _gmonparam.kcountsize);
|
||||
__writev (fd, iov, 3);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -188,12 +194,26 @@ static void
|
||||
write_call_graph (fd)
|
||||
int fd;
|
||||
{
|
||||
const u_char tag = GMON_TAG_CG_ARC;
|
||||
struct gmon_cg_arc_record raw_arc;
|
||||
#define NARCS_PER_WRITEV 32
|
||||
u_char tag = GMON_TAG_CG_ARC;
|
||||
struct gmon_cg_arc_record raw_arc[NARCS_PER_WRITEV]
|
||||
__attribute__ ((aligned (__alignof__ (char*))));
|
||||
int from_index, to_index, from_len;
|
||||
u_long frompc;
|
||||
struct iovec iov[2 * NARCS_PER_WRITEV];
|
||||
int nfilled;
|
||||
|
||||
from_len = _gmonparam.fromssize / sizeof(*_gmonparam.froms);
|
||||
for (nfilled = 0; nfilled < NARCS_PER_WRITEV; ++nfilled)
|
||||
{
|
||||
iov[2 * nfilled].iov_base = &tag;
|
||||
iov[2 * nfilled].iov_len = sizeof (tag);
|
||||
|
||||
iov[2 * nfilled + 1].iov_base = &raw_arc[nfilled];
|
||||
iov[2 * nfilled + 1].iov_len = sizeof (struct gmon_cg_arc_record);
|
||||
}
|
||||
|
||||
nfilled = 0;
|
||||
from_len = _gmonparam.fromssize / sizeof (*_gmonparam.froms);
|
||||
for (from_index = 0; from_index < from_len; ++from_index)
|
||||
{
|
||||
if (_gmonparam.froms[from_index] == 0)
|
||||
@@ -201,19 +221,25 @@ write_call_graph (fd)
|
||||
|
||||
frompc = _gmonparam.lowpc;
|
||||
frompc += (from_index * _gmonparam.hashfraction
|
||||
* sizeof(*_gmonparam.froms));
|
||||
* sizeof (*_gmonparam.froms));
|
||||
for (to_index = _gmonparam.froms[from_index];
|
||||
to_index != 0;
|
||||
to_index = _gmonparam.tos[to_index].link)
|
||||
{
|
||||
raw_arc.from_pc = frompc;
|
||||
raw_arc.self_pc = _gmonparam.tos[to_index].selfpc;
|
||||
raw_arc.count = _gmonparam.tos[to_index].count;
|
||||
*(char **) raw_arc[nfilled].from_pc = (char *) frompc;
|
||||
*(char **) raw_arc[nfilled].self_pc =
|
||||
(char *)_gmonparam.tos[to_index].selfpc;
|
||||
*(int *) raw_arc[nfilled].count = _gmonparam.tos[to_index].count;
|
||||
|
||||
write(fd, &tag, sizeof(tag));
|
||||
write(fd, &raw_arc, sizeof(raw_arc));
|
||||
if (++nfilled == NARCS_PER_WRITEV)
|
||||
{
|
||||
__writev (fd, iov, 2 * nfilled);
|
||||
nfilled = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (nfilled > 0)
|
||||
__writev (fd, iov, 2 * nfilled);
|
||||
}
|
||||
|
||||
|
||||
@@ -222,9 +248,23 @@ write_bb_counts (fd)
|
||||
int fd;
|
||||
{
|
||||
struct __bb *grp;
|
||||
const u_char tag = GMON_TAG_BB_COUNT;
|
||||
int ncounts;
|
||||
int i;
|
||||
u_char tag = GMON_TAG_BB_COUNT;
|
||||
size_t ncounts;
|
||||
size_t i;
|
||||
|
||||
struct iovec bbhead[2] =
|
||||
{
|
||||
{ &tag, sizeof (tag) },
|
||||
{ &ncounts, sizeof (ncounts) }
|
||||
};
|
||||
struct iovec bbbody[8];
|
||||
size_t nfilled;
|
||||
|
||||
for (i = 0; i < (sizeof (bbbody) / sizeof (bbbody[0])); i += 2)
|
||||
{
|
||||
bbbody[i].iov_len = sizeof (grp->addresses[0]);
|
||||
bbbody[i + 1].iov_len = sizeof (grp->counts[0]);
|
||||
}
|
||||
|
||||
/* Write each group of basic-block info (all basic-blocks in a
|
||||
compilation unit form a single group). */
|
||||
@@ -232,13 +272,20 @@ write_bb_counts (fd)
|
||||
for (grp = __bb_head; grp; grp = grp->next)
|
||||
{
|
||||
ncounts = grp->ncounts;
|
||||
write(fd, &tag, sizeof(tag));
|
||||
write(fd, &ncounts, sizeof(ncounts));
|
||||
for (i = 0; i < ncounts; ++i)
|
||||
__writev (fd, bbhead, 2);
|
||||
for (nfilled = i = 0; i < ncounts; ++i)
|
||||
{
|
||||
write(fd, &grp->addresses[i], sizeof(grp->addresses[0]));
|
||||
write(fd, &grp->counts[i], sizeof(grp->counts[0]));
|
||||
if (nfilled > (sizeof (bbbody) / sizeof (bbbody[0])) - 2)
|
||||
{
|
||||
__writev (fd, bbbody, nfilled);
|
||||
nfilled = 0;
|
||||
}
|
||||
|
||||
bbbody[nfilled++].iov_base = (char *) &grp->addresses[i];
|
||||
bbbody[nfilled++].iov_base = &grp->counts[i];
|
||||
}
|
||||
if (nfilled > 0)
|
||||
__writev (fd, bbbody, nfilled);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -246,31 +293,31 @@ write_bb_counts (fd)
|
||||
void
|
||||
_mcleanup ()
|
||||
{
|
||||
struct gmon_hdr ghdr;
|
||||
struct gmon_hdr ghdr __attribute__ ((aligned (__alignof__ (int))));
|
||||
int fd;
|
||||
|
||||
moncontrol(0);
|
||||
fd = open("gmon.out", O_CREAT|O_TRUNC|O_WRONLY, 0666);
|
||||
moncontrol (0);
|
||||
fd = __open ("gmon.out", O_CREAT|O_TRUNC|O_WRONLY, 0666);
|
||||
if (fd < 0)
|
||||
{
|
||||
perror("_mcleanup: gmon.out");
|
||||
perror ("_mcleanup: gmon.out");
|
||||
return;
|
||||
}
|
||||
|
||||
/* write gmon.out header: */
|
||||
memset(&ghdr, 0, sizeof(ghdr));
|
||||
memcpy(&ghdr.cookie[0], GMON_MAGIC, sizeof(ghdr.cookie));
|
||||
ghdr.version = GMON_VERSION;
|
||||
write(fd, &ghdr, sizeof(ghdr));
|
||||
memset (&ghdr, 0, sizeof (struct gmon_hdr));
|
||||
memcpy (&ghdr.cookie[0], GMON_MAGIC, sizeof (ghdr.cookie));
|
||||
*(int *) ghdr.version = GMON_VERSION;
|
||||
__write (fd, &ghdr, sizeof (struct gmon_hdr));
|
||||
|
||||
/* write PC histogram: */
|
||||
write_hist(fd);
|
||||
write_hist (fd);
|
||||
|
||||
/* write call-graph: */
|
||||
write_call_graph(fd);
|
||||
write_call_graph (fd);
|
||||
|
||||
/* write basic-block execution counts: */
|
||||
write_bb_counts(fd);
|
||||
write_bb_counts (fd);
|
||||
|
||||
close(fd);
|
||||
__close (fd);
|
||||
}
|
||||
|
||||
+27
-21
@@ -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 David Mosberger <davidm@cs.arizona.edu>.
|
||||
|
||||
@@ -40,30 +40,36 @@ __BEGIN_DECLS
|
||||
* always comes first in gmon.out and is then followed by a series
|
||||
* records defined below.
|
||||
*/
|
||||
struct gmon_hdr {
|
||||
char cookie[4];
|
||||
int version;
|
||||
int spare[3];
|
||||
};
|
||||
struct gmon_hdr
|
||||
{
|
||||
char cookie[4];
|
||||
char version[4];
|
||||
char spare[3 * 4];
|
||||
};
|
||||
|
||||
/* types of records in this file: */
|
||||
typedef enum {
|
||||
GMON_TAG_TIME_HIST = 0, GMON_TAG_CG_ARC = 1, GMON_TAG_BB_COUNT = 2
|
||||
} GMON_Record_Tag;
|
||||
typedef enum
|
||||
{
|
||||
GMON_TAG_TIME_HIST = 0,
|
||||
GMON_TAG_CG_ARC = 1,
|
||||
GMON_TAG_BB_COUNT = 2
|
||||
} GMON_Record_Tag;
|
||||
|
||||
struct gmon_hist_hdr {
|
||||
unsigned long low_pc; /* base pc address of sample buffer */
|
||||
unsigned long high_pc; /* max pc address of sampled buffer */
|
||||
int hist_size; /* size of sample buffer */
|
||||
int prof_rate; /* profiling clock rate */
|
||||
char dimen[15]; /* phys. dim., usually "seconds" */
|
||||
char dimen_abbrev; /* usually 's' for "seconds" */
|
||||
};
|
||||
struct gmon_hist_hdr
|
||||
{
|
||||
char low_pc[sizeof (char *)]; /* base pc address of sample buffer */
|
||||
char high_pc[sizeof (char *)]; /* max pc address of sampled buffer */
|
||||
char hist_size[4]; /* size of sample buffer */
|
||||
char prof_rate[4]; /* profiling clock rate */
|
||||
char dimen[15]; /* phys. dim., usually "seconds" */
|
||||
char dimen_abbrev; /* usually 's' for "seconds" */
|
||||
};
|
||||
|
||||
struct gmon_cg_arc_record {
|
||||
unsigned long from_pc; /* address within caller's body */
|
||||
unsigned long self_pc; /* address within callee's body */
|
||||
int count; /* number of arc traversals */
|
||||
struct gmon_cg_arc_record
|
||||
{
|
||||
char from_pc[sizeof (char *)]; /* address within caller's body */
|
||||
char self_pc[sizeof (char *)]; /* address within callee's body */
|
||||
char count[4]; /* number of arc traversals */
|
||||
};
|
||||
|
||||
__END_DECLS
|
||||
|
||||
+44
-4
@@ -16,20 +16,60 @@
|
||||
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||
Boston, MA 02111-1307, USA. */
|
||||
|
||||
#include <errno.h>
|
||||
#include <grp.h>
|
||||
#include <stdio.h>
|
||||
#include <libc-lock.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
|
||||
/* We need to protect the dynamic buffer handling. */
|
||||
__libc_lock_define_initialized (static, lock);
|
||||
|
||||
/* Read one entry from the given stream. */
|
||||
struct group *
|
||||
fgetgrent (FILE *stream)
|
||||
{
|
||||
static char buffer[BUFSIZ];
|
||||
static char *buffer;
|
||||
static size_t buffer_size;
|
||||
static struct group resbuf;
|
||||
struct group *result;
|
||||
int save;
|
||||
|
||||
if (__fgetgrent_r (stream, &resbuf, buffer, sizeof buffer, &result) != 0)
|
||||
return NULL;
|
||||
/* Get lock. */
|
||||
__libc_lock_lock (lock);
|
||||
|
||||
/* Allocate buffer if not yet available. */
|
||||
if (buffer == NULL)
|
||||
{
|
||||
buffer_size = NSS_BUFLEN_GROUP;
|
||||
buffer = malloc (buffer_size);
|
||||
}
|
||||
|
||||
while (buffer != NULL
|
||||
&& __fgetgrent_r (stream, &resbuf, buffer, buffer_size, &result) != 0
|
||||
&& errno == ERANGE)
|
||||
{
|
||||
char *new_buf;
|
||||
buffer_size += NSS_BUFLEN_GROUP;
|
||||
new_buf = realloc (buffer, buffer_size);
|
||||
if (new_buf == NULL)
|
||||
{
|
||||
/* We are out of memory. Free the current buffer so that the
|
||||
process gets a chance for a normal termination. */
|
||||
save = errno;
|
||||
free (buffer);
|
||||
__set_errno (save);
|
||||
}
|
||||
buffer = new_buf;
|
||||
}
|
||||
|
||||
if (buffer == NULL)
|
||||
result = NULL;
|
||||
|
||||
/* Release lock. Preserve error value. */
|
||||
save = errno;
|
||||
__libc_lock_unlock (lock);
|
||||
__set_errno (save);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
+12
-3
@@ -1,4 +1,4 @@
|
||||
/* Copyright (C) 1991, 1996 Free Software Foundation, Inc.
|
||||
/* Copyright (C) 1991, 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
|
||||
@@ -56,6 +56,7 @@ __fgetgrent_r (FILE *stream, struct group *resbuf, char *buffer, size_t buflen,
|
||||
struct group **result)
|
||||
{
|
||||
char *p;
|
||||
int parse_result;
|
||||
|
||||
do
|
||||
{
|
||||
@@ -69,10 +70,18 @@ __fgetgrent_r (FILE *stream, struct group *resbuf, char *buffer, size_t buflen,
|
||||
/* Skip leading blanks. */
|
||||
while (isspace (*p))
|
||||
++p;
|
||||
} while (*p == '\0' || *p == '#' || /* Ignore empty and comment lines. */
|
||||
} while (*p == '\0' || *p == '#' /* Ignore empty and comment lines. */
|
||||
/* Parse the line. If it is invalid, loop to
|
||||
get the next line of the file to parse. */
|
||||
! parse_line (p, resbuf, (void *) buffer, buflen));
|
||||
|| ! (parse_result = parse_line (p, resbuf,
|
||||
(void *) buffer, buflen)));
|
||||
|
||||
if (parse_result == -1)
|
||||
{
|
||||
/* The parser ran out of space. */
|
||||
*result = NULL;
|
||||
return errno;
|
||||
}
|
||||
|
||||
*result = resbuf;
|
||||
return 0;
|
||||
|
||||
@@ -32,9 +32,6 @@ __BEGIN_DECLS
|
||||
#define __need_size_t
|
||||
#include <stddef.h>
|
||||
|
||||
#define __need_size_t
|
||||
#include <stddef.h>
|
||||
|
||||
|
||||
/* The group structure. */
|
||||
struct group
|
||||
|
||||
+1
-1
@@ -73,7 +73,7 @@ include ../Rules
|
||||
# from $(subdirs), and this rule arranges for the headers in question
|
||||
# to get installed.
|
||||
sunrpc-headers = netdb.h pmap_prot.h xdr.h types.h auth.h \
|
||||
rpc_msg.h auth_unix.h
|
||||
rpc_msg.h auth_unix.h clnt.h
|
||||
installed-sunrpc-headers = $(addprefix $(inst_includedir)/rpc/, \
|
||||
$(sunrpc-headers))
|
||||
install-headers-nosubdir: $(installed-sunrpc-headers)
|
||||
|
||||
@@ -303,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 */
|
||||
|
||||
+2
-2
@@ -40,7 +40,7 @@ _S_msg_add_auth (mach_port_t me,
|
||||
|
||||
if (err = __USEPORT (AUTH,
|
||||
__auth_makeauth (port,
|
||||
&addauth, 1, MACH_MSG_TYPE_MOVE_SEND,
|
||||
&addauth, MACH_MSG_TYPE_MOVE_SEND, 1,
|
||||
NULL, 0,
|
||||
NULL, 0,
|
||||
NULL, 0,
|
||||
@@ -108,7 +108,7 @@ _S_msg_del_auth (mach_port_t me,
|
||||
|
||||
err = __USEPORT (AUTH, __auth_makeauth
|
||||
(port,
|
||||
NULL, 0, MACH_MSG_TYPE_COPY_SEND,
|
||||
NULL, MACH_MSG_TYPE_COPY_SEND, 0,
|
||||
newu, nu,
|
||||
_hurd_id.aux.uids, _hurd_id.aux.nuids,
|
||||
newg, ng,
|
||||
|
||||
+1
-1
@@ -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;
|
||||
|
||||
|
||||
+6
-8
@@ -22,10 +22,9 @@
|
||||
#include <hurd.h>
|
||||
|
||||
static ssize_t
|
||||
pwrite (cookie, buf, n)
|
||||
void *cookie;
|
||||
const char *buf;
|
||||
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);
|
||||
@@ -38,10 +37,9 @@ 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
|
||||
vpprintf (port, format, arg)
|
||||
io_t port;
|
||||
const char *format;
|
||||
va_list arg;
|
||||
vpprintf (io_t port,
|
||||
const char *format,
|
||||
va_list arg)
|
||||
{
|
||||
int done;
|
||||
FILE f;
|
||||
|
||||
+86
-53
@@ -1,62 +1,95 @@
|
||||
/*
|
||||
* Copyright (c) 1983, 1993
|
||||
* The Regents of the University of California. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. All advertising materials mentioning features or use of this software
|
||||
* must display the following acknowledgement:
|
||||
* This product includes software developed by the University of
|
||||
* California, Berkeley and its contributors.
|
||||
* 4. Neither the name of the University nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* @(#)inet.h 8.1 (Berkeley) 6/2/93
|
||||
*/
|
||||
/* Copyright (C) 1997 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
|
||||
#ifndef _INET_H_
|
||||
#define _INET_H_
|
||||
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.
|
||||
|
||||
/* External definitions for functions in inet(3) */
|
||||
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. */
|
||||
|
||||
#ifndef _ARPA_INET_H
|
||||
|
||||
#define _ARPA_INET_H 1
|
||||
#include <features.h>
|
||||
|
||||
#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 *));
|
||||
int inet_aton __P((const char *, struct in_addr *));
|
||||
u_int32_t inet_lnaof __P((struct in_addr));
|
||||
struct in_addr inet_makeaddr __P((u_int32_t , u_int32_t));
|
||||
char * inet_neta __P((u_long, char *, size_t));
|
||||
u_int32_t inet_netof __P((struct in_addr));
|
||||
u_int32_t inet_network __P((const char *));
|
||||
char *inet_net_ntop __P((int, const void *, int, char *, size_t));
|
||||
int inet_net_pton __P((int, const char *, void *, size_t));
|
||||
char *inet_ntoa __P((struct in_addr));
|
||||
int inet_pton __P((int, const char *, void *));
|
||||
const char *inet_ntop __P((int, const void *, char *, size_t));
|
||||
u_int inet_nsap_addr __P((const char *, u_char *, int));
|
||||
char *inet_nsap_ntoa __P((int, const u_char *, char *));
|
||||
|
||||
/* Convert Internet host address from numbers-and-dots notation in CP
|
||||
into binary data in network byte order. */
|
||||
extern unsigned long int inet_addr __P ((__const char *__cp));
|
||||
|
||||
/* Convert Internet host address from numbers-and-dots notation in CP
|
||||
into binary data and store the result in the structure INP. */
|
||||
extern int inet_aton __P ((__const char *__cp, struct in_addr *__inp));
|
||||
|
||||
/* Return the local host address part of the Internet address in IN. */
|
||||
extern u_int32_t inet_lnaof __P ((struct in_addr __in));
|
||||
|
||||
/* Make Internet host address in network byte order by combining the
|
||||
network number NET with the local address HOST. */
|
||||
extern struct in_addr inet_makeaddr __P ((u_int32_t __net, u_int32_t __host));
|
||||
|
||||
/* Format a network number NET into presentation format and place result
|
||||
in buffer starting at BUF with length of LEN bytes. */
|
||||
extern char *inet_neta __P ((u_long __net, char *__buf, size_t __len));
|
||||
|
||||
/* Return network number part of the Internet address IN. */
|
||||
extern u_int32_t inet_netof __P ((struct in_addr __in));
|
||||
|
||||
/* Extract the network number in network byte order from the address
|
||||
in numbers-and-dots natation starting at CP. */
|
||||
extern u_int32_t inet_network __P ((__const char *__cp));
|
||||
|
||||
/* Convert network number for interface type AF in buffer starting at
|
||||
CP to presentation format. The result will specifiy BITS bits of
|
||||
the number. */
|
||||
extern char *inet_net_ntop __P((int __af, __const void *__cp, int __bits,
|
||||
char *__buf, size_t __len));
|
||||
|
||||
/* Convert network number for interface type AF from presentation in
|
||||
buffer starting at CP to network format and store result int
|
||||
buffer starting at BUF of size LEN. */
|
||||
extern int inet_net_pton __P ((int __af, __const char *__cp,
|
||||
void *__buf, size_t __len));
|
||||
|
||||
/* Convert Internet number in IN to ASCII representation. The return value
|
||||
is a pointer to an internal array containing the string. */
|
||||
extern char *inet_ntoa __P ((struct in_addr __in));
|
||||
|
||||
/* Convert from presentation format of an Internet number in buffer
|
||||
starting at CP to the binary network format and store result for
|
||||
interface type AF in buffer starting at BUF. */
|
||||
extern int inet_pton __P ((int __af, __const char *__cp, void *__buf));
|
||||
|
||||
/* Convert a Internet address in binary network format for interface
|
||||
type AF in buffer starting at CP to presentation form and place
|
||||
result in buffer of length LEN astarting at BUF. */
|
||||
extern __const char *inet_ntop __P ((int __af, __const void *__cp,
|
||||
char *__buf, size_t __len));
|
||||
|
||||
/* Convert ASCII representation in hexadecimal form of the Internet
|
||||
address to binary form and place result in buffer of length LEN
|
||||
starting at BUF. */
|
||||
extern unsigned int inet_nsap_addr __P ((__const char *__cp,
|
||||
unsigned char *__buf, int __len));
|
||||
|
||||
/* Convert internet address in binary form in LEN bytes starting at CP
|
||||
a presentation form and place result in BUF. */
|
||||
extern char *inet_nsap_ntoa __P ((int __len, __const unsigned char *__cp,
|
||||
char *__buf));
|
||||
|
||||
__END_DECLS
|
||||
|
||||
#endif /* !_INET_H_ */
|
||||
#endif /* arpa/inet.h */
|
||||
|
||||
+89
-51
@@ -1,59 +1,97 @@
|
||||
/*
|
||||
* Copyright (c) 1983, 1993
|
||||
* The Regents of the University of California. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. All advertising materials mentioning features or use of this software
|
||||
* must display the following acknowledgement:
|
||||
* This product includes software developed by the University of
|
||||
* California, Berkeley and its contributors.
|
||||
* 4. Neither the name of the University nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*/
|
||||
/* Convert Inet number to ASCII representation.
|
||||
Copyright (C) 1997 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
|
||||
|
||||
#if defined(LIBC_SCCS) && !defined(lint)
|
||||
static char sccsid[] = "@(#)inet_ntoa.c 8.1 (Berkeley) 6/4/93";
|
||||
#endif /* LIBC_SCCS and not lint */
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Library General Public License as
|
||||
published by the Free Software Foundation; either version 2 of the
|
||||
License, or (at your option) any later version.
|
||||
|
||||
The GNU C Library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Library General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Library General Public
|
||||
License along with the GNU C Library; see the file COPYING.LIB. If not,
|
||||
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||
Boston, MA 02111-1307, USA. */
|
||||
|
||||
/*
|
||||
* Convert network-format internet address
|
||||
* to base 256 d.d.d.d representation.
|
||||
*/
|
||||
#include <sys/types.h>
|
||||
#include <netinet/in.h>
|
||||
#include <arpa/inet.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <arpa/inet.h>
|
||||
#include <libc-lock.h>
|
||||
|
||||
/* The interface of this function is completely stupid, it requires a
|
||||
static buffer. We relax this a bit in that we allow at least one
|
||||
buffer for each thread. */
|
||||
__libc_lock_define_initialized (static, lock);
|
||||
|
||||
/* This is the key for the thread specific memory. */
|
||||
static __libc_key_t key;
|
||||
|
||||
/* Destructor for the thread-specific data. */
|
||||
static void free_key_mem (void *mem);
|
||||
|
||||
|
||||
char *
|
||||
inet_ntoa(in)
|
||||
struct in_addr in;
|
||||
inet_ntoa (struct in_addr in)
|
||||
{
|
||||
static char b[18];
|
||||
register char *p;
|
||||
static char static_buf[18];
|
||||
static int initialized = 0;
|
||||
char *buffer = NULL;
|
||||
unsigned char *bytes;
|
||||
|
||||
p = (char *)∈
|
||||
#define UC(b) (((int)b)&0xff)
|
||||
(void)snprintf(b, sizeof(b),
|
||||
"%d.%d.%d.%d", UC(p[0]), UC(p[1]), UC(p[2]), UC(p[3]));
|
||||
return (b);
|
||||
/* If we have not yet initialized the buffer do it now. */
|
||||
if (!initialized)
|
||||
{
|
||||
/* Make sure there is only one process doing the initialization. */
|
||||
__libc_lock_lock (lock);
|
||||
|
||||
if (!initialized)
|
||||
{
|
||||
if (__libc_key_create (&key, free_key_mem))
|
||||
/* Creating the key failed. This either means we run
|
||||
have only a single-threaded application or something
|
||||
really went wrong. In any case use a static buffer
|
||||
which is better than nothing. */
|
||||
buffer = static_buf;
|
||||
}
|
||||
|
||||
__libc_lock_unlock (lock);
|
||||
}
|
||||
|
||||
if (buffer == NULL)
|
||||
{
|
||||
/* We don't use the static buffer and so we have a key. Use it
|
||||
to get the thread-specific buffer. */
|
||||
buffer = __libc_getspecific (key);
|
||||
if (buffer == NULL)
|
||||
{
|
||||
/* No buffer allocated so far. */
|
||||
buffer = malloc (18);
|
||||
if (buffer == NULL)
|
||||
/* No more memory available. We use the static buffer. */
|
||||
buffer = static_buf;
|
||||
else
|
||||
__libc_setspecific (key, buffer);
|
||||
}
|
||||
}
|
||||
|
||||
bytes = (unsigned char *) ∈
|
||||
snprintf (buffer, 18, "%d.%d.%d.%d", bytes[0], bytes[1], bytes[2], bytes[3]);
|
||||
|
||||
return buffer;
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
free_key_mem (void *mem)
|
||||
{
|
||||
free (mem);
|
||||
|
||||
/* And we must set the data to NULL so that the destructor is not
|
||||
called again. */
|
||||
__libc_setspecific (key, NULL);
|
||||
}
|
||||
|
||||
+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 (__access (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') {
|
||||
|
||||
+1
-1
@@ -53,7 +53,7 @@ int
|
||||
rexec(ahost, rport, name, pass, cmd, fd2p)
|
||||
char **ahost;
|
||||
int rport;
|
||||
char *name, *pass, *cmd;
|
||||
const char *name, *pass, *cmd;
|
||||
int *fd2p;
|
||||
{
|
||||
struct sockaddr_in sin, sin2, from;
|
||||
|
||||
@@ -0,0 +1,412 @@
|
||||
/* Check system header files for ISO 9899:1990 (ISO C) compliance.
|
||||
Copyright (C) 1996, 1997 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
Contributed by Jens Schweikhardt <schweikh@noc.dfn.de>, 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 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. */
|
||||
|
||||
/* This is a simple minded program that tries to find illegal macro
|
||||
definitions in system header files. Illegal macro definitions are
|
||||
those not from the implementation namespace (i.e. not starting with
|
||||
an underscore) or not matching any identifier mandated by The
|
||||
Standard. Some common macro names are considered okay, e.g. all those
|
||||
beginning with E (which may be defined in <errno.h>) or ending in
|
||||
_MAX. See the arrays prefix[] and suffix[] below for details.
|
||||
|
||||
In a compliant implementation no other macros can be defined, because
|
||||
you could write strictly conforming programs that may fail to compile
|
||||
due to syntax errors: suppose <stdio.h> defines PIPE_BUF, then the
|
||||
conforming
|
||||
|
||||
#include <assert.h>
|
||||
#include <stdio.h> <- or where the bogus macro is defined
|
||||
#include <string.h>
|
||||
#define STR(x) #x
|
||||
#define XSTR(x) STR(x)
|
||||
int main (void)
|
||||
{
|
||||
int PIPE_BUF = 0;
|
||||
assert (strcmp ("PIPE_BUF", XSTR (PIPE_BUF)) == 0);
|
||||
return 0;
|
||||
}
|
||||
|
||||
is expected to compile and meet the assertion. If it does not, your
|
||||
compiler compiles some other language than Standard C.
|
||||
|
||||
REQUIREMENTS:
|
||||
This program calls gcc to get the list of defined macros. If you
|
||||
don't have gcc you're probably out of luck unless your compiler or
|
||||
preprocessor has something similar to gcc's -dM option. Tune
|
||||
PRINT_MACROS in this case. This program assumes headers are found
|
||||
under /usr/include and that there is a writable /tmp directory.
|
||||
Tune SYSTEM_INCLUDE and TMPFILE if your system differs.
|
||||
#define BROKEN_SYSTEM if system(NULL) bombs -- one more violation
|
||||
of ISO C, by the way.
|
||||
|
||||
OUTPUT:
|
||||
Each header file name is printed, followed by illegal macro names
|
||||
and their definition. For the above example, you would see
|
||||
...
|
||||
/usr/include/stdio.h
|
||||
#define PIPE_BUF 5120
|
||||
...
|
||||
If your implementation does not yet incorporate Amendment 1 you
|
||||
will see messages about iso646.h, wctype.h and wchar.h not being
|
||||
found. */
|
||||
|
||||
#ifndef _GNU_SOURCE
|
||||
# define _GNU_SOURCE 1
|
||||
#endif
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
#define TMPFILE "/tmp/macros"
|
||||
#define HEADER_MAX 256
|
||||
|
||||
/* ISO C header names including Amendment 1 (without ".h" suffix). */
|
||||
static char *header[] =
|
||||
{
|
||||
"assert", "ctype", "errno", "float", "iso646", "limits", "locale",
|
||||
"math", "setjmp", "signal", "stdarg", "stddef", "stdio", "stdlib",
|
||||
"string", "time", "wchar", "wctype"
|
||||
};
|
||||
|
||||
/* Macros with these prefixes are considered okay. */
|
||||
static char *prefix[] =
|
||||
{
|
||||
"_", "E", "is", "str", "mem", "SIG", "FLT_", "DBL_", "LDBL_",
|
||||
"LC_", "wmem", "wcs"
|
||||
};
|
||||
|
||||
/* Macros with these suffixes are considered okay. Will not work for
|
||||
parametrized macros with arguments. */
|
||||
static char *suffix[] =
|
||||
{
|
||||
"_MAX", "_MIN"
|
||||
};
|
||||
|
||||
/* These macros are considered okay. In fact, these are just more prefixes. */
|
||||
static char *macros[] =
|
||||
{
|
||||
"BUFSIZ", "CHAR_BIT", "CHAR_MAX", "CHAR_MIN", "CLOCKS_PER_SEC",
|
||||
"DBL_DIG", "DBL_EPSILON", "DBL_MANT_DIG", "DBL_MAX",
|
||||
"DBL_MAX_10_EXP", "DBL_MAX_EXP", "DBL_MIN", "DBL_MIN_10_EXP",
|
||||
"DBL_MIN_EXP", "EDOM", "EILSEQ", "EOF", "ERANGE", "EXIT_FAILURE",
|
||||
"EXIT_SUCCESS", "FILENAME_MAX", "FLT_DIG", "FLT_EPSILON",
|
||||
"FLT_MANT_DIG", "FLT_MAX", "FLT_MAX_10_EXP", "FLT_MAX_EXP",
|
||||
"FLT_MIN", "FLT_MIN_10_EXP", "FLT_MIN_EXP", "FLT_RADIX",
|
||||
"FLT_ROUNDS", "FOPEN_MAX", "HUGE_VAL", "INT_MAX", "INT_MIN",
|
||||
"LC_ALL", "LC_COLLATE", "LC_CTYPE", "LC_MONETARY", "LC_NUMERIC",
|
||||
"LC_TIME", "LDBL_DIG", "LDBL_EPSILON", "LDBL_MANT_DIG", "LDBL_MAX",
|
||||
"LDBL_MAX_10_EXP", "LDBL_MAX_EXP", "LDBL_MIN", "LDBL_MIN_10_EXP",
|
||||
"LDBL_MIN_EXP", "LONG_MAX", "LONG_MIN", "L_tmpnam", "MB_CUR_MAX",
|
||||
"MB_LEN_MAX", "NDEBUG", "NULL", "RAND_MAX", "SCHAR_MAX",
|
||||
"SCHAR_MIN", "SEEK_CUR", "SEEK_END", "SEEK_SET", "SHRT_MAX",
|
||||
"SHRT_MIN", "SIGABRT", "SIGFPE", "SIGILL", "SIGINT", "SIGSEGV",
|
||||
"SIGTERM", "SIG_DFL", "SIG_ERR", "SIG_IGN", "TMP_MAX", "UCHAR_MAX",
|
||||
"UINT_MAX", "ULONG_MAX", "USHRT_MAX", "WCHAR_MAX", "WCHAR_MIN",
|
||||
"WEOF", "_IOFBF", "_IOLBF", "_IONBF", "abort", "abs", "acos",
|
||||
"acosf", "acosl", "and", "and_eq", "asctime", "asin", "asinf",
|
||||
"asinl", "assert", "atan", "atan2", "atan2f", "atan2l", "atanf",
|
||||
"atanl", "atexit", "atof", "atoi", "atol", "bitand", "bitor",
|
||||
"bsearch", "btowc", "calloc", "ceil", "ceilf", "ceill", "clearerr",
|
||||
"clock", "clock_t", "compl", "cos", "cosf", "cosh", "coshf",
|
||||
"coshl", "cosl", "ctime", "difftime", "div", "div_t", "errno",
|
||||
"exit", "exp", "expf", "expl", "fabs", "fabsf", "fabsl", "fclose",
|
||||
"feof", "ferror", "fflush", "fgetc", "fgetpos", "fgets", "fgetwc",
|
||||
"fgetws", "floor", "floorf", "floorl", "fmod", "fmodf", "fmodl",
|
||||
"fopen", "fprintf", "fputc", "fputs", "fputwc", "fputws", "fread",
|
||||
"free", "freopen", "frexp", "frexpf", "frexpl", "fscanf", "fseek",
|
||||
"fsetpos", "ftell", "fwide", "fwprintf", "fwrite", "fwscanf",
|
||||
"getc", "getchar", "getenv", "gets", "getwc", "getwchar", "gmtime",
|
||||
"isalnum", "isalpha", "iscntrl", "isdigit", "isgraph", "islower",
|
||||
"isprint", "ispunct", "isspace", "isupper", "iswalnum", "iswalpha",
|
||||
"iswcntrl", "iswctype", "iswdigit", "iswgraph", "iswlower",
|
||||
"iswprint", "iswpunct", "iswspace", "iswupper", "iswxdigit",
|
||||
"isxdigit", "labs", "ldexp", "ldexpf", "ldexpl", "ldiv", "ldiv_t",
|
||||
"localeconv", "localtime", "log", "log10", "log10f", "log10l",
|
||||
"logf", "logl", "longjmp", "malloc", "mblen", "mbrlen", "mbrtowc",
|
||||
"mbsinit", "mbsrtowcs", "mbstate_t", "mbstowcs", "mbtowc", "memchr",
|
||||
"memcmp", "memcpy", "memmove", "memset", "mktime", "modf", "modff",
|
||||
"modfl", "not", "not_eq", "offsetof", "or", "or_eq", "perror",
|
||||
"pow", "powf", "powl", "printf", "ptrdiff_t", "putc", "putchar",
|
||||
"puts", "putwc", "putwchar", "qsort", "raise", "rand", "realloc",
|
||||
"remove", "rename", "rewind", "scanf", "setbuf", "setjmp",
|
||||
"setlocale", "setvbuf", "sig_atomic_t", "signal", "sin", "sinf",
|
||||
"sinh", "sinhf", "sinhl", "sinl", "size_t", "sprintf", "sqrt",
|
||||
"sqrtf", "sqrtl", "srand", "sscanf", "stderr", "stdin", "stdout",
|
||||
"strcat", "strchr", "strcmp", "strcoll", "strcpy", "strcspn",
|
||||
"strerror", "strftime", "strlen", "strncat", "strncmp", "strncpy",
|
||||
"strpbrk", "strrchr", "strspn", "strstr", "strtod", "strtok",
|
||||
"strtol", "strtoul", "strxfrm", "swprintf", "swscanf", "system",
|
||||
"tan", "tanf", "tanh", "tanhf", "tanhl", "tanl", "time", "time_t",
|
||||
"tmpfile", "tmpnam", "tolower", "toupper", "towctrans", "towlower",
|
||||
"towupper", "ungetc", "ungetwc", "va_arg", "va_end", "va_start",
|
||||
"vfprintf", "vfwprintf", "vprintf", "vsprintf", "vswprintf",
|
||||
"vwprintf", "wchar_t", "wcrtomb", "wcscat", "wcschr", "wcscmp",
|
||||
"wcscoll", "wcscpy", "wcscspn", "wcsftime", "wcslen", "wcsncat",
|
||||
"wcsncmp", "wcsncpy", "wcspbrk", "wcsrchr", "wcsrtombs", "wcsspn",
|
||||
"wcsstr", "wcstod", "wcstok", "wcstol", "wcstombs", "wcstoul",
|
||||
"wcsxfrm", "wctob", "wctomb", "wctrans", "wctrans_t", "wctype",
|
||||
"wctype_t", "wint_t", "wmemchr", "wmemcmp", "wmemcpy", "wmemmove",
|
||||
"wmemset", "wprintf", "wscanf", "xor", "xor_eq"
|
||||
};
|
||||
|
||||
#define NUMBER_OF_HEADERS (sizeof header / sizeof *header)
|
||||
#define NUMBER_OF_PREFIXES (sizeof prefix / sizeof *prefix)
|
||||
#define NUMBER_OF_SUFFIXES (sizeof suffix / sizeof *suffix)
|
||||
#define NUMBER_OF_MACROS (sizeof macros / sizeof *macros)
|
||||
|
||||
|
||||
/* Format string to build command to invoke compiler. */
|
||||
static const char fmt[] = "\
|
||||
echo \"#include <%s>\" |\
|
||||
%s -E -dM -ansi -pedantic %s -D_LIBC -I. -I `%s --print-prog-name=include` -\
|
||||
> %s";
|
||||
|
||||
|
||||
/* The compiler we use (given on the command line). */
|
||||
char *CC;
|
||||
/* The -I parameters for CC to find all headers. */
|
||||
char *INC;
|
||||
|
||||
static const char **get_null_defines (void);
|
||||
static int check_header (const char *, const char **);
|
||||
|
||||
int
|
||||
main (int argc, char *argv[])
|
||||
{
|
||||
int h;
|
||||
int result = 0;
|
||||
const char **ignore_list;
|
||||
|
||||
CC = argc > 1 ? argv[1] : "gcc";
|
||||
INC = argc > 2 ? argv[2] : "";
|
||||
|
||||
if (system (NULL) == 0)
|
||||
{
|
||||
puts ("Sorry, no command processor.");
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
|
||||
/* First get list of symbols which are defined by the compiler. */
|
||||
ignore_list = get_null_defines ();
|
||||
|
||||
fputs ("Tested files:\n", stdout);
|
||||
|
||||
for (h = 0; h < NUMBER_OF_HEADERS; ++h)
|
||||
{
|
||||
char file_name[HEADER_MAX];
|
||||
sprintf (file_name, "%s.h", header[h]);
|
||||
result |= check_header (file_name, ignore_list);
|
||||
}
|
||||
|
||||
/* The test suite should return errors but for now this is not
|
||||
practical. Give a warning and ask the user to correct the bugs. */
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
static const char **
|
||||
get_null_defines (void)
|
||||
{
|
||||
char line[BUFSIZ], *command;
|
||||
char **result = NULL;
|
||||
size_t result_len = 0;
|
||||
size_t result_max = 0;
|
||||
FILE *input;
|
||||
int first = 1;
|
||||
|
||||
command = malloc (sizeof fmt + sizeof "/dev/null" + 2 * strlen (CC)
|
||||
+ strlen (INC) + strlen (TMPFILE));
|
||||
|
||||
if (command == NULL)
|
||||
{
|
||||
puts ("No more memory.");
|
||||
exit (1);
|
||||
}
|
||||
|
||||
sprintf (command, fmt, "/dev/null", CC, INC, CC, TMPFILE);
|
||||
|
||||
if (system (command))
|
||||
{
|
||||
puts ("system() returned nonzero");
|
||||
return NULL;
|
||||
}
|
||||
free (command);
|
||||
input = fopen (TMPFILE, "r");
|
||||
|
||||
if (input == NULL)
|
||||
{
|
||||
printf ("Could not read %s: ", TMPFILE);
|
||||
perror (NULL);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
while (fgets (line, sizeof line, input) != NULL)
|
||||
{
|
||||
int i, okay = 0;
|
||||
size_t endmac;
|
||||
char *start, *end;
|
||||
if (strlen (line) < 9 || line[7] != ' ')
|
||||
{ /* "#define A" */
|
||||
printf ("Malformed input, expected '#define MACRO'\ngot '%s'\n",
|
||||
line);
|
||||
continue;
|
||||
}
|
||||
if (line[8] == '_')
|
||||
/* It's a safe identifier. */
|
||||
continue;
|
||||
if (result_len == result_max)
|
||||
{
|
||||
result_max += 10;
|
||||
result = realloc (result, result_max * sizeof (char **));
|
||||
if (result == NULL)
|
||||
{
|
||||
puts ("No more memory.");
|
||||
exit (1);
|
||||
}
|
||||
}
|
||||
start = &line[8];
|
||||
for (end = start + 1; !isspace (*end) && *end != '\0'; ++end)
|
||||
;
|
||||
result[result_len++] = strndup (start, end - start);
|
||||
|
||||
if (first)
|
||||
{
|
||||
fputs ("The following identifiers will be ignored since the compiler defines them\nby default:\n", stdout);
|
||||
first = 0;
|
||||
}
|
||||
puts (result[result_len - 1]);
|
||||
}
|
||||
fclose (input);
|
||||
remove (TMPFILE);
|
||||
|
||||
return (const char **) result;
|
||||
}
|
||||
|
||||
|
||||
static int
|
||||
check_header (const char *file_name, const char **except)
|
||||
{
|
||||
char line[BUFSIZ], *command;
|
||||
FILE *input;
|
||||
int result = 0;
|
||||
|
||||
command = malloc (sizeof fmt + strlen (file_name) + 2 * strlen (CC)
|
||||
+ strlen (INC) + strlen (TMPFILE));
|
||||
|
||||
if (command == NULL)
|
||||
{
|
||||
puts ("No more memory.");
|
||||
exit (1);
|
||||
}
|
||||
|
||||
puts (file_name);
|
||||
sprintf (command, fmt, file_name, CC, INC, CC, TMPFILE);
|
||||
|
||||
if (system (command))
|
||||
{
|
||||
puts ("system() returned nonzero");
|
||||
result = 1;
|
||||
}
|
||||
free (command);
|
||||
input = fopen (TMPFILE, "r");
|
||||
|
||||
if (input == NULL)
|
||||
{
|
||||
printf ("Could not read %s: ", TMPFILE);
|
||||
perror (NULL);
|
||||
return 1;
|
||||
}
|
||||
|
||||
while (fgets (line, sizeof line, input) != NULL)
|
||||
{
|
||||
int i, okay = 0;
|
||||
size_t endmac;
|
||||
const char **cpp;
|
||||
if (strlen (line) < 9 || line[7] != ' ')
|
||||
{ /* "#define A" */
|
||||
printf ("Malformed input, expected '#define MACRO'\ngot '%s'\n",
|
||||
line);
|
||||
result = 1;
|
||||
continue;
|
||||
}
|
||||
for (i = 0; i < NUMBER_OF_PREFIXES; ++i)
|
||||
{
|
||||
if (!strncmp (line+8, prefix[i], strlen (prefix[i]))) {
|
||||
++okay;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (okay)
|
||||
continue;
|
||||
for (i = 0; i < NUMBER_OF_MACROS; ++i)
|
||||
{
|
||||
if (!strncmp (line + 8, macros[i], strlen (macros[i])))
|
||||
{
|
||||
++okay;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (okay)
|
||||
continue;
|
||||
/* Find next char after the macro identifier; this can be either
|
||||
a space or an open parenthesis. */
|
||||
endmac = strcspn (line + 8, " (");
|
||||
if (line[8+endmac] == '\0')
|
||||
{
|
||||
printf ("malformed input, expected '#define MACRO VALUE'\n"
|
||||
"got '%s'\n", line);
|
||||
result = 1;
|
||||
continue;
|
||||
}
|
||||
for (i = 0; i < NUMBER_OF_SUFFIXES; ++i)
|
||||
{
|
||||
size_t len = strlen (suffix[i]);
|
||||
if (!strncmp (line + 8 + endmac - len, suffix[i], len))
|
||||
{
|
||||
++okay;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (okay)
|
||||
continue;
|
||||
if (except != NULL)
|
||||
for (cpp = except; *cpp != NULL; ++cpp)
|
||||
{
|
||||
size_t len = strlen (*cpp);
|
||||
if (!strncmp (line + 8, *cpp, len) && isspace (line[8 + len]))
|
||||
{
|
||||
++okay;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (!okay)
|
||||
{
|
||||
fputs (line, stdout);
|
||||
result = 2;
|
||||
}
|
||||
}
|
||||
fclose (input);
|
||||
remove (TMPFILE);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
/* EOF */
|
||||
+1
-5
@@ -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
|
||||
@@ -28,7 +28,3 @@ clearerr (fp)
|
||||
_IO_clearerr (fp);
|
||||
_IO_funlockfile (fp);
|
||||
}
|
||||
|
||||
#ifdef _IO_MTSAFE_IO
|
||||
weak_alias (clearerr, clearerr_locked)
|
||||
#endif
|
||||
|
||||
@@ -36,11 +36,3 @@ _IO_feof (fp)
|
||||
return result;
|
||||
}
|
||||
weak_alias (_IO_feof, feof)
|
||||
|
||||
#ifdef _IO_MTSAFE_IO
|
||||
/* The feof implementation for libio does not require locking because
|
||||
it only accesses once a single variable and this is already atomic
|
||||
(at least at thread level). */
|
||||
|
||||
weak_alias (_IO_feof, feof_locked)
|
||||
#endif
|
||||
|
||||
@@ -36,8 +36,3 @@ _IO_ferror (fp)
|
||||
return result;
|
||||
}
|
||||
weak_alias (_IO_ferror, ferror)
|
||||
|
||||
#ifdef _IO_MTSAFE_IO
|
||||
|
||||
weak_alias (ferror, ferror_locked)
|
||||
#endif
|
||||
|
||||
@@ -43,5 +43,4 @@ fileno (fp)
|
||||
(at least at thread level). */
|
||||
|
||||
weak_alias (fileno, fileno_unlocked)
|
||||
weak_alias (fileno, fileno_locked)
|
||||
#endif
|
||||
|
||||
+4
-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 *
|
||||
@@ -317,6 +317,7 @@ DEFUN(_IO_file_overflow, (f, ch),
|
||||
{
|
||||
if (f->_flags & _IO_NO_WRITES) /* SET ERROR */
|
||||
{
|
||||
f->_flags |= _IO_ERR_SEEN;
|
||||
__set_errno (EBADF);
|
||||
return EOF;
|
||||
}
|
||||
|
||||
@@ -38,5 +38,3 @@ fputc (c, fp)
|
||||
_IO_cleanup_region_end (1);
|
||||
return result;
|
||||
}
|
||||
|
||||
weak_alias (fputc, fputc_locked)
|
||||
|
||||
+3
-3
@@ -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))
|
||||
@@ -615,7 +615,7 @@ DEFUN_VOID(_IO_flush_all_linebuffered)
|
||||
{
|
||||
_IO_FILE *fp;
|
||||
for (fp = _IO_list_all; fp != NULL; fp = fp->_chain)
|
||||
if (fp->_flags & _IO_LINE_BUF)
|
||||
if ((fp->_flags & _IO_NO_WRITES) == 0 && fp->_flags & _IO_LINE_BUF)
|
||||
_IO_OVERFLOW (fp, EOF);
|
||||
}
|
||||
|
||||
|
||||
@@ -41,9 +41,3 @@ _IO_getc (fp)
|
||||
}
|
||||
#undef getc
|
||||
weak_alias (_IO_getc, getc)
|
||||
|
||||
#ifdef _IO_MTSAFE_IO
|
||||
# undef getc_locked
|
||||
|
||||
weak_alias (getc, getc_locked)
|
||||
#endif
|
||||
|
||||
@@ -37,9 +37,3 @@ getchar ()
|
||||
_IO_cleanup_region_end (1);
|
||||
return result;
|
||||
}
|
||||
|
||||
#ifdef _IO_MTSAFE_IO
|
||||
# undef getchar_locked
|
||||
|
||||
weak_alias (getchar, getchar_locked)
|
||||
#endif
|
||||
|
||||
@@ -44,7 +44,3 @@ _IO_fflush (fp)
|
||||
}
|
||||
|
||||
weak_alias (_IO_fflush, fflush)
|
||||
|
||||
#ifdef _IO_MTSAFE_IO
|
||||
weak_alias (_IO_fflush, fflush_locked)
|
||||
#endif
|
||||
|
||||
+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*));
|
||||
|
||||
+5
-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
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
+14
-20
@@ -1,20 +1,20 @@
|
||||
/* Copyright (C) 1991, 1995, 1996 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
/* Copyright (C) 1991, 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. */
|
||||
|
||||
#include "libioP.h"
|
||||
#include "stdio.h"
|
||||
@@ -36,9 +36,3 @@ _IO_putc (c, fp)
|
||||
}
|
||||
#undef putc
|
||||
weak_alias (_IO_putc, putc)
|
||||
|
||||
#ifdef _IO_MTSAFE_IO
|
||||
# undef putc_locked
|
||||
|
||||
weak_alias (putc, putc_locked)
|
||||
#endif
|
||||
|
||||
+14
-20
@@ -1,20 +1,20 @@
|
||||
/* Copyright (C) 1991, 1995, 1996 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
/* Copyright (C) 1991, 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. */
|
||||
|
||||
#include "libioP.h"
|
||||
#include "stdio.h"
|
||||
@@ -33,9 +33,3 @@ putchar (c)
|
||||
__libc_cleanup_region_end (1);
|
||||
return result;
|
||||
}
|
||||
|
||||
#ifdef _IO_MTSAFE_IO
|
||||
# undef putchar_locked
|
||||
|
||||
weak_alias (putchar, putchar_locked)
|
||||
#endif
|
||||
|
||||
+523
-209
@@ -1,209 +1,191 @@
|
||||
/* This is part of the iostream/stdio library, providing -*- C -*- I/O.
|
||||
Define ANSI C stdio on top of C++ iostreams.
|
||||
/* Define ISO C stdio on top of C++ iostreams.
|
||||
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
|
||||
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.
|
||||
|
||||
This 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 this library; 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. */
|
||||
|
||||
/*
|
||||
* ISO C Standard: 4.9 INPUT/OUTPUT <stdio.h>
|
||||
*/
|
||||
|
||||
#ifndef _STDIO_H
|
||||
#define _STDIO_H
|
||||
|
||||
#if !defined __need_FILE
|
||||
#define _STDIO_H 1
|
||||
#include <features.h>
|
||||
|
||||
__BEGIN_DECLS
|
||||
|
||||
#define __need_size_t
|
||||
#define __need_NULL
|
||||
#include <stddef.h>
|
||||
|
||||
#include <gnu/types.h>
|
||||
#endif /* Don't need FILE. */
|
||||
#undef __need_FILE
|
||||
|
||||
|
||||
#ifndef __FILE_defined
|
||||
|
||||
/* The opaque type of streams. */
|
||||
typedef struct _IO_FILE FILE;
|
||||
|
||||
#define __FILE_defined 1
|
||||
#endif /* FILE not defined. */
|
||||
|
||||
|
||||
#ifdef _STDIO_H
|
||||
#define _STDIO_USES_IOSTREAM
|
||||
|
||||
#include <libio.h>
|
||||
|
||||
#ifndef NULL
|
||||
#ifdef __cplusplus
|
||||
#define NULL 0
|
||||
#else
|
||||
#define NULL (void*)0
|
||||
#endif
|
||||
#endif
|
||||
/* The type of the second argument to `fgetpos' and `fsetpos'. */
|
||||
typedef _G_fpos_t fpos_t;
|
||||
|
||||
#ifndef EOF
|
||||
#define EOF (-1)
|
||||
#endif
|
||||
|
||||
/* Generate a unique file name (and possibly open it with mode "w+b"). */
|
||||
extern char *__stdio_gen_tempname __P ((char *__buf, size_t __bufsize,
|
||||
__const char *__dir,
|
||||
__const char *__pfx,
|
||||
int __dir_search,
|
||||
size_t *__lenptr,
|
||||
FILE **__streamptr));
|
||||
|
||||
|
||||
/* Print out MESSAGE on the error output and abort. */
|
||||
extern void __libc_fatal __P ((__const char *__message))
|
||||
__attribute__ ((__noreturn__));
|
||||
|
||||
|
||||
/* The possibilities for the third argument to `setvbuf'. */
|
||||
#define _IOFBF 0 /* Fully buffered. */
|
||||
#define _IOLBF 1 /* Line buffered. */
|
||||
#define _IONBF 2 /* No buffering. */
|
||||
|
||||
|
||||
/* Default buffer size. */
|
||||
#ifndef BUFSIZ
|
||||
#define BUFSIZ _IO_BUFSIZ
|
||||
#endif
|
||||
|
||||
#define _IOFBF 0 /* Fully buffered. */
|
||||
#define _IOLBF 1 /* Line buffered. */
|
||||
#define _IONBF 2 /* No buffering. */
|
||||
|
||||
#define SEEK_SET 0
|
||||
#define SEEK_CUR 1
|
||||
#define SEEK_END 2
|
||||
|
||||
/* define size_t. Crud in case <sys/types.h> has defined it. */
|
||||
#if !defined(_SIZE_T) && !defined(_T_SIZE_) && !defined(_T_SIZE)
|
||||
#if !defined(__SIZE_T) && !defined(_SIZE_T_) && !defined(___int_size_t_h)
|
||||
#if !defined(_GCC_SIZE_T) && !defined(_SIZET_)
|
||||
#define _SIZE_T
|
||||
#define _T_SIZE_
|
||||
#define _T_SIZE
|
||||
#define __SIZE_T
|
||||
#define _SIZE_T_
|
||||
#define ___int_size_t_h
|
||||
#define _GCC_SIZE_T
|
||||
#define _SIZET_
|
||||
typedef _IO_size_t size_t;
|
||||
#endif
|
||||
#endif
|
||||
/* End of file character.
|
||||
Some things throughout the library rely on this being -1. */
|
||||
#ifndef EOF
|
||||
#define EOF (-1)
|
||||
#endif
|
||||
|
||||
typedef struct _IO_FILE FILE;
|
||||
typedef _IO_fpos_t fpos_t;
|
||||
|
||||
#include <stdio_lim.h>
|
||||
/* The possibilities for the third argument to `fseek'.
|
||||
These values should not be changed. */
|
||||
#define SEEK_SET 0 /* Seek from beginning of file. */
|
||||
#define SEEK_CUR 1 /* Seek from current position. */
|
||||
#define SEEK_END 2 /* Seek from end of file. */
|
||||
|
||||
|
||||
#ifdef __USE_SVID
|
||||
/* Default path prefix for `tempnam' and `tmpnam'. */
|
||||
#define P_tmpdir "/tmp"
|
||||
#endif
|
||||
|
||||
/* For use by debuggers. These are linked in if printf or fprintf are used. */
|
||||
extern FILE *stdin, *stdout, *stderr; /* TODO */
|
||||
|
||||
/* Get the values:
|
||||
L_tmpnam How long an array of chars must be to be passed to `tmpnam'.
|
||||
TMP_MAX The minimum number of unique filenames generated by tmpnam
|
||||
(and tempnam when it uses tmpnam's name space),
|
||||
or tempnam (the two are separate).
|
||||
L_ctermid How long an array to pass to `ctermid'.
|
||||
L_cuserid How long an array to pass to `cuserid'.
|
||||
FOPEN_MAX Minimum number of files that can be open at once.
|
||||
FILENAME_MAX Maximum length of a filename. */
|
||||
#include <stdio_lim.h>
|
||||
|
||||
|
||||
/* Standard streams. */
|
||||
extern FILE *stdin, *stdout, *stderr;
|
||||
/* Refer to the real names by default. */
|
||||
#define stdin _IO_stdin
|
||||
#define stdout _IO_stdout
|
||||
#define stderr _IO_stderr
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
|
||||
/* Remove file FILENAME. */
|
||||
extern int remove __P ((__const char *__filename));
|
||||
/* Rename file OLD to NEW. */
|
||||
extern int rename __P ((__const char *__old, __const char *__new));
|
||||
|
||||
|
||||
/* Create a temporary file and open it read/write. */
|
||||
extern FILE *tmpfile __P ((void));
|
||||
/* Generate a temporary filename. */
|
||||
extern char *tmpnam __P ((char *__s));
|
||||
|
||||
#ifdef __USE_MISC
|
||||
/* This is the reentrant variant of `tmpnam'. The only difference is
|
||||
that it does not allow S to be NULL. */
|
||||
extern char *tmpnam_r __P ((char *__s));
|
||||
#endif
|
||||
|
||||
#ifndef __P
|
||||
#if defined(__STDC__) || defined(__cplusplus) || defined(c_plusplus)
|
||||
#define __P(args) args
|
||||
#else
|
||||
#define __P(args) ()
|
||||
#endif
|
||||
#endif /*!__P*/
|
||||
|
||||
extern void clearerr __P ((FILE*));
|
||||
extern int fclose __P ((FILE*));
|
||||
extern int feof __P ((FILE*));
|
||||
extern int ferror __P ((FILE*));
|
||||
extern int fflush __P ((FILE*));
|
||||
extern int fgetc __P ((FILE *));
|
||||
extern int fgetpos __P ((FILE* fp, fpos_t *pos));
|
||||
extern char* fgets __P ((char*, int, FILE*));
|
||||
extern FILE* fopen __P ((__const char*, __const char*));
|
||||
extern FILE* fopencookie __P ((void *cookie, __const char *mode,
|
||||
_IO_cookie_io_functions_t io_functions));
|
||||
extern int fprintf __P ((FILE*, __const char* format, ...));
|
||||
extern int fputc __P ((int, FILE*));
|
||||
extern int fputs __P ((__const char *str, FILE *fp));
|
||||
extern size_t fread __P ((void*, size_t, size_t, FILE*));
|
||||
extern FILE* freopen __P ((__const char*, __const char*, FILE*));
|
||||
extern int fscanf __P ((FILE *fp, __const char* format, ...));
|
||||
extern int fseek __P ((FILE* fp, long int offset, int whence));
|
||||
extern int fsetpos __P ((FILE* fp, __const fpos_t *pos));
|
||||
extern long int ftell __P ((FILE* fp));
|
||||
extern size_t fwrite __P ((__const void*, size_t, size_t, FILE*));
|
||||
extern int getc __P ((FILE *));
|
||||
extern int getchar __P ((void));
|
||||
extern char* gets __P ((char*));
|
||||
extern void perror __P ((__const char *));
|
||||
extern int printf __P ((__const char* format, ...));
|
||||
extern int putc __P ((int, FILE *));
|
||||
extern int putchar __P ((int));
|
||||
extern int puts __P ((__const char *str));
|
||||
extern int remove __P ((__const char*));
|
||||
extern int rename __P ((__const char* _old, __const char* _new));
|
||||
extern void rewind __P ((FILE*));
|
||||
extern int scanf __P ((__const char* format, ...));
|
||||
extern void setbuf __P ((FILE*, char*));
|
||||
extern void setlinebuf __P ((FILE*));
|
||||
extern void setbuffer __P ((FILE*, char*, int));
|
||||
extern int setvbuf __P ((FILE*, char*, int mode, size_t size));
|
||||
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_MISC
|
||||
extern char* tmpnam_r __P ((char*));
|
||||
#endif
|
||||
#if defined(__USE_SVID) || defined(__USE_XOPEN)
|
||||
#if defined __USE_SVID || defined __USE_XOPEN
|
||||
/* Generate a unique temporary filename using up to five characters of PFX
|
||||
if it is not NULL. The directory to put this file in is searched for
|
||||
as follows: First the environment variable "TMPDIR" is checked.
|
||||
If it contains the name of a writable directory, that directory is used.
|
||||
If not and if DIR is not NULL, that value is checked. If that fails,
|
||||
P_tmpdir is tried and finally "/tmp". The storage for the filename
|
||||
is allocated by `malloc'. */
|
||||
extern char *tempnam __P ((__const char *__dir, __const char *__pfx));
|
||||
#endif
|
||||
extern char *__stdio_gen_tempname __P ((char *__buf, size_t bufsize,
|
||||
__const char *dir, __const char *pfx,
|
||||
int dir_search, size_t *lenptr,
|
||||
FILE **streamptr));
|
||||
extern int ungetc __P ((int c, FILE* fp));
|
||||
extern int vfprintf __P ((FILE *fp, char __const *fmt0, _G_va_list));
|
||||
extern int vprintf __P ((char __const *fmt, _G_va_list));
|
||||
extern int vsprintf __P ((char* string, __const char* format, _G_va_list));
|
||||
extern void __libc_fatal __P ((__const char *__message))
|
||||
__attribute__ ((__noreturn__));
|
||||
|
||||
#ifndef __STRICT_ANSI__
|
||||
extern int dprintf __P ((int, __const char *, ...));
|
||||
extern int vdprintf __P ((int, __const char *, _G_va_list));
|
||||
extern int vfscanf __P ((FILE*, __const char *, _G_va_list));
|
||||
extern int __vfscanf __P ((FILE*, __const char *, _G_va_list));
|
||||
extern int vscanf __P ((__const char *, _G_va_list));
|
||||
extern int vsscanf __P ((__const char *, __const char *, _G_va_list));
|
||||
extern int __vsscanf __P ((__const char *, __const char *, _G_va_list));
|
||||
|
||||
/* Close STREAM. */
|
||||
extern int fclose __P ((FILE *__stream));
|
||||
/* Flush STREAM, or all streams if STREAM is NULL. */
|
||||
extern int fflush __P ((FILE *__stream));
|
||||
|
||||
#ifdef __USE_MISC
|
||||
/* Faster versions when locking is not required. */
|
||||
extern int fclose_unlocked __P ((FILE *__stream));
|
||||
extern int fflush_unlocked __P ((FILE *__stream));
|
||||
#endif
|
||||
|
||||
#ifdef __USE_GNU
|
||||
/* Close all streams. */
|
||||
extern int __fcloseall __P ((void));
|
||||
extern int fcloseall __P ((void));
|
||||
|
||||
struct obstack;
|
||||
extern int obstack_vprintf __P ((struct obstack *__obstack,
|
||||
__const char *__fmt, _G_va_list));
|
||||
extern int obstack_printf __P ((struct obstack *__obstack, __const char *__fmt,
|
||||
...));
|
||||
#endif
|
||||
|
||||
#if !defined(__STRICT_ANSI__) || defined(_POSIX_SOURCE)
|
||||
extern FILE *fdopen __P ((int, __const char *));
|
||||
extern int fileno __P ((FILE*));
|
||||
extern FILE* popen __P ((__const char*, __const char*));
|
||||
extern int pclose __P ((FILE*));
|
||||
|
||||
#define L_ctermid 9
|
||||
#define L_cuserid 9
|
||||
/* Open a file and create a new stream for it. */
|
||||
extern FILE *fopen __P ((__const char *__filename, __const char *__modes));
|
||||
/* Open a file, replacing an existing stream with it. */
|
||||
extern FILE *freopen __P ((__const char *__restrict __filename,
|
||||
__const char *__restrict __modes,
|
||||
FILE *__restrict __stream));
|
||||
|
||||
/* Return the name of the controlling terminal. */
|
||||
extern char *ctermid __P ((char *__buf));
|
||||
|
||||
/* Get character login name of the user. */
|
||||
extern char *cuserid __P ((char * __buf));
|
||||
#ifdef __USE_POSIX
|
||||
/* Create a new stream that refers to an existing system file descriptor. */
|
||||
extern FILE *fdopen __P ((int __fd, __const char *__modes));
|
||||
#endif
|
||||
|
||||
#ifdef __USE_GNU
|
||||
extern _IO_ssize_t getdelim __P ((char **, size_t *, int, FILE*));
|
||||
extern _IO_ssize_t getline __P ((char **, size_t *, FILE *));
|
||||
extern _IO_ssize_t __getline __P ((char **, size_t *, FILE *));
|
||||
|
||||
extern int snprintf __P ((char *, size_t, __const char *, ...));
|
||||
extern int __snprintf __P ((char *, size_t, __const char *, ...));
|
||||
extern int vsnprintf __P ((char *, size_t, __const char *, _G_va_list));
|
||||
extern int __vsnprintf __P ((char *, size_t, __const char *, _G_va_list));
|
||||
|
||||
extern int asprintf __P ((char **, const char *, ...));
|
||||
extern int vasprintf __P ((char **, const char *, _G_va_list));
|
||||
#ifdef __USE_GNU
|
||||
/* Create a new stream that refers to the given magic cookie,
|
||||
and uses the given functions for input and output. */
|
||||
extern FILE *fopencookie __P ((void *__magic_cookie, __const char *__modes,
|
||||
_IO_cookie_io_functions_t __io_funcs));
|
||||
|
||||
/* Open a stream that writes into a malloc'd buffer that is expanded as
|
||||
necessary. *BUFLOC and *SIZELOC are updated with the buffer's location
|
||||
@@ -211,77 +193,409 @@ extern int vasprintf __P ((char **, const char *, _G_va_list));
|
||||
extern FILE *open_memstream __P ((char **__bufloc, size_t *__sizeloc));
|
||||
#endif
|
||||
|
||||
extern int __underflow __P ((struct _IO_FILE*));
|
||||
extern int __overflow __P ((struct _IO_FILE*, int));
|
||||
|
||||
#ifdef __USE_BSD
|
||||
extern int sys_nerr;
|
||||
extern const char *const sys_errlist[];
|
||||
#endif
|
||||
#ifdef __USE_GNU
|
||||
extern int _sys_nerr;
|
||||
extern const char *const _sys_errlist[];
|
||||
/* If BUF is NULL, make STREAM unbuffered.
|
||||
Else make it use buffer BUF, of size BUFSIZ. */
|
||||
extern void setbuf __P ((FILE *__restrict __stream, char *__restrict __buf));
|
||||
/* Make STREAM use buffering mode MODE.
|
||||
If BUF is not NULL, use N bytes of it for buffering;
|
||||
else allocate an internal buffer N bytes long. */
|
||||
extern int setvbuf __P ((FILE *__restrict __stream, char *__restrict __buf,
|
||||
int __modes, size_t __n));
|
||||
|
||||
#ifdef __USE_BSD
|
||||
/* If BUF is NULL, make STREAM unbuffered.
|
||||
Else make it use SIZE bytes of BUF for buffering. */
|
||||
extern void setbuffer __P ((FILE *__stream, char *__buf, size_t __size));
|
||||
|
||||
/* Make STREAM line-buffered. */
|
||||
extern void setlinebuf __P ((FILE *__stream));
|
||||
#endif
|
||||
|
||||
/* Handle locking of streams. */
|
||||
#ifdef __USE_MISC
|
||||
extern void clearerr_locked __P ((FILE *));
|
||||
extern void clearerr_unlocked __P ((FILE *));
|
||||
extern int feof_locked __P ((FILE *));
|
||||
extern int feof_unlocked __P ((FILE *));
|
||||
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 int fclose_unlocked __P ((FILE *));
|
||||
extern int fflush_locked __P ((FILE *));
|
||||
extern int fflush_unlocked __P ((FILE *));
|
||||
extern size_t fread_unlocked __P ((void *, size_t, size_t, FILE *));
|
||||
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 getchar_locked __P ((void));
|
||||
extern int putc_locked __P ((int, FILE *));
|
||||
extern int putchar_locked __P ((int));
|
||||
/* Write formatted output to STREAM. */
|
||||
extern int fprintf __P ((FILE *__restrict __stream,
|
||||
__const char *__restrict __format, ...));
|
||||
/* Write formatted output to stdout. */
|
||||
extern int printf __P ((__const char *__restrict __format, ...));
|
||||
/* Write formatted output to S. */
|
||||
extern int sprintf __P ((char *__restrict __s,
|
||||
__const char *__restrict __format, ...));
|
||||
|
||||
# ifndef _LIBC
|
||||
# define getc_locked(fp) _IO_getc (fp)
|
||||
# define getchar_locked() _IO_getc (stdin)
|
||||
# define putchar_locked(c) _IO_putc (c, stdout)
|
||||
# endif
|
||||
/* Write formatted output to S from argument list ARG. */
|
||||
extern int vfprintf __P ((FILE *__restrict __s,
|
||||
__const char *__restrict __format,
|
||||
_G_va_list __arg));
|
||||
/* Write formatted output to stdout from argument list ARG. */
|
||||
extern int vprintf __P ((__const char *__restrict __format,
|
||||
_G_va_list __arg));
|
||||
/* Write formatted output to S from argument list ARG. */
|
||||
extern int vsprintf __P ((char *__restrict __s,
|
||||
__const char *__restrict __format,
|
||||
_G_va_list __arg));
|
||||
|
||||
#ifdef __OPTIMIZE__
|
||||
extern __inline int
|
||||
vprintf (const char *__restrict __fmt, _G_va_list __arg)
|
||||
{
|
||||
return vfprintf (stdout, __fmt, __arg);
|
||||
}
|
||||
#endif /* Optimizing. */
|
||||
|
||||
#ifdef __USE_GNU
|
||||
/* Maximum chars of output to write in MAXLEN. */
|
||||
extern int __snprintf __P ((char *__s, size_t __maxlen,
|
||||
__const char *__format, ...));
|
||||
extern int snprintf __P ((char *__s, size_t __maxlen,
|
||||
__const char *__format, ...));
|
||||
|
||||
extern int __vsnprintf __P ((char *__s, size_t __maxlen,
|
||||
__const char *__format, _G_va_list __arg));
|
||||
extern int vsnprintf __P ((char *__s, size_t __maxlen,
|
||||
__const char *__format, _G_va_list __arg));
|
||||
|
||||
/* Write formatted output to a string dynamically allocated with `malloc'.
|
||||
Store the address of the string in *PTR. */
|
||||
extern int vasprintf __P ((char **__ptr, __const char *__f,
|
||||
_G_va_list __arg));
|
||||
extern int asprintf __P ((char **__ptr, __const char *__fmt, ...));
|
||||
|
||||
/* Write formatted output to a file descriptor. */
|
||||
extern int vdprintf __P ((int __fd, __const char *__fmt, _G_va_list __arg));
|
||||
extern int dprintf __P ((int __fd, __const char *__fmt, ...));
|
||||
#endif
|
||||
|
||||
|
||||
/* Read formatted input from STREAM. */
|
||||
extern int fscanf __P ((FILE *__restrict __stream,
|
||||
__const char *__restrict __format, ...));
|
||||
/* Read formatted input from stdin. */
|
||||
extern int scanf __P ((__const char *__restrict __format, ...));
|
||||
/* Read formatted input from S. */
|
||||
extern int sscanf __P ((__const char *__restrict __s,
|
||||
__const char *__restrict __format, ...));
|
||||
|
||||
#ifdef __USE_GNU
|
||||
/* Read formatted input from S into argument list ARG. */
|
||||
extern int __vfscanf __P ((FILE *__s, __const char *__format,
|
||||
_G_va_list __arg));
|
||||
extern int vfscanf __P ((FILE *__s, __const char *__format,
|
||||
_G_va_list __arg));
|
||||
|
||||
/* Read formatted input from stdin into argument list ARG. */
|
||||
extern int __vscanf __P ((__const char *__format, _G_va_list __arg));
|
||||
extern int vscanf __P ((__const char *__format, _G_va_list __arg));
|
||||
|
||||
/* Read formatted input from S into argument list ARG. */
|
||||
extern int __vsscanf __P ((__const char *__s, __const char *__format,
|
||||
_G_va_list __arg));
|
||||
extern int vsscanf __P ((__const char *__s, __const char *__format,
|
||||
_G_va_list __arg));
|
||||
|
||||
|
||||
#ifdef __OPTIMIZE__
|
||||
extern __inline int
|
||||
vfscanf (FILE *__s, const char *__fmt, _G_va_list __arg)
|
||||
{
|
||||
return __vfscanf (__s, __fmt, __arg);
|
||||
}
|
||||
extern __inline int
|
||||
vscanf (const char *__fmt, _G_va_list __arg)
|
||||
{
|
||||
return __vfscanf (stdin, __fmt, __arg);
|
||||
}
|
||||
extern __inline int
|
||||
vsscanf (const char *__s, const char *__fmt, _G_va_list __arg)
|
||||
{
|
||||
return __vsscanf (__s, __fmt, __arg);
|
||||
}
|
||||
#endif /* Optimizing. */
|
||||
#endif /* Use GNU. */
|
||||
|
||||
|
||||
/* Read a character from STREAM. */
|
||||
extern int fgetc __P ((FILE *__stream));
|
||||
extern int getc __P ((FILE *__stream));
|
||||
|
||||
/* Read a character from stdin. */
|
||||
extern int getchar __P ((void));
|
||||
|
||||
/* The C standard explicitly says this is a macro, so we always do the
|
||||
optimization for it. */
|
||||
#define getc(_fp) _IO_getc (_fp)
|
||||
|
||||
#ifdef __OPTIMIZE__
|
||||
extern __inline int
|
||||
getchar (void)
|
||||
{
|
||||
return _IO_getc (stdin);
|
||||
}
|
||||
#endif /* Optimizing. */
|
||||
|
||||
#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 getc_unlocked __P ((FILE *__stream));
|
||||
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 getchar_unlocked() _IO_getc_unlocked (stdin)
|
||||
# define putc_unlocked(c, fp) _IO_putc_unlocked ((c), (fp))
|
||||
# define putchar_unlocked(c) _IO_putc_unlocked ((c), stdout)
|
||||
# endif
|
||||
#endif /* POSIX || misc */
|
||||
#ifdef __OPTIMIZE__
|
||||
extern __inline int
|
||||
getc_unlocked (FILE *__fp)
|
||||
{
|
||||
return _IO_getc_unlocked (__fp);
|
||||
}
|
||||
|
||||
#define getc(_fp) _IO_getc (_fp)
|
||||
extern __inline int
|
||||
getchar_unlocked (void)
|
||||
{
|
||||
return _IO_getc_unlocked (stdin);
|
||||
}
|
||||
#endif /* Optimizing. */
|
||||
#endif /* Use POSIX or MISC. */
|
||||
|
||||
|
||||
/* Write a character to STREAM. */
|
||||
extern int fputc __P ((int __c, FILE *__stream));
|
||||
extern int putc __P ((int __c, FILE *__stream));
|
||||
|
||||
/* Write a character to stdout. */
|
||||
extern int putchar __P ((int __c));
|
||||
|
||||
/* The C standard explicitly says this can be a macro,
|
||||
so we always do the optimization for it. */
|
||||
#define putc(_ch, _fp) _IO_putc (_ch, _fp)
|
||||
#define putchar(_ch) _IO_putc (_ch, stdout)
|
||||
#define getchar() _IO_getc (stdin)
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
#ifdef __OPTIMIZE__
|
||||
extern __inline int
|
||||
putchar (int __c)
|
||||
{
|
||||
return _IO_putc (__c, stdout);
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef __USE_MISC
|
||||
/* Faster version when locking is not necessary. */
|
||||
extern int fputc_unlocked __P ((int __c, FILE *__stream));
|
||||
|
||||
#ifdef __OPTIMIZE__
|
||||
extern __inline int
|
||||
fputc_unlocked (int __c, FILE *__stream)
|
||||
{
|
||||
return _IO_putc_unlocked (__c, __stream);
|
||||
}
|
||||
#endif /* Optimizing. */
|
||||
#endif /* Use MISC. */
|
||||
|
||||
#if defined __USE_POSIX || defined __USE_MISC
|
||||
/* These are defined in POSIX.1:1996. */
|
||||
extern int putc_unlocked __P ((int __c, FILE *__stream));
|
||||
extern int putchar_unlocked __P ((int __c));
|
||||
|
||||
#ifdef __OPTIMIZE__
|
||||
extern __inline int
|
||||
putc_unlocked (int __c, FILE *__stream)
|
||||
{
|
||||
return _IO_putc_unlocked (__c, __stream);
|
||||
}
|
||||
|
||||
extern __inline int
|
||||
putchar_unlocked (int __c)
|
||||
{
|
||||
return _IO_putc_unlocked (__c, stdout);
|
||||
}
|
||||
#endif /* Optimizing. */
|
||||
#endif /* Use POSIX or MISc. */
|
||||
|
||||
|
||||
#if defined __USE_SVID || defined __USE_MISC
|
||||
/* Get a word (int) from STREAM. */
|
||||
extern int getw __P ((FILE *__stream));
|
||||
|
||||
/* Write a word (int) to STREAM. */
|
||||
extern int putw __P ((int __w, FILE *__stream));
|
||||
#endif
|
||||
|
||||
|
||||
/* Get a newline-terminated string of finite length from STREAM. */
|
||||
extern char *fgets __P ((char *__restrict __s, int __n,
|
||||
FILE *__restrict __stream));
|
||||
|
||||
/* Get a newline-terminated string from stdin, removing the newline.
|
||||
DO NOT USE THIS FUNCTION!! There is no limit on how much it will read. */
|
||||
extern char *gets __P ((char *__s));
|
||||
|
||||
|
||||
#ifdef __USE_GNU
|
||||
/* Read up to (and including) a DELIMITER from STREAM into *LINEPTR
|
||||
(and null-terminate it). *LINEPTR is a pointer returned from malloc (or
|
||||
NULL), pointing to *N characters of space. It is realloc'd as
|
||||
necessary. Returns the number of characters read (not including the
|
||||
null terminator), or -1 on error or EOF. */
|
||||
_IO_ssize_t __getdelim __P ((char **__lineptr, size_t *__n,
|
||||
int __delimiter, FILE *__stream));
|
||||
_IO_ssize_t getdelim __P ((char **__lineptr, size_t *__n,
|
||||
int __delimiter, FILE *__stream));
|
||||
|
||||
/* Like `getdelim', but reads up to a newline. */
|
||||
_IO_ssize_t __getline __P ((char **__lineptr, size_t *__n, FILE *__stream));
|
||||
_IO_ssize_t getline __P ((char **__lineptr, size_t *__n, FILE *__stream));
|
||||
|
||||
#ifdef __OPTIMIZE__
|
||||
extern __inline _IO_ssize_t
|
||||
getline (char **__lineptr, size_t *__n, FILE *__stream)
|
||||
{
|
||||
return __getdelim (__lineptr, __n, '\n', __stream);
|
||||
}
|
||||
#endif /* Optimizing. */
|
||||
#endif
|
||||
|
||||
|
||||
/* Write a string to STREAM. */
|
||||
extern int fputs __P ((__const char *__restrict __s,
|
||||
FILE *__restrict __stream));
|
||||
/* Write a string, followed by a newline, to stdout. */
|
||||
extern int puts __P ((__const char *__s));
|
||||
|
||||
|
||||
/* Push a character back onto the input buffer of STREAM. */
|
||||
extern int ungetc __P ((int __c, FILE *__stream));
|
||||
|
||||
|
||||
/* Read chunks of generic data from STREAM. */
|
||||
extern size_t fread __P ((void *__restrict __ptr, size_t __size,
|
||||
size_t __n, FILE *__restrict __stream));
|
||||
/* Write chunks of generic data to STREAM. */
|
||||
extern size_t fwrite __P ((__const void *__restrict __ptr, size_t __size,
|
||||
size_t __n, FILE *__restrict __s));
|
||||
|
||||
#ifdef __USE_MISC
|
||||
/* Faster versions when locking is not necessary. */
|
||||
extern size_t fread_unlocked __P ((void *__restrict __ptr, size_t __size,
|
||||
size_t __n, FILE *__restrict __stream));
|
||||
extern size_t fwrite_unlocked __P ((__const void *__restrict __ptr,
|
||||
size_t __size, size_t __n,
|
||||
FILE *__restrict __stream));
|
||||
#endif
|
||||
|
||||
|
||||
/* Seek to a certain position on STREAM. */
|
||||
extern int fseek __P ((FILE *__stream, long int __off, int __whence));
|
||||
/* Return the current position of STREAM. */
|
||||
extern long int ftell __P ((FILE *__stream));
|
||||
/* Rewind to the beginning of STREAM. */
|
||||
extern void rewind __P ((FILE *__stream));
|
||||
|
||||
/* Get STREAM's position. */
|
||||
extern int fgetpos __P ((FILE *__restrict __stream,
|
||||
fpos_t *__restrict __pos));
|
||||
/* Set STREAM's position. */
|
||||
extern int fsetpos __P ((FILE *__stream, __const fpos_t *__pos));
|
||||
|
||||
|
||||
/* Clear the error and EOF indicators for STREAM. */
|
||||
extern void clearerr __P ((FILE *__stream));
|
||||
/* Return the EOF indicator for STREAM. */
|
||||
extern int feof __P ((FILE *__stream));
|
||||
/* Return the error indicator for STREAM. */
|
||||
extern int ferror __P ((FILE *__stream));
|
||||
|
||||
#ifdef __USE_MISC
|
||||
/* Faster versions when locking is not required. */
|
||||
extern void clearerr_unlocked __P ((FILE *__stream));
|
||||
extern int feof_unlocked __P ((FILE *__stream));
|
||||
extern int ferror_unlocked __P ((FILE *__stream));
|
||||
|
||||
#ifdef __OPTIMIZE__
|
||||
extern __inline int
|
||||
feof_unlocked (FILE *__stream)
|
||||
{
|
||||
return _IO_feof_unlocked (__stream);
|
||||
}
|
||||
|
||||
extern __inline int
|
||||
ferror_unlocked (FILE *__stream)
|
||||
{
|
||||
return _IO_ferror_unlocked (__stream);
|
||||
}
|
||||
#endif /* Optimizing. */
|
||||
#endif
|
||||
|
||||
|
||||
/* Print a message describing the meaning of the value of errno. */
|
||||
extern void perror __P ((__const char *__s));
|
||||
|
||||
/* These variables normally should not be used directly. The `strftime'
|
||||
function provides all the needed functionality. */
|
||||
#ifdef __USE_BSD
|
||||
extern int sys_nerr;
|
||||
extern __const char *__const sys_errlist[];
|
||||
#endif
|
||||
#ifdef __USE_GNU
|
||||
extern int _sys_nerr;
|
||||
extern __const char *__const _sys_errlist[];
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef __USE_POSIX
|
||||
/* Return the system file descriptor for STREAM. */
|
||||
extern int fileno __P ((FILE *__stream));
|
||||
#endif /* Use POSIX. */
|
||||
|
||||
#ifdef __USE_MISC
|
||||
/* Faster version when locking is not required. */
|
||||
extern int fileno_unlocked __P ((FILE *__stream));
|
||||
#endif
|
||||
|
||||
|
||||
#if (defined __USE_POSIX2 || defined __USE_SVID || defined __USE_BSD || \
|
||||
defined __USE_MISC)
|
||||
/* Create a new stream connected to a pipe running the given command. */
|
||||
extern FILE *popen __P ((__const char *__command, __const char *__modes));
|
||||
|
||||
/* Close a stream opened by popen and return the status of its child. */
|
||||
extern int pclose __P ((FILE *__stream));
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef __USE_POSIX
|
||||
/* Return the name of the controlling terminal. */
|
||||
extern char *ctermid __P ((char *__s));
|
||||
#endif /* Use POSIX. */
|
||||
|
||||
|
||||
#ifdef __USE_XOPEN
|
||||
/* Return the name of the current user. */
|
||||
extern char *cuserid __P ((char *__s));
|
||||
#endif /* Use X/Open. */
|
||||
|
||||
|
||||
#ifdef __USE_GNU
|
||||
struct obstack; /* See <obstack.h>. */
|
||||
|
||||
/* Write formatted output to an obstack. */
|
||||
extern int obstack_printf __P ((struct obstack *__obstack,
|
||||
__const char *__format, ...));
|
||||
extern int obstack_vprintf __P ((struct obstack *__obstack,
|
||||
__const char *__format,
|
||||
_G_va_list __args));
|
||||
#endif /* Use GNU. */
|
||||
|
||||
|
||||
#if defined __USE_POSIX || defined __USE_MISC
|
||||
/* These are defined in POSIX.1:1996. */
|
||||
|
||||
/* Acquire ownership of STREAM. */
|
||||
extern void flockfile __P ((FILE *__stream));
|
||||
|
||||
/* Try to acquire ownership of STREAM but do not block if it is not
|
||||
possible. */
|
||||
extern int ftrylockfile __P ((FILE *__stream));
|
||||
|
||||
/* Relinquish the ownership granted for STREAM. */
|
||||
extern void funlockfile __P ((FILE *__stream));
|
||||
#endif /* POSIX || misc */
|
||||
|
||||
__END_DECLS
|
||||
|
||||
#endif /* <stdio.h> included. */
|
||||
|
||||
#endif /* !_STDIO_H */
|
||||
|
||||
+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 = {
|
||||
|
||||
+80
-7
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
Copyright (C) 1994 Free Software Foundation
|
||||
Copyright (C) 1994, 1997 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of the GNU IO Library. This library is free
|
||||
software; you can redistribute it and/or modify it under the
|
||||
@@ -25,6 +25,73 @@ the executable file might be covered by the GNU General Public License. */
|
||||
#include "libioP.h"
|
||||
#include "strfile.h"
|
||||
|
||||
|
||||
typedef struct
|
||||
{
|
||||
_IO_strfile f;
|
||||
/* This is used for the characters which do not fit in the buffer
|
||||
provided by the user. */
|
||||
char overflow_buf[64];
|
||||
} _IO_strnfile;
|
||||
|
||||
|
||||
static int
|
||||
_IO_strn_overflow (_IO_FILE* fp, int c)
|
||||
{
|
||||
/* When we come to here this means the user supplied buffer is
|
||||
filled. But since we must return the number of characters which
|
||||
would have been written in total we must provide a buffer for
|
||||
further use. We can do this by writing on and on in the overflow
|
||||
buffer in the _IO_strnfile structure. */
|
||||
_IO_strnfile *snf = (_IO_strnfile *) fp;
|
||||
|
||||
if (fp->_IO_buf_base != snf->overflow_buf)
|
||||
{
|
||||
/* Terminate the string. We know that there is room for at
|
||||
least one more character since we initialized the stream with
|
||||
a size to make this possible. */
|
||||
*fp->_IO_write_ptr = '\0';
|
||||
|
||||
_IO_setb (fp, snf->overflow_buf,
|
||||
snf->overflow_buf + sizeof (snf->overflow_buf), 0);
|
||||
|
||||
fp->_IO_write_base = snf->overflow_buf;
|
||||
fp->_IO_read_base = snf->overflow_buf;
|
||||
fp->_IO_read_ptr = snf->overflow_buf;
|
||||
fp->_IO_read_end = snf->overflow_buf + sizeof (snf->overflow_buf);
|
||||
}
|
||||
|
||||
fp->_IO_write_ptr = snf->overflow_buf;
|
||||
fp->_IO_write_end = snf->overflow_buf;
|
||||
|
||||
/* Since we are not really interested in storing the characters
|
||||
which do not fit in the buffer we simply ignore it. */
|
||||
return c;
|
||||
}
|
||||
|
||||
|
||||
static struct _IO_jump_t _IO_strn_jumps = {
|
||||
JUMP_INIT_DUMMY,
|
||||
JUMP_INIT(finish, _IO_str_finish),
|
||||
JUMP_INIT(overflow, _IO_strn_overflow),
|
||||
JUMP_INIT(underflow, _IO_str_underflow),
|
||||
JUMP_INIT(uflow, _IO_default_uflow),
|
||||
JUMP_INIT(pbackfail, _IO_str_pbackfail),
|
||||
JUMP_INIT(xsputn, _IO_default_xsputn),
|
||||
JUMP_INIT(xsgetn, _IO_default_xsgetn),
|
||||
JUMP_INIT(seekoff, _IO_str_seekoff),
|
||||
JUMP_INIT(seekpos, _IO_default_seekpos),
|
||||
JUMP_INIT(setbuf, _IO_default_setbuf),
|
||||
JUMP_INIT(sync, _IO_default_sync),
|
||||
JUMP_INIT(doallocate, _IO_default_doallocate),
|
||||
JUMP_INIT(read, _IO_default_read),
|
||||
JUMP_INIT(write, _IO_default_write),
|
||||
JUMP_INIT(seek, _IO_default_seek),
|
||||
JUMP_INIT(close, _IO_default_close),
|
||||
JUMP_INIT(stat, _IO_default_stat)
|
||||
};
|
||||
|
||||
|
||||
int
|
||||
_IO_vsnprintf (string, maxlen, format, args)
|
||||
char *string;
|
||||
@@ -32,22 +99,28 @@ _IO_vsnprintf (string, maxlen, format, args)
|
||||
const char *format;
|
||||
_IO_va_list args;
|
||||
{
|
||||
_IO_strfile sf;
|
||||
_IO_strnfile sf;
|
||||
int ret;
|
||||
#ifdef _IO_MTSAFE_IO
|
||||
_IO_lock_t lock;
|
||||
sf._sbf._f._lock = &lock;
|
||||
sf.f._sbf._f._lock = &lock;
|
||||
#endif
|
||||
|
||||
/* We need to handle the special case where MAXLEN is 0. */
|
||||
/* We need to handle the special case where MAXLEN is 0. Use the
|
||||
overflow buffer right from the start. */
|
||||
if (maxlen == 0)
|
||||
return 0;
|
||||
{
|
||||
string = sf.overflow_buf;
|
||||
maxlen = sizeof (sf.overflow_buf);
|
||||
}
|
||||
|
||||
_IO_init ((_IO_FILE *) &sf, 0);
|
||||
_IO_JUMPS ((_IO_FILE *) &sf) = &_IO_str_jumps;
|
||||
_IO_JUMPS ((_IO_FILE *) &sf) = &_IO_strn_jumps;
|
||||
_IO_str_init_static ((_IO_FILE *) &sf, string, maxlen - 1, string);
|
||||
ret = _IO_vfprintf ((_IO_FILE *) &sf, format, args);
|
||||
*((_IO_FILE *) &sf)->_IO_write_ptr = '\0';
|
||||
|
||||
if (sf.f._sbf._f._IO_buf_base != sf.overflow_buf)
|
||||
*sf.f._sbf._f._IO_write_ptr = '\0';
|
||||
return ret;
|
||||
}
|
||||
weak_alias (_IO_vsnprintf, __vsnprintf)
|
||||
|
||||
+2
-1
@@ -27,7 +27,7 @@ const struct locale_data _nl_C_LC_TIME =
|
||||
_nl_C_name,
|
||||
NULL, 0, 0, /* no file mapped */
|
||||
MAX_USAGE_COUNT,
|
||||
53,
|
||||
54,
|
||||
{
|
||||
{ string: "Sun" },
|
||||
{ string: "Mon" },
|
||||
@@ -80,6 +80,7 @@ const struct locale_data _nl_C_LC_TIME =
|
||||
{ string: "" },
|
||||
{ string: "" },
|
||||
{ word: 0 },
|
||||
{ word: 0 },
|
||||
{ string: "" },
|
||||
{ string: "" },
|
||||
}
|
||||
|
||||
+1
-1
@@ -38,7 +38,7 @@ __duplocale (__locale_t dataset)
|
||||
__libc_lock_lock (__libc_setlocale_lock);
|
||||
|
||||
/* Get memory. */
|
||||
result = (__locale_t) malloc (sizeof (struct __locale_t));
|
||||
result = (__locale_t) malloc (sizeof (struct __locale_struct));
|
||||
if (result != NULL)
|
||||
{
|
||||
int cnt;
|
||||
|
||||
+1
-1
@@ -104,7 +104,7 @@ extern struct locale_data *_nl_current_##category;
|
||||
|
||||
extern const char *const _nl_category_names[LC_ALL + 1];
|
||||
extern const size_t _nl_category_name_sizes[LC_ALL + 1];
|
||||
extern struct locale_data * *const _nl_current[LC_ALL];
|
||||
extern struct locale_data * *const _nl_current[LC_ALL + 1];
|
||||
|
||||
/* Name of the standard locale. */
|
||||
extern const char _nl_C_name[];
|
||||
|
||||
+3
-3
@@ -42,7 +42,7 @@ __newlocale (int category_mask, const char *locale, __locale_t base)
|
||||
{
|
||||
/* Intermediate memory for result. */
|
||||
const char *newnames[LC_ALL];
|
||||
struct __locale_t result;
|
||||
struct __locale_struct result;
|
||||
__locale_t result_ptr;
|
||||
char *locale_path;
|
||||
size_t locale_path_len;
|
||||
@@ -79,7 +79,7 @@ __newlocale (int category_mask, const char *locale, __locale_t base)
|
||||
dataset using the C locale data. */
|
||||
if (category_mask == 0)
|
||||
{
|
||||
result_ptr = (__locale_t) malloc (sizeof (struct __locale_t));
|
||||
result_ptr = (__locale_t) malloc (sizeof (struct __locale_struct));
|
||||
*result_ptr = result;
|
||||
|
||||
goto update;
|
||||
@@ -158,7 +158,7 @@ __newlocale (int category_mask, const char *locale, __locale_t base)
|
||||
if (base == NULL)
|
||||
{
|
||||
/* Allocate new structure. */
|
||||
result_ptr = (__locale_t) malloc (sizeof (struct __locale_t));
|
||||
result_ptr = (__locale_t) malloc (sizeof (struct __locale_struct));
|
||||
if (result_ptr == NULL)
|
||||
return NULL;
|
||||
|
||||
|
||||
@@ -166,6 +166,8 @@ static void show_info (const char *name);
|
||||
int
|
||||
main (int argc, char *argv[])
|
||||
{
|
||||
int remaining;
|
||||
|
||||
/* Set initial values for global variables. */
|
||||
show_category_name = 0;
|
||||
show_keyword_name = 0;
|
||||
@@ -179,7 +181,7 @@ main (int argc, char *argv[])
|
||||
textdomain (PACKAGE);
|
||||
|
||||
/* Parse and process arguments. */
|
||||
argp_parse (&argp, argc, argv, 0, 0, NULL);
|
||||
argp_parse (&argp, argc, argv, 0, &remaining, NULL);
|
||||
|
||||
/* `-a' requests the names of all available locales. */
|
||||
if (do_all != 0)
|
||||
@@ -203,15 +205,15 @@ main (int argc, char *argv[])
|
||||
|
||||
/* If no real argument is given we have to print the contents of the
|
||||
current locale definition variables. These are LANG and the LC_*. */
|
||||
if (optind == argc && show_keyword_name == 0 && show_category_name == 0)
|
||||
if (remaining == argc && show_keyword_name == 0 && show_category_name == 0)
|
||||
{
|
||||
show_locale_vars ();
|
||||
exit (EXIT_SUCCESS);
|
||||
}
|
||||
|
||||
/* Process all given names. */
|
||||
while (optind < argc)
|
||||
show_info (argv[optind++]);
|
||||
while (remaining < argc)
|
||||
show_info (argv[remaining++]);
|
||||
|
||||
exit (EXIT_SUCCESS);
|
||||
}
|
||||
|
||||
+14
-16
@@ -109,7 +109,7 @@ static const struct argp_option options[] =
|
||||
{ "posix", OPT_POSIX, NULL, 0, N_("Be strictly POSIX conform") },
|
||||
{ "quiet", OPT_QUIET, NULL, 0,
|
||||
N_("Suppress warnings and information messages") },
|
||||
{ "verbose", 'V', NULL, 0, N_("print more messages") },
|
||||
{ "verbose", 'V', NULL, 0, N_("Print more messages") },
|
||||
{ NULL, 0, NULL, 0, NULL }
|
||||
};
|
||||
|
||||
@@ -148,6 +148,7 @@ main (int argc, char *argv[])
|
||||
struct charset_t *charset;
|
||||
struct localedef_t *localedef;
|
||||
struct copy_def_list_t *act_add_locdef;
|
||||
int remaining;
|
||||
|
||||
/* Set initial values for global variables. */
|
||||
copy_list = NULL;
|
||||
@@ -163,29 +164,24 @@ main (int argc, char *argv[])
|
||||
textdomain (_libc_intl_domainname);
|
||||
|
||||
/* Parse and process arguments. */
|
||||
argp_parse (&argp, argc, argv, 0, 0, NULL);
|
||||
|
||||
/* XXX POSIX is violated since for unknown option a exit value > 3
|
||||
must be used. */
|
||||
argp_err_exit_status = 4;
|
||||
argp_parse (&argp, argc, argv, 0, &remaining, NULL);
|
||||
|
||||
/* POSIX.2 requires to be verbose about missing characters in the
|
||||
character map. */
|
||||
verbose |= posix_conformance;
|
||||
|
||||
if (argc - optind != 1)
|
||||
if (argc - remaining != 1)
|
||||
{
|
||||
/* We need exactly one non-option parameter. */
|
||||
argp_help (&argp, stdout, ARGP_HELP_SEE,
|
||||
argp_help (&argp, stdout, ARGP_HELP_SEE | ARGP_HELP_EXIT_ERR,
|
||||
program_invocation_short_name);
|
||||
|
||||
/* XXX Currently POSIX is violated. We must exit with code 4
|
||||
but the argp_help function currently does not allow this. */
|
||||
exit (4);
|
||||
}
|
||||
|
||||
/* The parameter describes the output path of the constructed files.
|
||||
If the described files cannot be written return a NULL pointer. */
|
||||
output_path = construct_output_path (argv[optind]);
|
||||
output_path = construct_output_path (argv[remaining]);
|
||||
cannot_write_why = errno;
|
||||
|
||||
/* Now that the parameters are processed we have to reset the local
|
||||
@@ -244,21 +240,23 @@ main (int argc, char *argv[])
|
||||
|
||||
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]);
|
||||
|
||||
|
||||
@@ -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)
|
||||
|
||||
+5
-1
@@ -49,6 +49,9 @@ static struct locale_data * *const _nl_current[] =
|
||||
[category] = &_nl_current_##category,
|
||||
#include "categories.def"
|
||||
#undef DEFINE_CATEGORY
|
||||
/* We need this additional element to simplify the code. It must
|
||||
simply be != NULL. */
|
||||
[LC_ALL] = (struct locale_data **) ~0ul
|
||||
};
|
||||
|
||||
/* Array indexed by category of pointers to _nl_C_CATEGORY slots.
|
||||
@@ -368,7 +371,8 @@ setlocale (int category, const char *locale)
|
||||
|
||||
/* We must not simply free a global locale since we have no
|
||||
control over the usage. So we mark it as un-deletable. */
|
||||
newdata->usage_count = MAX_USAGE_COUNT;
|
||||
if (newdata->usage_count != MAX_USAGE_COUNT)
|
||||
newdata->usage_count = MAX_USAGE_COUNT;
|
||||
}
|
||||
|
||||
/* Create new composite name. */
|
||||
|
||||
+1
-1
@@ -25,7 +25,7 @@
|
||||
(almost) opaque type for the user level programs. The file and
|
||||
this data structure is not standardized. Don't rely on it. It can
|
||||
go away without warning. */
|
||||
typedef struct __locale_t
|
||||
typedef struct __locale_struct
|
||||
{
|
||||
struct locale_data *__locales[6]; /* XXX LC_ALL should be used here */
|
||||
|
||||
|
||||
@@ -0,0 +1,205 @@
|
||||
970b316dd260f981b02f80c5481037db charmaps/ANSI_X3.110-1983
|
||||
63ca7fd8249a3065c2cf46d3568ce205 charmaps/ANSI_X3.4-1968
|
||||
e86c1b2ef30069c39ae57c74044c8f5f charmaps/ASMO_449
|
||||
64cdea65126674d17e4d4de9eebe7a7d charmaps/BALTIC
|
||||
44b589073659d5059ed28feae29d1bb9 charmaps/BS_4730
|
||||
3014b545b72ea460c6be1c0e736fd0fe charmaps/BS_VIEWDATA
|
||||
7c114537b032dcb0c33fad6447f4e390 charmaps/CP1250
|
||||
dbe7661c6a5b123e8c5d369fa4dcdaf7 charmaps/CP1251
|
||||
7257c9691d957e62a7e637cc0b4a3883 charmaps/CP1252
|
||||
5d596c65b87acd46382b62b627419906 charmaps/CP1253
|
||||
26d7fe7875157b1264a0feb2af3bd4b1 charmaps/CP1254
|
||||
995beb377a9b10ceb69d2e2db9f38c0c charmaps/CP1255
|
||||
8f3ab677c4c41d9a602ec5a9d2181a58 charmaps/CP1256
|
||||
9ac7292aa07f1774b3fa82407f50bfe0 charmaps/CP1257
|
||||
3e7ab730f995ee2aac310d086877f76c charmaps/CSA_Z243.4-1985-1
|
||||
41dadf28b93935585caa80790fb9cfe1 charmaps/CSA_Z243.4-1985-2
|
||||
1f2207e691c3adad58244f7561c987c8 charmaps/CSA_Z243.4-1985-GR
|
||||
61c0c0ffff0c3543641c16bf9196405d charmaps/CSN_369103
|
||||
cda6b11a184e5d046bd753b34b4c5c16 charmaps/CWI
|
||||
8c01af7e97fa05c868747364aeee903f charmaps/DEC-MCS
|
||||
6d641c1ca619a395699c9e08f38aade0 charmaps/DIN_66003
|
||||
56a240f6ab1652084d70d62e71df76b9 charmaps/DS_2089
|
||||
aaf3aa1f7973d24c10f0195e44d309cc charmaps/EBCDIC-AT-DE
|
||||
2ac9ed4896146b681fa877218b987397 charmaps/EBCDIC-AT-DE-A
|
||||
3128740dffa196fed88be336e8b3b6a4 charmaps/EBCDIC-CA-FR
|
||||
c37b7c8e96d7ee23cc4a6de8fb38a144 charmaps/EBCDIC-DK-NO
|
||||
91c7c4ae978f1037531a1850d796db38 charmaps/EBCDIC-DK-NO-A
|
||||
b70f369a9a6665a013f4d67ddafb9117 charmaps/EBCDIC-ES
|
||||
2bb6d464c083baf2e4590510356efc54 charmaps/EBCDIC-ES-A
|
||||
da80b72f81b71aa750c89efe36cdebc9 charmaps/EBCDIC-ES-S
|
||||
4900c129fe536d90eef1fa079021d600 charmaps/EBCDIC-FI-SE
|
||||
53493344a23c5915d05cb445596e6985 charmaps/EBCDIC-FI-SE-A
|
||||
16441fef214449bf01833c75119f4218 charmaps/EBCDIC-FR
|
||||
47bc93bac2e9121e92ec45e6b084ac3e charmaps/EBCDIC-IS-FRISS
|
||||
590d2d63cffe663a57f9594a88a5d252 charmaps/EBCDIC-IT
|
||||
c51d96a6c0701ace762c1b381650c9e2 charmaps/EBCDIC-PT
|
||||
37b02d6622d5bbad31dbd29e5ea85c1a charmaps/EBCDIC-UK
|
||||
72fc4fb96a6b4fb18090aaf5c1ca5e04 charmaps/EBCDIC-US
|
||||
a66fceae768b6c6653347c6d62a591e2 charmaps/ECMA-CYRILLIC
|
||||
9f8b15ccd32dc406d449428624c7f5a9 charmaps/ES
|
||||
d8827d6828355187991c0c77b1d175e0 charmaps/ES2
|
||||
684e59dfaedd5be03cdb75f13bd4087b charmaps/GB_1988-80
|
||||
eac9ece498b20cea3f64e08e29fcf728 charmaps/GOST_19768-74
|
||||
aa2138ecb935ae395a42e2a36fae17df charmaps/GREEK7
|
||||
016bf365bfbe76a2dffd3371e449bed8 charmaps/GREEK7-OLD
|
||||
cd9b8358fd4ee9ca42f51dd5b9bee1d2 charmaps/GREEK-CCITT
|
||||
d601c5e0564708cccc77f5a0ff21ad5a charmaps/HP-ROMAN8
|
||||
ac6aefc1a0ee7a71a219aeaa45d2dd59 charmaps/IBM037
|
||||
6c88d3707f227d81de6c486fa37291af charmaps/IBM038
|
||||
a866b15cb70f42db3e10208dc1c6c760 charmaps/IBM1004
|
||||
9cf5a37e4b3adb3cbd07dacfdfa339f3 charmaps/IBM1026
|
||||
a9da79881a9ca162290d30dbc60e50ef charmaps/IBM1047
|
||||
efd81c94d2eb08b06b917fab1999237e charmaps/IBM256
|
||||
4cd391704e0bfa5004f51aee15d63487 charmaps/IBM273
|
||||
9cd875dcc061173394ddccb59df09d5d charmaps/IBM274
|
||||
85f505f2920525084080877e61c3c676 charmaps/IBM275
|
||||
a3e907c09ff00ca647dd250da4d08910 charmaps/IBM277
|
||||
d5228847a6c37dd5d0bfef061a87ddf5 charmaps/IBM278
|
||||
961510d2dc9ac86a74c490a14fb2c5bd charmaps/IBM280
|
||||
e743c1c1e6cb73c36b4afe941cf98aeb charmaps/IBM281
|
||||
356b5249cf790ebba361a41c9ab0008f charmaps/IBM284
|
||||
f0fb91312ba9bda57ae7d54c08fe7277 charmaps/IBM285
|
||||
3721e2fe385430d0b723d3670843c5e6 charmaps/IBM290
|
||||
9a2d9a73447dffdecb2ce7c1f0312073 charmaps/IBM297
|
||||
bdfddcd88b3f1ca36576247b4c50282f charmaps/IBM420
|
||||
4aa0aac1583eba7e8e9fa5098522eab5 charmaps/IBM423
|
||||
c58e6bc022f94eef43fc7ed684c5157f charmaps/IBM424
|
||||
1ec3b0acdbcd99941c889e41e997e61e charmaps/IBM437
|
||||
c4472e9815e61c39586a51ae60a13e4e charmaps/IBM500
|
||||
634e54bc22ec929c4a9782e0437e4ed3 charmaps/IBM850
|
||||
f58eac70d307cc4a242f33a93ddbf99a charmaps/IBM851
|
||||
2e65788cf6f20256b6cbd3f9f1584ab0 charmaps/IBM852
|
||||
3945e5dcd7088ce2deed5399fccf8464 charmaps/IBM855
|
||||
9b6d2ea97443ffd9925455efaad1dede charmaps/IBM857
|
||||
e01be3d125620dc75439fa2e3b608636 charmaps/IBM860
|
||||
28166b8677342cda155574d5c3f223fe charmaps/IBM861
|
||||
9c0af519221ec94358866e2608fe91f8 charmaps/IBM862
|
||||
98d2001523bb39c9532979b4df6ad326 charmaps/IBM863
|
||||
deb6bde660b73869e87174bec7ba27dc charmaps/IBM864
|
||||
f58ccd68d1019be24883064012d00b9b charmaps/IBM865
|
||||
d18990891c7f4beb67520dcaaa2ab94b charmaps/IBM868
|
||||
04c8bce968ed0b84a9facd22c4efde61 charmaps/IBM869
|
||||
711e343635c377f70561f2b8091a3b37 charmaps/IBM870
|
||||
6cb196018f85ea9ca94a59cadf5326c4 charmaps/IBM871
|
||||
f344024ec2efbc52d4985f676018da7f charmaps/IBM875
|
||||
02e6cae94ceaedeaf335157831251f91 charmaps/IBM880
|
||||
bfd57147762dfa155c9b0cb7e3caea16 charmaps/IBM891
|
||||
f46fdde76da7a47f73c79e4cfc7d6e54 charmaps/IBM903
|
||||
3f0f3fead1f82ceef5c5e175305a7088 charmaps/IBM904
|
||||
77af7f0a6d441433069cf1bc96babb88 charmaps/IBM905
|
||||
445c6202fdbe83c728a2dfe868732f02 charmaps/IBM918
|
||||
efe297def24e84feaa37856884dd829e charmaps/IEC_P27-1
|
||||
4badb4c8c58e1d30b540f5742f7e69bc charmaps/INIS
|
||||
9f3f79ab67a41ac29a93cfba31c5e2af charmaps/INIS-8
|
||||
88f6cdba3e3d1b858bd269f62123f8c0 charmaps/INIS-CYRILLIC
|
||||
44a7a7a18fe17c5eadaf24bf976da25e charmaps/INVARIANT
|
||||
8131fd60be71f5474823c96f8b3e1de3 charmaps/ISO_10367-BOX
|
||||
b71ed28fbb5d7d62d9f3a710a34a6df4 charmaps/ISO_10646
|
||||
bb31373cb7d39a205bae221e58f1d4a1 charmaps/ISO_2033-1983
|
||||
36644828d2f0db4119698984cff9fff0 charmaps/ISO_5427
|
||||
09aa0a2d88e51399bd1581dc6e2394ce charmaps/ISO_5427-EXT
|
||||
8afb96037ce01e4debf8df7dc4be5c57 charmaps/ISO_5428
|
||||
49b4677573bd28d794b71771cba51f2c charmaps/ISO_646.BASIC
|
||||
a4d959a49db1e8c9f40c406206560a46 charmaps/ISO_646.IRV
|
||||
8fff113e98ee8ca7244d96236cd9a9a4 charmaps/ISO_6937
|
||||
4b725c11b8acac218edb223a8fabe28c charmaps/ISO_6937-2-25
|
||||
21cbdcf9e505338eeff0aaecccb01d24 charmaps/ISO_6937-2-ADD
|
||||
1524185dff114b3f072cdde41b2757d9 charmaps/ISO-8859-1
|
||||
27b9c1e552f5fd0b27fc536f0fa95fa4 charmaps/ISO-8859-10
|
||||
37edf0c113b991fa03454c11efe7a604 charmaps/ISO-8859-2
|
||||
23f592d1c931fbae7aab787764ce4e13 charmaps/ISO-8859-3
|
||||
8da948413a01091eee9824a1acf8e9da charmaps/ISO-8859-4
|
||||
802615fe39f14271c9f6a9c7bbb6fefe charmaps/ISO-8859-5
|
||||
0ce863896fefabade74256df4d81504f charmaps/ISO-8859-6
|
||||
dbfbcb0cde6aca45dccc8e1fa3dbeccc charmaps/ISO-8859-7
|
||||
d202cea38f00eb9a64816e7471b4fba1 charmaps/ISO-8859-8
|
||||
0f2d28310846869627d4957ff7af7672 charmaps/ISO-8859-9
|
||||
0ff1cec843b556575348c403d1a44f5b charmaps/ISO_8859-SUPP
|
||||
e3d2b1067decd1b5a6db1e059458a663 charmaps/ISO-IR-90
|
||||
6c2093382e84d8304500816c0e6e9517 charmaps/IT
|
||||
85787bcfd8a57d23e444413454471f02 charmaps/JIS_C6220-1969-JP
|
||||
87c6ebd0c4aa8e298bc2b5f148e83ea1 charmaps/JIS_C6220-1969-RO
|
||||
246eb24242c02164520df418f2d963b0 charmaps/JIS_C6229-1984-A
|
||||
3bb35d7d629bc4f5c486051b4b2315e1 charmaps/JIS_C6229-1984-B
|
||||
cfaed7e9366ac0c053d1a6841a813bc3 charmaps/JIS_C6229-1984-B-ADD
|
||||
2f973a2199e6c70da93c17a55e726a70 charmaps/JIS_C6229-1984-HAND
|
||||
106feb69588f588bcb69f269a904cd5c charmaps/JIS_C6229-1984-HAND-ADD
|
||||
e5f0a57ea025f7a4d74e43ae5dd506b6 charmaps/JIS_C6229-1984-KANA
|
||||
53fefc27f5ab707f14e97a755e36a91c charmaps/JIS_X0201
|
||||
a99c92babdf549c9b8902d86ef6a99b4 charmaps/JUS_I.B1.002
|
||||
1ca9cd921efb2db125b3e408daee8720 charmaps/JUS_I.B1.003-MAC
|
||||
be91175d769b4817a28312d2a2162fe5 charmaps/JUS_I.B1.003-SERB
|
||||
da93a4e606e0ad840f25eaad48164d7d charmaps/KOI-8
|
||||
1623c0ffb000db9f365d2b1b695aac14 charmaps/KOI8-R
|
||||
a3209c513563672e6da7776d30ae6f03 charmaps/KSC5636
|
||||
40c613c89d8293a342dee656e155dc05 charmaps/LATIN-GREEK
|
||||
7c211fac48ca088792c29bbe943b0216 charmaps/LATIN-GREEK-1
|
||||
75f99e2c3282eb84c00ba39dda5495fb charmaps/MACINTOSH
|
||||
15ca1d6d67e5b92f2b597a2e2ac078ea charmaps/MAC-IS
|
||||
b869985c0d872c31ac1156c76c951b28 charmaps/MSZ_7795.3
|
||||
08aed8b910a6d892107bb8cdd71794f5 charmaps/NATS-DANO
|
||||
5abf5f2d900fcbc2ba555b1554424a98 charmaps/NATS-DANO-ADD
|
||||
7d60589127a94570e8b3f1281cd0e8eb charmaps/NATS-SEFI
|
||||
c32dc6d37dd5cf0a129c91f05a5b89e0 charmaps/NATS-SEFI-ADD
|
||||
6c83fd70b4f2d5301cc808e426e30e4e charmaps/NEXTSTEP
|
||||
441065ddef635bc15047c309b3f35951 charmaps/NF_Z_62-010
|
||||
d867bfe77c36b2d1aeecaa3f57d9d4e1 charmaps/NF_Z_62-010-1973
|
||||
018e57c7bd71e87a5e656abfe816a7f3 charmaps/NS_4551-1
|
||||
02b6dd2e3ca9d725fa1a170719fddfde charmaps/NS_4551-2
|
||||
aa63a528dd77226508543f05d083731a charmaps/PT
|
||||
682f1056b6275ddd149e25a358362ea0 charmaps/PT2
|
||||
9680704e24c31df79809b65a27bd071e charmaps/SAMI
|
||||
0aec6669370200f2b257438a600d221c charmaps/SEN_850200_B
|
||||
8d0de9fd47615c228c4464af3b02c397 charmaps/SEN_850200_C
|
||||
db3c60025eb80244d70bf7889f058055 charmaps/T.101-G2
|
||||
572baa84bd05d4b236b7e2fb211d0dfd charmaps/T.61-7BIT
|
||||
1e39e36aa7544014059b0aa8381ab051 charmaps/T.61-8BIT
|
||||
81c8e12a75dff4371ce82773d670cd6d charmaps/VIDEOTEX-SUPPL
|
||||
45ade09ead9fd385d58504bfc005ecab locales/da_DK
|
||||
249894e0554d46d1fbdae4a5fb8cc20e locales/de_AT
|
||||
b3628f73e00bb655a5e96bcc2331893c locales/de_BE
|
||||
e74bb8234af71907f2e53ef2e60d9f45 locales/de_CH
|
||||
b09f9fa150fb8c13b2a5ed17a3448241 locales/de_DE
|
||||
f9c522cf7d07e8020e4b723b29caf8d0 locales/de_LU
|
||||
df036d626c53c86c06231c1502e96fbb locales/en_CA
|
||||
84105524bf0eba76d4a32c3aac8d9a34 locales/en_CA,2.5
|
||||
f55dc7b52a0eb150bab63eef74651a0d locales/en_DK
|
||||
20946213e1c36e3650af5ddfc524bd35 locales/en_GB
|
||||
8f9daff1bd5b2a1332c5bcd54a8aed31 locales/en_IE
|
||||
566209c74fefc01c3c5752b2f5eae667 locales/en_US
|
||||
847fbfac1565c5babea6d6b831bd5242 locales/es_ES
|
||||
732fd15661f8c081e5b43de94832cfc4 locales/et_EE
|
||||
df1e697015f3f3b572231aa9ba07633d locales/eu_ES
|
||||
bda978c8b0e379d57a8599edfdb2e858 locales/fi_FI
|
||||
a25300033ea6c619a4e15051f14aa65e locales/fo_FO
|
||||
02ca55b19338f94530f0b60999638ed4 locales/fr_BE
|
||||
655c7b8713b9aad20014df2c27928cb7 locales/fr_CA
|
||||
8e60885c3fda81bc7773f139657974f3 locales/fr_CA,2.13
|
||||
8a76a0e3ea2923367fdbab78a6bc67cb locales/fr_CA,2.13.orig
|
||||
19403a5cd69a9ad658b173859eb022ef locales/fr_CH
|
||||
48d8981b117e72c5eb2e9c181cbd7d2b locales/fr_FR
|
||||
cc1b77cf4cdc4488a99637e730e0f57f locales/fr_LU
|
||||
1987b72e766038b0f475165c994d1469 locales/ga_IE
|
||||
be2ef06fd9a4b4def515216972fe9250 locales/gr_GR
|
||||
9e2de7fe4b41f9bad952cdc5bfd77cd4 locales/hr_HR
|
||||
7f35d03bbe29b53831674704f8b307af locales/hu_HU
|
||||
1a8b95f6663b7a99703a32c6135d8896 locales/is_IS
|
||||
47620dbc36bf3ffe04b32dd16b7aae3c locales/it_IT
|
||||
f02aa03e057d170058cf0a2d606db09b locales/iw_IL
|
||||
5fa2bc3b08e08cb7f4da2851a7b21f05 locales/kl_GL
|
||||
d5394568c45886788becf67b54bc916e locales/lt_LT
|
||||
9239bf9149845fde73e6324eced3964c locales/lv_LV
|
||||
456f00456ce2e883460aba53e1093c2d locales/nl_BE
|
||||
e71081f29649cfd4ac8563ae1f7932fa locales/nl_NL
|
||||
3a0720088defd80baa0623990c6d196a locales/no_NO
|
||||
6d1bb18d4271cd712e5dc24eec4706b9 locales/pl_PL
|
||||
b07ce7e57dda4687f2a83cd5ec79a3e0 locales/POSIX
|
||||
509fc74fdd394f6876358d357f955645 locales/pt_BR
|
||||
7c2463bcee68bccde3145642a34a8ef1 locales/pt_PT
|
||||
32c766f85eb82823856485e5802dce19 locales/ro_RO
|
||||
8d407ed28a435f58c18b52dc48a3593e locales/ru_RU
|
||||
56af541b88929e9660f30306bd55c4a9 locales/sl_SI
|
||||
a59a08e2288391bc0882068def61d366 locales/sv_FI
|
||||
cc6d1db9e6bb9165429a0be9f46a2c79 locales/sv_SE
|
||||
7f6c0e878f709be0b933ad05100e168c locales/tr_TR
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user