update from main archive 961101

Sat Nov  2 01:48:47 1996  Ulrich Drepper  <drepper@cygnus.com>

	* sysdeps/unix/sysv/linux/errnos.h: Move declaration of errno
	and __errno_location to correct position.

Thu Oct 31 22:51:25 1996  Ulrich Drepper  <drepper@cygnus.com>

	* Makefile (distribute): Add rellns-sh.
	* rellns-sh: New file.
	* Makerules (make-link): Use rellns-sh.
	* time/Makefile ($(installed-localtime-file)): Likewise.

Thu Oct 31 11:33:01 1996  Ulrich Drepper  <drepper@cygnus.com>

	* elf/Makefile ($objpfx)ldd) Substitute $(version) for @VERSION@.
	(distribute): Add ldd.bash.in.
	* elf/ldd.sh.in: Process --help and --version parameter.
	Correct comments.
	* elf/ldd.bash.in: New file.

	* stdlib/stdlib.h: Add prototype for clearenv.
	* sysdeps/generic/setenv.c: Add implementation of clearenv.
	(setenv): Handle __environ == NULL correctly.
	* sysdeps/stub/setenv.c: Add stub definition for unsetenv and
	clearenv.

	* sysdeps/generic/putenv.c: Correct layout to fit in libit.
	* sysdeps/generic/setenv.c: Likewise.
	* stdlib/strtol.h: Likewise.

	* time/sys/time.h: Define __need_timeval and include <timebits.h>.
	Remove definition of struct timeval.
	* sysdeps/stub/timebits.h [__need_timeval]: Define struct timeval
	using `time_t' for members.
	* sysdeps/unix/sysv/linux/timebits.h [__need_timeval]: Likewise.
	* sysdeps/unix/sysv/linux/alpha/timebits.h: New file.  Same
	as old Linux specific version.

	* string/argz.h: Use __const in definitions.
	* inet/herrno.c: Don't define __h_errno, only h_errno otherwise the
	__syscall_error defined.
	TRACE_MODE.
	Craig Metz.
	arithmetic.
	buggy and more competent people work on a usable version which is
	distributed separately.
	`finitel'.
	better message if it is not available.
	whether read failed.
	PSEUDO_END macro.
	Especially on the currently supported ELF systems the nlist
	function comes with the libelf.
	"$(i18ndir)/charmaps".
	net/if_arp.h, and net/route.h.
	version.
	EXTERN_PARSER is defined.
	set errno (to ENOMEM).
	nothing is found.  This guarantees all subsequent calls behave
	the same.
	the file even if no `era's are specified.
	pointers.
	_llseek to _llseek (not llseek).
	Initialize `result'.
	end_alt_digits.
	__libc_force_cancel_wrapper when compiling reentrant version.
	a weak alias.
	make tcdrain a weak alias.
	lseek, open, read, and write to have __libc_ prefix and make old
	names a weak alias.
	to fpathconf.
	__libc_setlocale_lock.
	ld.so.preload.  Suggested by David Engel <david@elo.ods.com>.
	on the same device as the password file.
	variable.
	to lock when passing it to __libc_lock_init macro.
	sysdep.h to the top outside of #ifndef PIC.  Don't include errnos.h.
	Use the ENTRY macro.
	9th field.
	and sys/vt.h.
	`_dl_start' so that linking fails if this file should ever be used
	in ld.so.
	RMS' last standard revision.
	(sysdep_headers): Remove sys/sysinfo.h.
	match files in the sysdeps hierachy (welcome back,
	sys/syscall.h!).
	categories which succeeded to load after a wrong or missing data
	file was observed.
	_IO_flockfile and _IO_funlockfile resp.
	all three versions of the math function.
	non-trivial inline functions.
	rpath-link so that running the check finds the new library.
	daylight saving, timezone by time zone.
	syscall_error handler for reentrant libc.
	warning.
	_IO_getc_unlocked.
	in version information banner.
	clearerr_u, feof_u, ferror_u, fputc_u, getc_u, getchar_u,
	iofflush_u, putc_u, putchar_u, ioflockfile.
	using __errno_location function.
	syscall_error handler for reentrant libc.
	definition of function itself.
	funlockfile.
	_malloc_loc.
	but _POSIX_THREAD_DESTRUCTOR_ITERATIONS.
	Add macro `errno' to get thread specific variable.
	__errno_location function.
	* malloc/free.c (free): __lib_malloc_lock -> __libc_malloc_lock.
	case, so don't prepend uppercase `ISO' for only numeric arg.
	call to __libc_lock_lock.
	sys/sysmacros.h.  Reported by Curtiss <1CMC3466@IBM.MTSAC.EDU>.
	stamp file.
	generating stamp file.
	implementation.
	`decimal' char is 0.
	noexpr to "^[nN]"; this conforms to POSIX.2.
	conform to POSIX.2.
	mon_grouping, int_frac_digits, frac_digits, p_cs_precedes,
	p_sep_by_space, n_cs_precedes, n_sep_by_space, p_sign_posn, and
	n_sign_posn to CHAR_MAX, as required by the POSIX Standard.
	variable.
	this changes the global state for `localtime' and `gmtime'.  Use
	`__localtime_r'/`__gmtime_r' instead.
	state.
	getutid_r() fails with ESRCH.  Reported by Miquel van Smoorenburg.
	for "Jensen" so _bus_base() returns 0 on that platform.  Use
	_bus_base_sparse() to determine base address of sparse memory.
	are now in $P/stdio-common.pot.
	script at run time, not configure time.
	warning.
	sorted.
	inet_net_pton, inet_net.
	value of sprintf.
	functions instead of BSD `b*' functions.
	$(objpfx)/mach-syscalls.mk.
	<marcus@sysc.pdx.edu> for the patch.)
	before returning.  Reported by Miles Bader.
	__BEGIN_DECLS/__END_DECLS up so ntohl() et al are bracketed as
	well.
	This is not a gross hack, after all---for compatibility,
	getlogin() really should check fd 0 only and not try to base its
	operation on the controlling tty.
	change utmp_data from static to auto.
	_IO_file_flags.  It's the same as _flags.
	call is only a stub.
	Mikasa.
	pointer as __const.
	segfault when called with an N that is not a multiple of four and
	src[N-1]=='\0'.
	try again with SOCK_STREAM (the Linux syslogd uses a socket of the
	latter type).
	terminator as a record-delimiter.  If __send(LogFile) fails,
	`getutline_r'.
	`setutline_r'.
	of `vscanf'.
	name a weak alias.
	typo.
	initialized in init-first.c.  Some actions in the libc work
	different when libc is static or dynamic.
	`__libc_is_static' variable to determine whether call to
	`personality' and `setfpucw' is necessary.  When done set variable
	to +-1 depending on library type.
	`__libc_enable_secure' instead of calling `get{,e}{g,u}id()' to
	determine whether it's a SET[UG]ID program.
	(open_file): New function, contents mostly from __open.
	LD_TRACE_LOADED_OBJECTS is set.
	n)' equivalent to `strncpy (d, s, n), d += strnlen (d, n)'.
	from the USA any software that even makes it easy to drop in an
	encryption module of foreign origin.
	old code would have failed on a big-endian 64-bit architecture).
	Remove gratitous parentheses around return expressions.
	not int.
	ustatbits.h.
	alphabetically correct place.  Mention ustat.
	record always gets appended at end of file (wtmp is a log file,
	after all).  Set ut_type to DEAD_PROCESS if name is empty.
	ut_line matches and type is either USER_PROCESS or LOGIN_PROCESS.
	avoid duplicate declarations.
	word extends right up to rmargin.
	point_col ssize_t.
	to fiddle __put_limit in conjunction with __linebuf_active.
	of, not the ones he is _not_ a member of.
	instead of a local function.  The latter are difficult to debug
	and slow to execute on certain platforms.
	place of sizeof (dev).  The size of a literal string includes the
	NUL byte.
	entry.  Return 1 on error, not -1.
	shift amount for Jensen must be 5 not 4.
	for send and connect syscalls.
	signed<->unsigned warnings.
	variable name, so new a libc with new requirements won't fail to
	notice an insufficient Linux version.
	PENDIN, NOFLSH): Undefine these at start if they are already
	defined to avoid collision with termbits.h.
	error is 0.  The "placeholder" entries recently added to
	memcpy for possibly overlapping strings.
	instead of weak_symbol (NAME) after the defn.
	necessary using current implementation of memcpy, but...).
	Move struct timespec defn outside [_TIME_H] so it can be got with
	#define __need_timespec.
	__connect instead of connect to avoid name-space collisions (e.g.,
	with psgetty).
	function ctype_is_charmap to ctype_is_charconv.
	charconv.
	charconv.
	lables according to this.
	warnings.
	actually do something.
	sysdeps/unix/sysv/linux/m68k/init-first.h,
	sysdeps/unix/sysv/linux/i386/init-first.h: New files.
	init-first.h to make abstract machine dependent parts of
	typo/extraneous whitespace.
	check-for-pending signals code, release _hurd_siglock before
	jumping to deliver_pending.
	size_t.
	soname of a loaded object, use that object.
	if libnss_dns.so module for DNS name lookup in NSS service.
	guessing to not assume p_vaddr of first load cmd is zero.
	only for ?s, not for *s.  Fix from Chet Ramey.
	about currently used character set.
	name `MAX_IOVEC'.  Instead use standard name `UIO_MAXIOV'.
	(xdrrec_getlong), sunrpc/xdr_mem.c (xdrmem_getlong): Make sure
	appropriate sign-extension is performed on machines with
	sizeof(long) > 4.
	sizeof(int)<sizeof(long), we need to go through a temporary
	variable.
	in efect.
	volatile to avoid "might get clobbered by longjmp" warning.
	unless _LOOSE_KERNEL_NAMES is in effect (which, with high
	probability is a sure loser).
	sysdeps/unix/sysv/linux/alpha/brk.S,
	sysdeps/unix/sysv/linux/alpha/ieee_get_fp_control.S,
	sysdeps/unix/sysv/linux/alpha/ieee_set_fp_control.S,
	sysdeps/unix/sysv/linux/alpha/llseek.S,
	sysdeps/unix/sysv/linux/alpha/sigsuspend.S,
	sysdeps/unix/sysv/linux/alpha/syscall.S: Rename syscall_error to
	__syscall_error to avoid intruding application name space.
	sysdeps/unix/geteuid.S, sysdeps/unix/getppid.S,
	sysdeps/unix/execve.S, sysdeps/unix/fork.S,
	sysdeps/unix/syscall.S: Terminate syscall with PSEUDO_END.
	(PSEUDO_END): Rename END() to PSEUDO_END().
	to PSEUDO_END to improve branch-prediction.  Include .frame
	directive to make syscalls debugabble.
	sysdeps/unix/sysv/linux/alpha/brk.S: Use ldiq instead of ldi since
	latter is illegal under DEC Unix.
	as well.
	EWOULDBLOCK -> EAGAIN mapping was unnecessary since
	EWOULDBLOCK==EAGAIN under DEC Unix and Linux/Alpha).
	address register in the .frame directive.
	avoid RPC definitions of INADDR_LOOPBACK and/or MAXHOSTNAMELEN.
	compilable under c++.
	as unsigned long, not as int (to avoid incorrect int->long
	promotion).
This commit is contained in:
Ulrich Drepper 1996-11-02 01:28:01 +00:00
parent 78abf56371
commit f0e4495937
19 changed files with 882 additions and 364 deletions

466
ChangeLog

File diff suppressed because it is too large Load Diff

View File

@ -279,7 +279,7 @@ distribute := README INSTALL FAQ NOTES NEWS PROJECTS \
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 munch-tmpl.c munch.awk interp.c \
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

View File

@ -605,7 +605,7 @@ rm -f $(@F).new; \
if test '$(@D)' = '$(<D)'; then \
$(LN_S) $(<F) $(@F).new; \
else \
$(LN_S) $< $(@F).new; \
$(SHELL) $(common-objpfx)$(..)rellns-sh $< $(@F).new; \
fi; \
mv -f $(@F).new $(@F)
endef

View File

@ -35,7 +35,7 @@ elide-routines.so = $(dl-routines) dl-support enbl-secure
# interpreter and operating independent of libc.
rtld-routines := rtld $(dl-routines) dl-sysdep dl-minimal
distribute = $(rtld-routines:=.c) dynamic-link.h do-rel.h dl-machine.h \
soinit.c sofini.c ldd.sh.in eval.c
soinit.c sofini.c ldd.sh.in ldd.bash.in eval.c
extra-libs = libdl
extra-libs-others = $(extra-libs)
@ -100,7 +100,8 @@ $(objpfx)libdl.so: $(objpfx)libdl_pic.a $(common-objpfx)libc.so $(objpfx)ld.so
$(slibdir)/$(rtld-installed-name): $(objpfx)ld.so; $(do-install-program)
$(objpfx)ldd: ldd.sh.in Makefile
sed 's%@RTLD@%$(slibdir)/$(rtld-installed-name)%g' < $< > $@.new
sed -e 's%@RTLD@%$(slibdir)/$(rtld-installed-name)%g' \
-e 's%@VERSION@%$(version)%g' < $< > $@.new
chmod 555 $@.new
mv -f $@.new $@

66
elf/ldd.bash.in Normal file
View File

@ -0,0 +1,66 @@
#! @BASH@
# This is the `ldd' command, which lists what shared libraries are
# used by given dynamically-linked executables. It works by invoking the
# run-time dynamic linker as a command and setting the environment
# variable LD_TRACE_LOADED_OBJECTS to a non-empty value.
RTLD=@RTLD@
usage=$"\
ldd [OPTION]... FILE...
--help print this help and exit
--version print version information and exit
Report bugs to <bug-glibc@prep.ai.mit.edu>."
while test $# -gt 0; do
case "$1" in
--v*)
echo 'ldd (GNU libc) @VERSION@'; exit 0 ;;
--h*)
echo "$usage"; exit 0 ;;
--) # Stop option prcessing
shift; break ;;
*)
break ;;
esac
done
case $# in
0)
echo >&2 $"\
ldd: missing file arguments
Try \`ldd --help' for more information."
exit 1 ;;
1)
# We don't list the file name when there is only one.
case "$1" in
/*) file="$1" ;;
*) file="./$1" ;;
esac
if test ! -f "$file"; then
echo "${file}:" $"no such file"
elif ${RTLD} --verify "$file"; then
LD_TRACE_LOADED_OBJECTS=1 exec ${RTLD} "$file" && exit 1
else
echo $" not a dynamic executable"
fi
exit ;;
*)
set -e # Bail out immediately if ${RTLD} loses on any argument.
for file; do
echo "${file}:"
case "$file" in
/*) : ;;
*) file="./$file" ;;
esac
if test ! -f "$file"; then
echo "$file:" $"no such file"
elif ${RTLD} --verify "$file"; then
LD_TRACE_LOADED_OBJECTS=1 ${RTLD} "$file"
else
echo $" not a dynamic executable"
fi
done
esac
exit 0

View File

@ -2,14 +2,34 @@
# This is the `ldd' command, which lists what shared libraries are
# used by given dynamically-linked executables. It works by invoking the
# run-time dynamic linker as a command and giving it the special `--list'
# switch.
# run-time dynamic linker as a command and setting the environment
# variable LD_TRACE_LOADED_OBJECTS to a non-empty value.
RTLD=@RTLD@
usage="\
ldd [OPTION]... FILE...
--help print this help and exit
--version print version information and exit
Report bugs to <bug-glibc@prep.ai.mit.edu>."
while test $# -gt 0; do
case "$1" in
--v*)
echo 'ldd (GNU libc) @VERSION@'; exit 0 ;;
--h*)
echo "$usage"; exit 0 ;;
--) # Stop option prcessing
shift; break ;;
*)
break ;;
esac
done
case $# in
0)
echo >&2 "Usage: $0 FILE..."
echo >&2 "\
ldd: missing file arguments
Try \`ldd --help' for more information."
exit 1 ;;
1)
# We don't list the file name when there is only one.
@ -18,7 +38,7 @@ case $# in
*) file="./$1" ;;
esac
if test ! -f "$file"; then
echo "$file: no such file"
echo "${file}: no such file"
elif ${RTLD} --verify "$file"; then
LD_TRACE_LOADED_OBJECTS=1 exec ${RTLD} "$file" && exit 1
else
@ -30,7 +50,7 @@ case $# in
for file; do
echo "${file}:"
case "$file" in
/*) file="$file" ;;
/*) : ;;
*) file="./$file" ;;
esac
if test ! -f "$file"; then

67
rellns-sh Executable file
View File

@ -0,0 +1,67 @@
#! /bin/sh
# rellns-sh - Simplified ln program to generate relative symbolic link.
# Copyright (C) 1996 Free Software Foundation, Inc.
# Written by Ulrich Drepper <drepper@cygnus.com>, October 1996
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2, or (at your option)
# any later version.
#
# This program 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 General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
if test $# -ne 2; then
echo "Usage: rellns SOURCE DEST"
exit 1
fi
case $1 in
/*)
# Make both paths absolute.
to=`echo $1 | sed 's%^/%%'`
if test -d $2; then
fromname=.
from=`echo $2 | sed 's%/$%%' | sed 's%^/%%'`
else
fromname=`echo $2 | sed 's%.*/\([^/]*\)$%\1%'`
from=`echo $2 | sed "s%/*$fromname$%%" | sed 's%^/%%'`
fi
case $from in
/*) ;;
?*) from=`cd $from && pwd | sed 's%^/%%'` ;;
*) from=`pwd | sed 's%^/%%'` ;;
esac
while test -n "$to" && test -n "$from"; do
preto=`echo $to | sed 's%^\([^/]*\)/.*%\1%'`
prefrom=`echo $from | sed 's%^\([^/]*\)/.*%\1%'`
test "$preto" != "$prefrom" && break
to=`echo $to | sed 's%^[^/]*/\(.*\)$%\1%'`
from=`echo $from | sed 's%^[^/]*/\(.*\)$%\1%'`
done
while test -n "$from"; do
rfrom="../$rfrom"
from=`echo $from | sed 's%^[^/]*/*%%'`
done
ln -s $rfrom$to $2
;;
*)
# Nothing to do, the path is already relative.
ln -s $1 $2
;;
esac
exit 0

View File

@ -382,6 +382,13 @@ extern int setenv __P ((__const char *__name, __const char *__value,
extern void unsetenv __P ((__const char *__name));
#endif
#ifdef __USE_MISC
/* The `clearenv' was planned to be added to POSIX.1 but probably
never made it. Nevertheless the POSIX.9 standard (POSIX bindings
for Fortran 77) requires this function. */
extern int clearenv __P ((void));
#endif
/* Execute the given line as a shell command. */
extern int system __P ((__const char *__command));

View File

@ -1,22 +1,23 @@
/* Copyright (C) 1991, 92, 94, 95, 96 Free Software Foundation, Inc.
This file is part of the GNU C Library.
/* strtol - Convert string representation of a number into an integer value.
Copyright (C) 1991, 92, 94, 95, 96 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. */
#ifdef HAVE_CONFIG_H
#if HAVE_CONFIG_H
# include <config.h>
#endif
@ -32,7 +33,7 @@ Cambridge, MA 02139, USA. */
extern int errno;
#endif
#ifndef __set_errno
# define __set_errno(val) errno = (val)
# define __set_errno(Val) errno = (Val)
#endif
#ifdef HAVE_LIMITS_H
@ -121,27 +122,27 @@ extern int errno;
#ifdef USE_WIDE_CHAR
# include <wchar.h>
# include <wctype.h>
# define L_(ch) L##ch
# define L_(Ch) L##Ch
# define UCHAR_TYPE wint_t
# define STRING_TYPE wchar_t
# define ISSPACE(ch) iswspace (ch)
# define ISALPHA(ch) iswalpha (ch)
# define TOUPPER(ch) towupper (ch)
# define ISSPACE(Ch) iswspace (Ch)
# define ISALPHA(Ch) iswalpha (Ch)
# define TOUPPER(Ch) towupper (Ch)
#else
# define L_(ch) ch
# define L_(Ch) Ch
# define UCHAR_TYPE unsigned char
# define STRING_TYPE char
# define ISSPACE(ch) isspace (ch)
# define ISALPHA(ch) isalpha (ch)
# define TOUPPER(ch) toupper (ch)
# define ISSPACE(Ch) isspace (Ch)
# define ISALPHA(Ch) isalpha (Ch)
# define TOUPPER(Ch) toupper (Ch)
#endif
#ifdef __STDC__
# define INTERNAL(x) INTERNAL1(x)
# define INTERNAL1(x) __##x##_internal
# define WEAKNAME(x) WEAKNAME1(x)
# define INTERNAL(X) INTERNAL1(X)
# define INTERNAL1(X) __##X##_internal
# define WEAKNAME(X) WEAKNAME1(X)
#else
# define INTERNAL(x) __/**/x/**/_internal
# define INTERNAL(X) __/**/X/**/_internal
#endif
#ifdef USE_NUMBER_GROUPING
@ -340,6 +341,20 @@ noconv:
}
/* External user entry point. */
#if _LIBC - 0 == 0
# undef PARAMS
# if defined (__STDC__) && __STDC__
# define PARAMS(Args) Args
# else
# define PARAMS(Args) ()
# endif
/* Prototype. */
INT strtol PARAMS ((const STRING_TYPE *nptr, STRING_TYPE **endptr, int base));
#endif
INT
#ifdef weak_function
weak_function

View File

@ -1,51 +1,50 @@
/* Copyright (C) 1991, 1994, 1995 Free Software Foundation, Inc.
/* Copyright (C) 1991, 1994, 1995, 1996 Free Software Foundation, Inc.
This file is part of the GNU C Library.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
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. */
#if defined (_AIX) && !defined (__GNUC__)
#pragma alloca
#endif
#ifdef HAVE_CONFIG_H
#include <config.h>
#if HAVE_CONFIG_H
# include <config.h>
#endif
#if _LIBC || HAVE_STDLIB_H
#include <stdlib.h>
# include <stdlib.h>
#endif
#if _LIBC || HAVE_STRING_H
#include <string.h>
# include <string.h>
#endif
#if !__GNU_LIBRARY__ && !HAVE_STRCHR
#define strchr index
# define strchr index
#endif
#ifndef _LIBC
#ifdef HAVE_ALLOCA_H
#include <alloca.h>
#else
#ifdef __GNUC__
#define alloca __builtin_alloca
#else
# ifdef HAVE_ALLOCA_H
# include <alloca.h>
# else
# ifdef __GNUC__
# define alloca __builtin_alloca
# else
extern char *alloca ();
#endif /* __GNUC__ */
#endif /* HAVE_ALLOCA_H */
# endif /* __GNUC__ */
# endif /* HAVE_ALLOCA_H */
#endif /* _LIBC */

View File

@ -1,52 +1,57 @@
/* Copyright (C) 1992, 1995, 1996 Free Software Foundation, Inc.
This file is part of the GNU C Library.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public License as
published by the Free Software Foundation; either version 2 of the
License, or (at your option) any later version.
The GNU C Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public License as
published by the Free Software Foundation; either version 2 of the
License, or (at your option) any later version.
The GNU C Library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
The GNU C Library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public
License along with the GNU C Library; see the file COPYING.LIB. If
not, write to the Free Software Foundation, Inc., 675 Mass Ave,
Cambridge, MA 02139, USA. */
You should have received a copy of the GNU Library General Public
License along with the GNU C Library; see the file COPYING.LIB. If not,
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
#ifdef HAVE_CONFIG_H
#include <config.h>
#if HAVE_CONFIG_H
# include <config.h>
#endif
#include <errno.h>
#if _LIBC || HAVE_STDLIB_H
#include <stdlib.h>
# include <stdlib.h>
#endif
#if _LIBC || HAVE_STRING_H
#include <string.h>
# include <string.h>
#endif
#if _LIBC || HAVE_UNISTD_H
#include <unistd.h>
# include <unistd.h>
#endif
#if _LIBC - 0 == 0
#define __environ environ
# define __environ environ
#endif
#if _LIBC - 0
/* This lock protects against simultaneous modifications of `environ'. */
#include <libc-lock.h>
# include <libc-lock.h>
__libc_lock_define_initialized (static, envlock)
#define LOCK __libc_lock_lock (envlock)
#define UNLOCK __libc_lock_unlock (envlock)
# define LOCK __libc_lock_lock (envlock)
# define UNLOCK __libc_lock_unlock (envlock)
#else
#define LOCK
#define UNLOCK
# define LOCK
# define UNLOCK
#endif
/* If this variable is not a null pointer we allocated the current
environment. */
static char **last_environ;
int
setenv (name, value, replace)
const char *name;
@ -61,17 +66,17 @@ setenv (name, value, replace)
LOCK;
size = 0;
for (ep = __environ; *ep != NULL; ++ep)
if (!strncmp (*ep, name, namelen) && (*ep)[namelen] == '=')
break;
else
++size;
if (__environ != NULL)
for (ep = __environ; *ep != NULL; ++ep)
if (!strncmp (*ep, name, namelen) && (*ep)[namelen] == '=')
break;
else
++size;
if (*ep == NULL)
if (__environ == NULL || *ep == NULL)
{
static char **last_environ;
char **new_environ;
if (__environ == last_environ)
if (__environ == last_environ && __environ != NULL)
/* We allocated this space; we can extend it. */
new_environ = (char **) realloc (last_environ,
(size + 2) * sizeof (char *));
@ -151,3 +156,26 @@ unsetenv (name)
UNLOCK;
}
/* The `clearenv' was planned to be added to POSIX.1 but probably
never made it. Nevertheless the POSIX.9 standard (POSIX bindings
for Fortran 77) requires this function. */
int
clearenv ()
{
LOCK;
if (__environ == last_environ && __environ != NULL)
{
/* We allocated this environment so we can free it. */
free (__environ);
last_environ = NULL;
}
/* Clear the environment pointer removes the whole environment. */
__environ = NULL;
UNLOCK;
return 0;
}

View File

@ -30,3 +30,22 @@ setenv (name, value, replace)
}
stub_warning (setenv)
void
unsetenv (name)
const char *name;
{
__set_errno (ENOSYS);
}
stub_warning (unseenv)
int
clearenv (void)
{
__set_errno (ENOSYS);
return -1;
}
stub_warning (clearenv)

View File

@ -1,21 +1,36 @@
/* System-dependent timing definitions. Stub version.
Copyright (C) 1996 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Copyright (C) 1996 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public License as
published by the Free Software Foundation; either version 2 of the
License, or (at your option) any later version.
The GNU C Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public License as
published by the Free Software Foundation; either version 2 of the
License, or (at your option) any later version.
The GNU C Library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
The GNU C Library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public
License along with the GNU C Library; see the file COPYING.LIB. If not,
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
#ifdef __need_timeval
# undef __need_timeval
# ifndef _STRUCT_TIMEVAL
# define _STRUCT_TIMEVAL 1
/* A time value that is accurate to the nearest
microsecond but also has a range of years. */
struct timeval
{
time_t tv_sec; /* Seconds. */
time_t tv_usec; /* Microseconds. */
};
# endif /* struct timeval */
#endif /* need timeval */
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. */
#ifndef _TIMEBITS_H
#define _TIMEBITS_H 1

View File

@ -0,0 +1,41 @@
/* System-dependent timing definitions. Linux/Alpha version.
Copyright (C) 1996 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public License as
published by the Free Software Foundation; either version 2 of the
License, or (at your option) any later version.
The GNU C Library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public
License along with the GNU C Library; see the file COPYING.LIB. If not,
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
#ifdef __need_timeval
# undef __need_timeval
# ifndef _STRUCT_TIMEVAL
# define _STRUCT_TIMEVAL 1
/* A time value that is accurate to the nearest
microsecond but also has a range of years. */
struct timeval
{
int tv_sec; /* Seconds. */
int tv_usec; /* Microseconds. */
};
# endif /* struct timeval */
#endif /* need timeval */
#ifndef _TIMEBITS_H
#define _TIMEBITS_H 1
#include <asm/param.h>
#define CLOCKS_PER_SEC HZ /* XXX names not kosher */
#endif /* timebits.h */

View File

@ -1,21 +1,21 @@
/* errnos.h - error constants. Linux specific version.
Copyright (C) 1996 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Copyright (C) 1996 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public License as
published by the Free Software Foundation; either version 2 of the
License, or (at your option) any later version.
The GNU C Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public License as
published by the Free Software Foundation; either version 2 of the
License, or (at your option) any later version.
The GNU C Library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
The GNU C Library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public
License along with the GNU C Library; see the file COPYING.LIB. If
not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
You should have received a copy of the GNU Library General Public
License along with the GNU C Library; see the file COPYING.LIB. If not,
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
#ifdef _ERRNO_H
@ -24,13 +24,13 @@ Boston, MA 02111-1307, USA. */
# include <linux/errno.h>
# ifndef __ASSEMBLER__
# ifdef _LIBC
/* We now need a declaration of the `errno' variable. */
extern int errno;
/* Function to get address of global `errno' variable. */
extern int *__errno_location __P ((void)) __attribute__ ((__const__));
# if defined _LIBC
# ifdef _LIBC_REENTRANT
static inline int
__set_errno (int __err)

View File

@ -0,0 +1,186 @@
/* Bit values & structures for resource limits. Linux version.
Copyright (C) 1994, 1996 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public License as
published by the Free Software Foundation; either version 2 of the
License, or (at your option) any later version.
The GNU C Library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public
License along with the GNU C Library; see the file COPYING.LIB. If
not, write to the Free Software Foundation, Inc., 675 Mass Ave,
Cambridge, MA 02139, USA. */
#include <asm/resource.h>
/* Transmute defines to enumerations. The macro re-definitions are
necessary because some programs want to test for operating system
features with #ifdef RUSAGE_SELF. In ISO C the reflexive
definition is a no-op. */
/* Kinds of resource limit. */
enum __rlimit_resource
{
/* Per-process CPU limit, in seconds. */
_RLIMIT_CPU = RLIMIT_CPU,
#undef RLIMIT_CPU
RLIMIT_CPU = _RLIMIT_CPU,
#define RLIMIT_CPU RLIMIT_CPU
/* Largest file that can be created, in bytes. */
_RLIMIT_FSIZE = RLIMIT_FSIZE,
#undef RLIMIT_FSIZE
RLIMIT_FSIZE = _RLIMIT_FSIZE,
#define RLIMIT_FSIZE RLIMIT_FSIZE
/* Maximum size of data segment, in bytes. */
_RLIMIT_DATA = RLIMIT_DATA,
#undef RLIMIT_DATA
RLIMIT_DATA = _RLIMIT_DATA,
#define RLIMIT_DATA RLIMIT_DATA
/* Maximum size of stack segment, in bytes. */
_RLIMIT_STACK = RLIMIT_STACK,
#undef RLIMIT_STACK
RLIMIT_STACK = _RLIMIT_STACK,
#define RLIMIT_STACK RLIMIT_STACK
/* Largest core file that can be created, in bytes. */
_RLIMIT_CORE = RLIMIT_CORE,
#undef RLIMIT_CORE
RLIMIT_CORE = _RLIMIT_CORE,
#define RLIMIT_CORE RLIMIT_CORE
/* Largest resident set size, in bytes.
This affects swapping; processes that are exceeding their
resident set size will be more likely to have physical memory
taken from them. */
_RLIMIT_RSS = RLIMIT_RSS,
#undef RLIMIT_RSS
RLIMIT_RSS = _RLIMIT_RSS,
#define RLIMIT_RSS RLIMIT_RSS
/* Number of open files. */
_RLIMIT_NOFILE = RLIMIT_NOFILE,
#undef RLIMIT_NOFILE
RLIMIT_NOFILE = _RLIMIT_NOFILE,
RLIMIT_OFILE = RLIMIT_NOFILE, /* BSD name for same. */
#define RLIMIT_NOFILE RLIMIT_NOFILE
#define RLIMIT_OFILE RLIMIT_OFILE
/* Address space limit (?) */
_RLIMIT_AS = RLIMIT_AS,
#undef RLIMIT_AS
RLIMIT_AS = _RLIMIT_AS,
#define RLIMIT_AS RLIMIT_AS
/* Number of processes. */
_RLIMIT_NPROC = RLIMIT_NPROC,
#undef RLIMIT_NPROC
RLIMIT_NPROC = _RLIMIT_NPROC,
#define RLIMIT_NPROC RLIMIT_NPROC
/* Locked-in-memory address space. */
_RLIMIT_MEMLOCK = RLIMIT_MEMLOCK,
#undef RLIMIT_MEMLOCK
RLIMIT_MEMLOCK = _RLIMIT_MEMLOCK,
#define RLIMIT_MEMLOCK RLIMIT_MEMLOCK
RLIMIT_NLIMITS = RLIM_NLIMITS,
#undef RLIM_NLIMITS
RLIM_NLIMITS = RLIMIT_NLIMITS,
#define RLIMIT_NLIMITS RLIMIT_NLIMITS
#define RLIM_NLIMITS RLIM_NLIMITS
/* Value to indicate that there is no limit. */
RLIM_INFINITY = (long int)(~0UL >> 1)
#define RLIM_INFINITY RLIM_INFINITY
};
struct rlimit
{
/* The current (soft) limit. */
long int rlim_cur;
/* The hard limit. */
long int rlim_max;
};
/* Whose usage statistics do you want? */
enum __rusage_who
{
/* The calling process. */
RUSAGE_SELF = 0,
#define RUSAGE_SELF RUSAGE_SELF
/* All of its terminated child processes. */
RUSAGE_CHILDREN = -1,
#define RUSAGE_CHILDREN RUSAGE_CHILDREN
/* Both. */
RUSAGE_BOTH = -2
#define RUSAGE_BOTH RUSAGE_BOTH
};
#include <sys/time.h> /* For `struct timeval'. */
/* Structure which says how much of each resource has been used. */
struct rusage
{
/* Total amount of user time used. */
struct timeval ru_utime;
/* Total amount of system time used. */
struct timeval ru_stime;
/* Maximum resident set size (in kilobytes). */
long int ru_maxrss;
/* Amount of sharing of text segment memory
with other processes (kilobyte-seconds). */
long int ru_ixrss;
/* Amount of data segment memory used (kilobyte-seconds). */
long int ru_idrss;
/* Amount of stack memory used (kilobyte-seconds). */
long int ru_isrss;
/* Number of soft page faults (i.e. those serviced by reclaiming
a page from the list of pages awaiting reallocation. */
long int ru_minflt;
/* Number of hard page faults (i.e. those that required I/O). */
long int ru_majflt;
/* Number of times a process was swapped out of physical memory. */
long int ru_nswap;
/* Number of input operations via the file system. Note: This
and `ru_oublock' do not include operations with the cache. */
long int ru_inblock;
/* Number of output operations via the file system. */
long int ru_oublock;
/* Number of IPC messages sent. */
long int ru_msgsnd;
/* Number of IPC messages received. */
long int ru_msgrcv;
/* Number of signals delivered. */
long int ru_nsignals;
/* Number of voluntary context switches, i.e. because the process
gave up the process before it had to (usually to wait for some
resource to be available). */
long int ru_nvcsw;
/* Number of involuntary context switches, i.e. a higher priority process
became runnable or the current process used up its time slice. */
long int ru_nivcsw;
};
/* Priority limits. */
#define PRIO_MIN -20 /* Minimum priority a process can have. */
#define PRIO_MAX 20 /* Maximum priority a process can have. */
/* The type of the WHICH argument to `getpriority' and `setpriority',
indicating what flavor of entity the WHO argument specifies. */
enum __priority_which
{
PRIO_PROCESS = 0, /* WHO is a process ID. */
PRIO_PGRP = 1, /* WHO is a process group ID. */
PRIO_USER = 2 /* WHO is a user ID. */
};

View File

@ -1,21 +1,36 @@
/* System-dependent timing definitions. Linux version.
Copyright (C) 1996 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Copyright (C) 1996 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public License as
published by the Free Software Foundation; either version 2 of the
License, or (at your option) any later version.
The GNU C Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public License as
published by the Free Software Foundation; either version 2 of the
License, or (at your option) any later version.
The GNU C Library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
The GNU C Library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public
License along with the GNU C Library; see the file COPYING.LIB. If not,
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
#ifdef __need_timeval
# undef __need_timeval
# ifndef _STRUCT_TIMEVAL
# define _STRUCT_TIMEVAL 1
/* A time value that is accurate to the nearest
microsecond but also has a range of years. */
struct timeval
{
time_t tv_sec; /* Seconds. */
time_t tv_usec; /* Microseconds. */
};
# endif /* struct timeval */
#endif /* need timeval */
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. */
#ifndef _TIMEBITS_H
#define _TIMEBITS_H 1

View File

@ -121,8 +121,13 @@ target-zone-flavor = $(filter /posix /right, \
ifdef localtime
$(installed-localtime-file): $(zonedir)/$(localtime) $(objpfx)zic
$(make-target-directory)
if test -r $@; then echo Site timezone NOT reset to Factory.; else \
ln -s -f $< $@; fi
if test -r $@; then \
echo Site timezone NOT reset to Factory.; \
else \
rm -f $@T; \
$(SHELL) $(common-objpfx)$(..)rellns-sh $< $@T; \
mv -f $@T $@; \
fi
endif
ifdef posixrules
$(installed-posixrules-file): $(zonedir)/$(posixrules) $(objpfx)zic

View File

@ -23,15 +23,11 @@ Cambridge, MA 02139, USA. */
#include <time.h>
__BEGIN_DECLS
#define __need_timeval
#include <timebits.h>
/* A time value that is accurate to the nearest
microsecond but also has a range of years. */
struct timeval
{
int tv_sec; /* Seconds. */
int tv_usec; /* Microseconds. */
};
__BEGIN_DECLS
/* Macros for converting between `struct timeval' and `struct timespec'. */
#define TIMEVAL_TO_TIMESPEC(tv, ts) { \