1997-12-22 18:10  Ulrich Drepper  <drepper@cygnus.com>

	* configure.in: Stop with error if --disable-static is used when
	the shared lib uses this library.

	* gen-FAQ.pl: I've perl installed in /usr/bin.

	* include/bits/xopen_lim.h (STREAM_MAX): Define using FOPEN_MAX.

	Fix Unix98 conformance problems in the headers.
	* catgets/nl_types.h: Define nl_item.
	* grp/grp.h: Define gid_t.
	* include/features.h [_POSIX_C_SOURCE]: Don't define _XOPEN_SOURCE.
	* include/nl_types.h: New file.
	* include/ulimit.h: New file.
	* io/fcntl.h: Include sys/stat.h for Unix98.  Don't define locking
	constants in POSIX mode.
	* io/utime.h: Get definition for time_t.
	* io/sys/stat.h: Define dev_t, gid_t, ino_t, mode_t, nlink_t, off_t,
	uid_t, pid_t.  Define D_IFLNK and S_IFSOCK only if !__USE_UNIX98.
	* libio/stdio.h: Define va_list.  Make snprintf also available is
	__USE_UNIX98.  Declare getopt function and variables.
	* locale/langinfo.h: Include nl_types.h.  Don't define nl_item.
	Define CODESET, CRNCYSTR, RADIXCHAR and THOUSEP as aliases.
	* math/math.h: Defined M_* constants as double for Unix98 mode.
	* posix/fnmatch.h: Pretty print.  Define FNM_NOSYS.
	* posix/glob.h: Pretty print.  Define GLOB_NOSYS.
	* posix/regex.h: Define REG_NOSYS.
	* posix/wordexp.h: Define WRDE_NOSYS.
	* posix/unistd.h: Define _POSIX2_VERSION.  Define _XOPEN_VERSION to
	500 for Unix98.
	* posix/sys/types.h: Alloc dev_t, mode_t, nlink_t to be defined
	somewhere else as well.  Define clock_t for Unix98.
	* posix/sys/wait.h: Define pid_t.
	* pwd/pwd.h: Define gid_t, uid_t.
	* resource/Makefile (headers): Add ulimit.h.
	* resource/ulimit.h: New file.
	* sysdeps/generic/ulimit.c: Define according to X/Open using varargs
	instead of second argument.
	* sysdeps/unix/bsd/ulimit.c: Likewise.  Use UL_* constants.
	* sysdeps/unix/sysv/linux/ulimit.c: Likewise.
	* resource/sys/resource.h: Don't declare ulimit here, include ulimit.h.
	* signal/signal.h: Define pid_t.
	* string/string.h: Don't declare BSD string functions in POSIX mode.
	* sysdeps/generic/bits/confname.h: Define _PC_VDISABLE.  Add
	_SC_XOPEN_LEGACY, _SC_XOPEN_REALTIME and _SC_XOPEN_REALTIME_THREADS.
	* sysdeps/unix/sysv/linux/bits/termios.h: Clean namespace for Unix98
	and POSIX.

	* inet/test_ifindex.c: Change test so that it does not fail for
	interface aliases.

	* locale/programs/locale.c (show_info): Use correct cast sequence
	for 64bit machines.

	* malloc/malloc.c: __malloc_initialized now signals three states:
	uninitialized, initializing, initialized.  Used in mcheck.
	* malloc/mcheck.c (mabort): Add '\n' to messages.
	(mcheck): Allow installation when malloc is uninitialized or is
	just initializing.

	* manual/memory.texi: Explain mtrace output a bit more.

	* math/libm-test.c: Add more epsilons.

	* misc/regexp.h (compile): Remove __ prefix from parameter names.

	* nis/nss_nis/nis-ethers.c (internal_nis_getetherent_r): Use strncpy
	instead of strcpy for security.
	* nis/nss_nis/nis-proto.c (internal_nis_getprotoent_r): Likewise.
	* nis/nss_nis/nis-rpc.c (internal_nis_getrpcent_r): Likewise.
	* nis/nss_nis/nis-service.c (internal_nis_getservent_r): Likewise.

	* nss/digits_dots.c: Pretty print.

	* posix/getconf.c (vars): Add symbols for programming environment
	recognition.  Recognize --version.

	* sysdeps/generic/sysconf.c: Handle _SC_XBS5_*, _SC_XOPEN_LEGACY,
	_SC_XOPEN_REALTIME, and _SC_XOPEN_REALTIME_THREADS.
	* sysdeps/posix/sysconf.c: Handle _SC_XBS5_* and new _XOPEN_* symbols.

	* sysdeps/generic/bits/stdio_lim.h: Implement handling of
	__need_FOPEN_MAX.
	* sysdeps/unix/sysv/linux/stdio_lim.h.in: Likewise.
	* sysdeps/posix/mk-stdiolim.c: Change to generate file handling
	__need_FOPEN_MAX.

	* sysdeps/unix/sysv/linux/Dist: Add rt_sigpending.c.
	* sysdeps/unix/sysv/linux/rt_sigpending.c: New file.

	* sysdeps/unix/sysv/linux/alpha/bits/types.h: Define __ipc_pid_t.
	* sysdeps/unix/sysv/linux/bits/types.h: Likewise.
	* sysdeps/unix/sysv/linux/sparc/sparc64/bits/types.h: Likewise.
	* sysdeps/unix/sysv/linux/bits/msq.h: Use __ipc_pid_t.
	* sysdeps/unix/sysv/linux/bits/shm.h: Likewise.
	* sysdeps/unix/sysv/linux/mips/bits/types.h: New file.

	* sysdeps/wordsize-32/inttypes.h: Add SCNd8, SCNi8, SCNo8, SCNx8,
	SCNu*.
	* sysdeps/wordsize-64/inttypes.h: Likewise.

	* time/africa: Update from tzdata1997j.
	* time/antarctica: Likewise.
	* time/asia: Likewise.
	* time/australasia: Likewise.
	* time/backward: Likewise.
	* time/etcetera: Likewise.
	* time/europe: Likewise.
	* time/factory: Likewise.
	* time/northamerica: Likewise.
	* time/pacificnew: Likewise.
	* time/southamerica: Likewise.

	* time/tzfile.h: Update from tzcode1997h.
	* time/zic.c: Likewise.

	* wcsmbs/wchar.h: Get definition of FILE.  Define `struct tm' tag.
	Declare wcwidth and wcswidth for __USE_XOPEN.  Declare the
	isw*() functions for Unix98.
	* wctype/towctrans.c: Define as __towctrans, make towctrans weak alias.
	* wctype/wctype.h: Declare isw*() functions also if __need_iswxxx
	is defined.

1997-12-21  Andreas Schwab  <schwab@issan.informatik.uni-dortmund.de>

	* locale/duplocale.c: Increase usage_count only if less than
	MAX_USAGE_COUNT.
	* locale/freelocale.c: Test usage_count against UNDELETABLE, not
	MAX_USAGE_COUNT.
	* locale/setlocale.c: Likewise.

1997-12-20  Andreas Schwab  <schwab@issan.informatik.uni-dortmund.de>

	* Makefile ($(inst_includedir)/gnu/stubs.h): Use a more direct
	dependency to make it easier to install it selectively.

	* Makerules (.SUFFIXES): Don't define any suffixes.

1997-12-20  Andreas Schwab  <schwab@issan.informatik.uni-dortmund.de>

	* sysdeps/generic/fstatfs64.c: Emulate using fstatfs.
	* sysdeps/generic/statfs64.c: Emulate using statfs.
	* sysdeps/generic/getrlimit64.c: Emulate using getrlimit.
	* sysdeps/generic/setrlimit64.c: Emulate using setrlimit.
	* sysdpes/generic/ftruncate64.c: New file.
	* sysdpes/generic/truncate64.c: New file.

	* sysdeps/generic/bits/stat.h: Add LFS support.
	* sysdeps/generic/bits/statfs.h: Likewise.

	* sysdeps/unix/bsd/sun/sunos4/bits/resource.h (RLIM_INFINITY)
	[__USE_FILE_OFFSET64]: Make long long constant.
	(RLIM64_INFINITY): Likewise.

	* sysdeps/unix/sysv/linux/bits/resource.h (RLIM_INFINITY): Correct
	for LFS support.
	(RLIM64_INFINITY) [__USE_LARGEFILE64]: Define.
	* sysdeps/generic/bits/resource.h: Likewise.

	* misc/Makefile (routines): Add truncate64 and ftruncate64.

	* include/features.h: Don't prevent LFS support from defining BSD
	and SYSV things.

	* dirent/dirent.h [__USE_FILE_OFFSET64]: Don't use xxx64 names.
	* io/ftw.h [__USE_FILE_OFFSET64]: Likewise.
	* io/sys/stat.h [__USE_FILE_OFFSET64]: Likewise.

	* sysdeps/unix/sysv/linux/alpha/syscalls.list: Add xxx64 alias for
	fstatfs, statfs, getrlimit, setrlimit, ftruncate and truncate.
	* sysdeps/unix/sysv/linux/sparc/sparc64/syscalls.list: Likewise.

	* sysdeps/unix/sysv/linux/alpha/fstatfs64.c: New file.
	* sysdeps/unix/sysv/linux/alpha/statfs64.c: New file.
	* sysdeps/unix/sysv/linux/alpha/getrlimit64.c: New file.
	* sysdeps/unix/sysv/linux/alpha/setrlimit64.c: New file.
	* sysdeps/unix/sysv/linux/alpha/ftruncate64.c: New file.
	* sysdeps/unix/sysv/linux/alpha/truncate64.c: New file.
	* sysdeps/unix/sysv/linux/alpha/readdir.c: New file.
	* sysdeps/unix/sysv/linux/alpha/readdir64.c: New file.
	* sysdeps/unix/sysv/linux/alpha/readdir64_r.c: New file.
	* sysdeps/unix/sysv/linux/alpha/readdir_r.c: New file.
	* sysdeps/unix/sysv/linux/sparc/sparc64/fstatfs64.c: New file.
	* sysdeps/unix/sysv/linux/sparc/sparc64/statfs64.c: New file.
	* sysdeps/unix/sysv/linux/sparc/sparc64/getrlimit64.c: New file.
	* sysdeps/unix/sysv/linux/sparc/sparc64/setrlimit64.c: New file.
	* sysdeps/unix/sysv/linux/sparc/sparc64/ftruncate64.c: New file.
	* sysdeps/unix/sysv/linux/sparc/sparc64/truncate64.c: New file.
	* sysdeps/unix/sysv/linux/sparc/sparc64/readdir.c: New file.
	* sysdeps/unix/sysv/linux/sparc/sparc64/readdir64.c: New file.
	* sysdeps/unix/sysv/linux/sparc/sparc64/readdir64_r.c: New file.
	* sysdeps/unix/sysv/linux/sparc/sparc64/readdir_r.c: New file.

	* sysdeps/unix/sysv/linux/fxstat64.c: New file.
	* sysdeps/unix/sysv/linux/lxstat64.c: New file.
	* sysdeps/unix/sysv/linux/xstat64.c: New file.
	* sysdeps/unix/sysv/linux/readdir64.c: New file.
	* sysdeps/unix/sysv/linux/readdir64_r.c: New file.

	* sysdeps/unix/sysv/linux/getdents64.c: New file.
	* sysdeps/unix/sysv/linux/Makefile (sysdep_routines)
	[$(subdir)=dirent]: Add getdents64.
	* sysdeps/unix/sysv/linux/Dist: Add getdents64.c.

	* sysdeps/unix/sysv/linux/xstatconv.c: LFS support.

1997-12-18 12:07  Philip Blundell  <pb@nexus.co.uk>

	* sysdeps/generic/bits/statfs.h (struct statfs64): Added.

	* sysdeps/generic/getrlimit.c: Include <sys/types.h>.
	* sysdeps/generic/getrlimit64.c: Likewise.
	* sysdeps/generic/setrlimit.c: Likewise.
	* sysdeps/generic/setrlimit64.c: Likewise.

1997-12-17 13:57  Philip Blundell  <pb@nexus.co.uk>

	* sysdeps/unix/sysv/linux/siglist.c: Fix compile problem if not
	using versioning.

	* sysdeps/generic/waitid.c: Include <sys/types.h> for id_t.

	* sysdeps/standalone/arm/bits/errno.h (EBUSY): Added.

1997-12-16  Andreas Schwab  <schwab@issan.informatik.uni-dortmund.de>

	* locale/programs/ld-ctype.c (ctype_output): Clear out the padding
	after the codeset name.

1997-12-16  Andreas Schwab  <schwab@issan.informatik.uni-dortmund.de>

	* libc.map: Add get_kernel_syms.

1997-12-16  Andreas Schwab  <schwab@issan.informatik.uni-dortmund.de>

	* sysdeps/generic/testrtsig.h (kernel_has_rtsig): Make
	static.
	* sysdeps/unix/sysv/linux/testrtsig.h (kernel_has_rtsig):
	Likewise.  Fix condition.

1997-12-16  Andreas Schwab  <schwab@issan.informatik.uni-dortmund.de>

	* libio/Makefile (routines) [$(versioning)=yes]: Add oldiofdopen.

1997-12-15  Andreas Schwab  <schwab@issan.informatik.uni-dortmund.de>

	* sysdeps/m68k/fpu/bits/mathinline.h: Don't define exp2 inline.
	Define scalbln{,f,l} under __USE_ISOC9X, not __USE_MISC.

1997-12-15  Andreas Schwab  <schwab@issan.informatik.uni-dortmund.de>

	* sysdeps/unix/sysv/linux/powerpc/syscall.S: Put back.
	* sysdeps/unix/sysv/linux/powerpc/sigreturn.S: Delete this
	instead.  Oops.

1997-12-16  Andreas Jaeger  <aj@arthur.rhein-neckar.de>

	* configure.in (libc_cv_gcc_alpha_ng_prefix): Correct quoting.

1997-12-16  Andreas Jaeger  <aj@arthur.rhein-neckar.de>

	* math/libm-test.c (catanh_test): Change epsilon.
	Reported by H.J. Lu.

1997-12-14 19:39  H.J. Lu  <hjl@gnu.org>

	* libc.map (__getpid): Added for linuxthreads.

1997-12-13 21:09  H.J. Lu  <hjl@gnu.org>

	* configure.in (HAVE_DWARF2_UNWIND_INFO_STATIC): Define
	it if gcc uses static variable in DWARF2 unwind information
	for exception support.

	* config.h.in (HAVE_DWARF2_UNWIND_INFO_STATIC): New.

	* elf/soinit.c (__libc_global_ctors, _fini): Handle
	HAVE_DWARF2_UNWIND_INFO_STATIC.

	* libc.map (__register_frame*, __deregister_frame*): Make them
	global.

1997-12-15  Andreas Jaeger  <aj@arthur.rhein-neckar.de>

	* math/libm-test.c: Add more tests for "normal" values.

1997-12-13  Andreas Schwab  <schwab@issan.informatik.uni-dortmund.de>

	* stdio-common/printf_fphex.c: Fix printing of long double number
	with a biased exponent of zero.  Fix rounding.

1997-12-13  Andreas Schwab  <schwab@issan.informatik.uni-dortmund.de>

	* sunrpc/rpc_main.c: Accept new flag -$.
	* sunrpc/Makefile (rpcgen-cmd): Pass it here.

1997-12-13  Andreas Schwab  <schwab@issan.informatik.uni-dortmund.de>

	* Makefile ($(inst_slibdir)/libc-$(version).so): Install the
	dynamic linker first, in case the interface has changed.

1997-12-13  Andreas Schwab  <schwab@issan.informatik.uni-dortmund.de>

	* nss/nss_files/files-alias.c (get_next_alias): Fix parameter
	order.

1997-12-12  Andreas Schwab  <schwab@issan.informatik.uni-dortmund.de>

	* math/tgmath.h: Check for double first, for architectures where
	sizeof (long double) == sizeof (double).

1997-12-07  Andreas Jaeger  <aj@arthur.rhein-neckar.de>

	* math/libm-test.c: New tests for "normal" values added for most
	functions.
This commit is contained in:
Ulrich Drepper 1997-12-22 20:53:38 +00:00
parent bd355af04f
commit 9756dfe161
153 changed files with 2344 additions and 600 deletions

317
ChangeLog
View File

@ -1,3 +1,320 @@
1997-12-22 18:10 Ulrich Drepper <drepper@cygnus.com>
* configure.in: Stop with error if --disable-static is used when
the shared lib uses this library.
* gen-FAQ.pl: I've perl installed in /usr/bin.
* include/bits/xopen_lim.h (STREAM_MAX): Define using FOPEN_MAX.
Fix Unix98 conformance problems in the headers.
* catgets/nl_types.h: Define nl_item.
* grp/grp.h: Define gid_t.
* include/features.h [_POSIX_C_SOURCE]: Don't define _XOPEN_SOURCE.
* include/nl_types.h: New file.
* include/ulimit.h: New file.
* io/fcntl.h: Include sys/stat.h for Unix98. Don't define locking
constants in POSIX mode.
* io/utime.h: Get definition for time_t.
* io/sys/stat.h: Define dev_t, gid_t, ino_t, mode_t, nlink_t, off_t,
uid_t, pid_t. Define D_IFLNK and S_IFSOCK only if !__USE_UNIX98.
* libio/stdio.h: Define va_list. Make snprintf also available is
__USE_UNIX98. Declare getopt function and variables.
* locale/langinfo.h: Include nl_types.h. Don't define nl_item.
Define CODESET, CRNCYSTR, RADIXCHAR and THOUSEP as aliases.
* math/math.h: Defined M_* constants as double for Unix98 mode.
* posix/fnmatch.h: Pretty print. Define FNM_NOSYS.
* posix/glob.h: Pretty print. Define GLOB_NOSYS.
* posix/regex.h: Define REG_NOSYS.
* posix/wordexp.h: Define WRDE_NOSYS.
* posix/unistd.h: Define _POSIX2_VERSION. Define _XOPEN_VERSION to
500 for Unix98.
* posix/sys/types.h: Alloc dev_t, mode_t, nlink_t to be defined
somewhere else as well. Define clock_t for Unix98.
* posix/sys/wait.h: Define pid_t.
* pwd/pwd.h: Define gid_t, uid_t.
* resource/Makefile (headers): Add ulimit.h.
* resource/ulimit.h: New file.
* sysdeps/generic/ulimit.c: Define according to X/Open using varargs
instead of second argument.
* sysdeps/unix/bsd/ulimit.c: Likewise. Use UL_* constants.
* sysdeps/unix/sysv/linux/ulimit.c: Likewise.
* resource/sys/resource.h: Don't declare ulimit here, include ulimit.h.
* signal/signal.h: Define pid_t.
* string/string.h: Don't declare BSD string functions in POSIX mode.
* sysdeps/generic/bits/confname.h: Define _PC_VDISABLE. Add
_SC_XOPEN_LEGACY, _SC_XOPEN_REALTIME and _SC_XOPEN_REALTIME_THREADS.
* sysdeps/unix/sysv/linux/bits/termios.h: Clean namespace for Unix98
and POSIX.
* inet/test_ifindex.c: Change test so that it does not fail for
interface aliases.
* locale/programs/locale.c (show_info): Use correct cast sequence
for 64bit machines.
* malloc/malloc.c: __malloc_initialized now signals three states:
uninitialized, initializing, initialized. Used in mcheck.
* malloc/mcheck.c (mabort): Add '\n' to messages.
(mcheck): Allow installation when malloc is uninitialized or is
just initializing.
* manual/memory.texi: Explain mtrace output a bit more.
* math/libm-test.c: Add more epsilons.
* misc/regexp.h (compile): Remove __ prefix from parameter names.
* nis/nss_nis/nis-ethers.c (internal_nis_getetherent_r): Use strncpy
instead of strcpy for security.
* nis/nss_nis/nis-proto.c (internal_nis_getprotoent_r): Likewise.
* nis/nss_nis/nis-rpc.c (internal_nis_getrpcent_r): Likewise.
* nis/nss_nis/nis-service.c (internal_nis_getservent_r): Likewise.
* nss/digits_dots.c: Pretty print.
* posix/getconf.c (vars): Add symbols for programming environment
recognition. Recognize --version.
* sysdeps/generic/sysconf.c: Handle _SC_XBS5_*, _SC_XOPEN_LEGACY,
_SC_XOPEN_REALTIME, and _SC_XOPEN_REALTIME_THREADS.
* sysdeps/posix/sysconf.c: Handle _SC_XBS5_* and new _XOPEN_* symbols.
* sysdeps/generic/bits/stdio_lim.h: Implement handling of
__need_FOPEN_MAX.
* sysdeps/unix/sysv/linux/stdio_lim.h.in: Likewise.
* sysdeps/posix/mk-stdiolim.c: Change to generate file handling
__need_FOPEN_MAX.
* sysdeps/unix/sysv/linux/Dist: Add rt_sigpending.c.
* sysdeps/unix/sysv/linux/rt_sigpending.c: New file.
* sysdeps/unix/sysv/linux/alpha/bits/types.h: Define __ipc_pid_t.
* sysdeps/unix/sysv/linux/bits/types.h: Likewise.
* sysdeps/unix/sysv/linux/sparc/sparc64/bits/types.h: Likewise.
* sysdeps/unix/sysv/linux/bits/msq.h: Use __ipc_pid_t.
* sysdeps/unix/sysv/linux/bits/shm.h: Likewise.
* sysdeps/unix/sysv/linux/mips/bits/types.h: New file.
* sysdeps/wordsize-32/inttypes.h: Add SCNd8, SCNi8, SCNo8, SCNx8,
SCNu*.
* sysdeps/wordsize-64/inttypes.h: Likewise.
* time/africa: Update from tzdata1997j.
* time/antarctica: Likewise.
* time/asia: Likewise.
* time/australasia: Likewise.
* time/backward: Likewise.
* time/etcetera: Likewise.
* time/europe: Likewise.
* time/factory: Likewise.
* time/northamerica: Likewise.
* time/pacificnew: Likewise.
* time/southamerica: Likewise.
* time/tzfile.h: Update from tzcode1997h.
* time/zic.c: Likewise.
* wcsmbs/wchar.h: Get definition of FILE. Define `struct tm' tag.
Declare wcwidth and wcswidth for __USE_XOPEN. Declare the
isw*() functions for Unix98.
* wctype/towctrans.c: Define as __towctrans, make towctrans weak alias.
* wctype/wctype.h: Declare isw*() functions also if __need_iswxxx
is defined.
1997-12-21 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
* locale/duplocale.c: Increase usage_count only if less than
MAX_USAGE_COUNT.
* locale/freelocale.c: Test usage_count against UNDELETABLE, not
MAX_USAGE_COUNT.
* locale/setlocale.c: Likewise.
1997-12-20 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
* Makefile ($(inst_includedir)/gnu/stubs.h): Use a more direct
dependency to make it easier to install it selectively.
* Makerules (.SUFFIXES): Don't define any suffixes.
1997-12-20 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
* sysdeps/generic/fstatfs64.c: Emulate using fstatfs.
* sysdeps/generic/statfs64.c: Emulate using statfs.
* sysdeps/generic/getrlimit64.c: Emulate using getrlimit.
* sysdeps/generic/setrlimit64.c: Emulate using setrlimit.
* sysdpes/generic/ftruncate64.c: New file.
* sysdpes/generic/truncate64.c: New file.
* sysdeps/generic/bits/stat.h: Add LFS support.
* sysdeps/generic/bits/statfs.h: Likewise.
* sysdeps/unix/bsd/sun/sunos4/bits/resource.h (RLIM_INFINITY)
[__USE_FILE_OFFSET64]: Make long long constant.
(RLIM64_INFINITY): Likewise.
* sysdeps/unix/sysv/linux/bits/resource.h (RLIM_INFINITY): Correct
for LFS support.
(RLIM64_INFINITY) [__USE_LARGEFILE64]: Define.
* sysdeps/generic/bits/resource.h: Likewise.
* misc/Makefile (routines): Add truncate64 and ftruncate64.
* include/features.h: Don't prevent LFS support from defining BSD
and SYSV things.
* dirent/dirent.h [__USE_FILE_OFFSET64]: Don't use xxx64 names.
* io/ftw.h [__USE_FILE_OFFSET64]: Likewise.
* io/sys/stat.h [__USE_FILE_OFFSET64]: Likewise.
* sysdeps/unix/sysv/linux/alpha/syscalls.list: Add xxx64 alias for
fstatfs, statfs, getrlimit, setrlimit, ftruncate and truncate.
* sysdeps/unix/sysv/linux/sparc/sparc64/syscalls.list: Likewise.
* sysdeps/unix/sysv/linux/alpha/fstatfs64.c: New file.
* sysdeps/unix/sysv/linux/alpha/statfs64.c: New file.
* sysdeps/unix/sysv/linux/alpha/getrlimit64.c: New file.
* sysdeps/unix/sysv/linux/alpha/setrlimit64.c: New file.
* sysdeps/unix/sysv/linux/alpha/ftruncate64.c: New file.
* sysdeps/unix/sysv/linux/alpha/truncate64.c: New file.
* sysdeps/unix/sysv/linux/alpha/readdir.c: New file.
* sysdeps/unix/sysv/linux/alpha/readdir64.c: New file.
* sysdeps/unix/sysv/linux/alpha/readdir64_r.c: New file.
* sysdeps/unix/sysv/linux/alpha/readdir_r.c: New file.
* sysdeps/unix/sysv/linux/sparc/sparc64/fstatfs64.c: New file.
* sysdeps/unix/sysv/linux/sparc/sparc64/statfs64.c: New file.
* sysdeps/unix/sysv/linux/sparc/sparc64/getrlimit64.c: New file.
* sysdeps/unix/sysv/linux/sparc/sparc64/setrlimit64.c: New file.
* sysdeps/unix/sysv/linux/sparc/sparc64/ftruncate64.c: New file.
* sysdeps/unix/sysv/linux/sparc/sparc64/truncate64.c: New file.
* sysdeps/unix/sysv/linux/sparc/sparc64/readdir.c: New file.
* sysdeps/unix/sysv/linux/sparc/sparc64/readdir64.c: New file.
* sysdeps/unix/sysv/linux/sparc/sparc64/readdir64_r.c: New file.
* sysdeps/unix/sysv/linux/sparc/sparc64/readdir_r.c: New file.
* sysdeps/unix/sysv/linux/fxstat64.c: New file.
* sysdeps/unix/sysv/linux/lxstat64.c: New file.
* sysdeps/unix/sysv/linux/xstat64.c: New file.
* sysdeps/unix/sysv/linux/readdir64.c: New file.
* sysdeps/unix/sysv/linux/readdir64_r.c: New file.
* sysdeps/unix/sysv/linux/getdents64.c: New file.
* sysdeps/unix/sysv/linux/Makefile (sysdep_routines)
[$(subdir)=dirent]: Add getdents64.
* sysdeps/unix/sysv/linux/Dist: Add getdents64.c.
* sysdeps/unix/sysv/linux/xstatconv.c: LFS support.
1997-12-18 12:07 Philip Blundell <pb@nexus.co.uk>
* sysdeps/generic/bits/statfs.h (struct statfs64): Added.
* sysdeps/generic/getrlimit.c: Include <sys/types.h>.
* sysdeps/generic/getrlimit64.c: Likewise.
* sysdeps/generic/setrlimit.c: Likewise.
* sysdeps/generic/setrlimit64.c: Likewise.
1997-12-17 13:57 Philip Blundell <pb@nexus.co.uk>
* sysdeps/unix/sysv/linux/siglist.c: Fix compile problem if not
using versioning.
* sysdeps/generic/waitid.c: Include <sys/types.h> for id_t.
* sysdeps/standalone/arm/bits/errno.h (EBUSY): Added.
1997-12-16 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
* locale/programs/ld-ctype.c (ctype_output): Clear out the padding
after the codeset name.
1997-12-16 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
* libc.map: Add get_kernel_syms.
1997-12-16 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
* sysdeps/generic/testrtsig.h (kernel_has_rtsig): Make
static.
* sysdeps/unix/sysv/linux/testrtsig.h (kernel_has_rtsig):
Likewise. Fix condition.
1997-12-16 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
* libio/Makefile (routines) [$(versioning)=yes]: Add oldiofdopen.
1997-12-15 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
* sysdeps/m68k/fpu/bits/mathinline.h: Don't define exp2 inline.
Define scalbln{,f,l} under __USE_ISOC9X, not __USE_MISC.
1997-12-15 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
* sysdeps/unix/sysv/linux/powerpc/syscall.S: Put back.
* sysdeps/unix/sysv/linux/powerpc/sigreturn.S: Delete this
instead. Oops.
1997-12-16 Andreas Jaeger <aj@arthur.rhein-neckar.de>
* configure.in (libc_cv_gcc_alpha_ng_prefix): Correct quoting.
1997-12-16 Andreas Jaeger <aj@arthur.rhein-neckar.de>
* math/libm-test.c (catanh_test): Change epsilon.
Reported by H.J. Lu.
1997-12-14 19:39 H.J. Lu <hjl@gnu.org>
* libc.map (__getpid): Added for linuxthreads.
1997-12-13 21:09 H.J. Lu <hjl@gnu.org>
* configure.in (HAVE_DWARF2_UNWIND_INFO_STATIC): Define
it if gcc uses static variable in DWARF2 unwind information
for exception support.
* config.h.in (HAVE_DWARF2_UNWIND_INFO_STATIC): New.
* elf/soinit.c (__libc_global_ctors, _fini): Handle
HAVE_DWARF2_UNWIND_INFO_STATIC.
* libc.map (__register_frame*, __deregister_frame*): Make them
global.
1997-12-15 Andreas Jaeger <aj@arthur.rhein-neckar.de>
* math/libm-test.c: Add more tests for "normal" values.
1997-12-13 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
* stdio-common/printf_fphex.c: Fix printing of long double number
with a biased exponent of zero. Fix rounding.
1997-12-13 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
* sunrpc/rpc_main.c: Accept new flag -$.
* sunrpc/Makefile (rpcgen-cmd): Pass it here.
1997-12-13 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
* Makefile ($(inst_slibdir)/libc-$(version).so): Install the
dynamic linker first, in case the interface has changed.
1997-12-13 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
* nss/nss_files/files-alias.c (get_next_alias): Fix parameter
order.
1997-12-12 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
* math/tgmath.h: Check for double first, for architectures where
sizeof (long double) == sizeof (double).
1997-12-07 Andreas Jaeger <aj@arthur.rhein-neckar.de>
* math/libm-test.c: New tests for "normal" values added for most
functions.
1997-12-14 21:33 Ulrich Drepper <drepper@cygnus.com>
* version.h (VERSION): Bump to 2.0.91.

View File

@ -117,6 +117,9 @@ include Makerules
# Install from subdirectories too.
install: subdir_install
# Make sure that the dynamic linker is installed before libc.
$(inst_slibdir)/libc-$(version).so: elf/subdir_install
# Create links for shared libraries using the `ldconfig' program is possible.
# Ignore the error if we cannot update /etc/ld.so.cache.
ifeq (no,$(cross-compiling))
@ -185,20 +188,19 @@ $(version.c-objects): $(objpfx)version-info.h
subdir-stubs := $(foreach dir,$(subdirs),$(common-objpfx)stub-$(dir))
$(common-objpfx)stub-%: subdir_install
# Since stubs.h is never needed when building the library, we simplify the
# hairy installation process by producing it in place only as the last part
# of the top-level `make install'. It depends on subdir_install, which
# iterates over all the subdirs; subdir_install in each subdir depends on
# the subdir's stubs file. Having more direct dependencies would result in
# extra iterations over the list for subdirs and many recursive makes.
$(inst_includedir)/gnu/stubs.h: subdir_install
# of the top-level `make install'.
$(inst_includedir)/gnu/stubs.h: $(subdir-stubs)
$(make-target-directory)
@rm -f $(objpfx)stubs.h
(echo '/* This file is automatically generated.';\
echo ' It defines a symbol `__stub_FUNCTION'\'' for each function';\
echo ' in the C library which is a stub, meaning it will fail';\
echo ' every time called, usually setting errno to ENOSYS. */';\
sort $(subdir-stubs)) > $(objpfx)stubs.h
sort $^) > $(objpfx)stubs.h
if test -r $@ && cmp -s $(objpfx)stubs.h $@; \
then echo 'stubs.h unchanged'; \
else $(INSTALL_DATA) $(objpfx)stubs.h $@; fi

View File

@ -448,9 +448,7 @@ endif
endif
# Maximize efficiency by minimizing the number of rules.
.SUFFIXES: # Clear the suffix list.
# Add the suffixes we use.
.SUFFIXES: .a $(object-suffixes) .S .s .c .h .d
.SUFFIXES: # Clear the suffix list. We don't use suffix rules.
# Generic rule for making directories.
%/:

View File

@ -41,6 +41,7 @@ enum
_PC_NO_TRUNC,
#define _PC_NO_TRUNC _PC_NO_TRUNC
_PC_VDISABLE,
#define _PC_VDISABLE _PC_VDISABLE
_PC_SYNC_IO,
#define _PC_SYNC_IO _PC_SYNC_IO
_PC_ASYNC_IO,
@ -325,8 +326,15 @@ enum
#define _SC_XBS5_ILP32_OFFBIG _SC_XBS5_ILP32_OFFBIG
_SC_XBS5_LP64_OFF64,
#define _SC_XBS5_LP64_OFF64 _SC_XBS5_LP64_OFF64
_SC_XBS5_LPBIG_OFFBIG
_SC_XBS5_LPBIG_OFFBIG,
#define _SC_XBS5_LPBIG_OFFBIG _SC_XBS5_LPBIG_OFFBIG
_SC_XOPEN_LEGACY,
#define _SC_XOPEN_LEGACY _SC_XOPEN_LEGACY
_SC_XOPEN_REALTIME,
#define _SC_XOPEN_REALTIME _SC_XOPEN_REALTIME
_SC_XOPEN_REALTIME_THREADS
#define _SC_XOPEN_REALTIME_THREADS _SC_XOPEN_REALTIME_THREADS
};
#if (defined __USE_POSIX2 || defined __USE_UNIX98 \

View File

@ -66,11 +66,20 @@ enum __rlimit_resource
RLIMIT_NLIMITS, /* Number of limit flavors. */
RLIM_NLIMITS = RLIMIT_NLIMITS, /* Traditional name for same. */
RLIM_INFINITY = 0x7fffffff /* Value to indicate that there is no limit. */
#define RLIM_INFINITY RLIM_INFINITY
};
/* Value to indicate that there is no limit. */
#ifndef __USE_FILE_OFFSET64
# define RLIM_INFINITY 0x7fffffff
#else
# define RLIM_INFINITY 0x7fffffffffffffffLL
#endif
#ifdef __USE_LARGEFILE64
# define RLIM64_INFINITY 0x7fffffffffffffffLL
#endif
/* Type for resource quantity measurement. */
#ifndef __USE_FILE_OFFSET64
typedef __rlim_t rlim_t;

View File

@ -31,13 +31,21 @@ struct stat
/* These are the members that POSIX.1 requires. */
__mode_t st_mode; /* File mode. */
#ifndef __USE_FILE_OFFSET64
__ino_t st_ino; /* File serial number. */
#else
__ino64_t st_ino; /* File serial number. */
#endif
__dev_t st_dev; /* Device containing the file. */
__nlink_t st_nlink; /* Link count. */
__uid_t st_uid; /* User ID of the file's owner. */
__gid_t st_gid; /* Group ID of the file's group. */
#ifndef __USE_FILE_OFFSET64
__off_t st_size; /* Size of file, in bytes. */
#else
__off64_t st_size; /* Size of file, in bytes. */
#endif
__time_t st_atime; /* Time of last access. */
__time_t st_mtime; /* Time of last modification. */
@ -70,11 +78,11 @@ struct stat
#ifdef __USE_LARGEFILE64
struct stat64
{
__dev_t st_dev; /* Device. */
__ino64_t st_ino; /* File serial number. */
__mode_t st_mode; /* File mode. */
__ino64_t st_ino; /* File serial number. */
__dev_t st_dev; /* Device. */
__nlink_t st_nlink; /* Link count. */
__uid_t st_uid; /* User ID of the file's owner. */
__gid_t st_gid; /* Group ID of the file's group.*/
__off64_t st_size; /* Size of file, in bytes. */

View File

@ -35,12 +35,36 @@ struct statfs
{
unsigned int f_type;
unsigned int f_bsize;
#ifndef __USE_FILE_OFFSET64
__fsblkcnt_t f_blocks;
__fsblkcnt_t f_bfree;
__fsblkcnt_t f_bavail;
__fsblkcnt_t f_files;
__fsblkcnt_t f_ffree;
#else
__fsblkcnt64_t f_blocks;
__fsblkcnt64_t f_bfree;
__fsblkcnt64_t f_bavail;
__fsblkcnt64_t f_files;
__fsblkcnt64_t f_ffree;
#endif
__fsid_t f_fsid;
unsigned int f_namelen;
unsigned int f_spare[6];
};
#ifdef __USE_LARGEFILE64
struct statfs64
{
unsigned int f_type;
unsigned int f_bsize;
__fsblkcnt64_t f_blocks;
__fsblkcnt64_t f_bfree;
__fsblkcnt64_t f_bavail;
__fsblkcnt64_t f_files;
__fsblkcnt64_t f_ffree;
__fsid_t f_fsid;
unsigned int f_namelen;
unsigned int f_spare[6];
};
#endif

View File

@ -1,4 +1,4 @@
/* Copyright (C) 1996 Free Software Foundation, Inc.
/* Copyright (C) 1996, 1997 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@ -33,6 +33,9 @@ __BEGIN_DECLS
/* Message catalog descriptor type. */
typedef void *nl_catd;
/* Type used by `nl_langinfo'. */
typedef int nl_item;
/* Open message catalog for later use, returning descriptor. */
extern nl_catd catopen __P ((__const char *__cat_name, int __flag));

View File

@ -55,6 +55,10 @@
/* Define if gcc uses DWARF2 unwind information for exception support. */
#undef HAVE_DWARF2_UNWIND_INFO
/* Define if gcc uses DWARF2 unwind information for exception support
with static variable. */
#undef HAVE_DWARF2_UNWIND_INFO_STATIC
/* Define is the regparm attribute shall be used for local functions
(gcc on ix86 only). */
#undef USE_REGPARMS

63
configure vendored
View File

@ -2317,7 +2317,7 @@ else
cat > conftest.c <<\EOF
foo () { }
EOF
if { ac_try='${CC-cc} -S conftest.c -o - | fgrep '$foo..ng' > /dev/null'; { (eval echo configure:2321: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; };
if { ac_try='${CC-cc} -S conftest.c -o - | fgrep "\$foo..ng" > /dev/null'; { (eval echo configure:2321: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; };
then
libc_cv_gcc_alpha_ng_prefix=yes
else
@ -2350,8 +2350,14 @@ else
static char __EH_FRAME_BEGIN__;
_start ()
{
#ifdef CHECK__register_frame
__register_frame (__EH_FRAME_BEGIN__);
__deregister_frame (__EH_FRAME_BEGIN__);
#endif
#ifdef CHECK__register_frame_info
__register_frame_info (__EH_FRAME_BEGIN__);
__deregister_frame_info (__EH_FRAME_BEGIN__);
#endif
}
int __eh_pc;
__throw () {}
@ -2365,23 +2371,44 @@ free () {}
abort () {}
__bzero () {}
EOF
if { ac_try='${CC-cc} $CFLAGS
if { ac_try='${CC-cc} $CFLAGS -DCHECK__register_frame_info
-nostdlib -nostartfiles
-o conftest conftest.c -lgcc >&5'; { (eval echo configure:2371: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; }; then
libc_cv_gcc_dwarf2_unwind_info=yes
-o conftest conftest.c -lgcc >&5'; { (eval echo configure:2377: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; }; then
libc_cv_gcc_dwarf2_unwind_info=static
else
libc_cv_gcc_dwarf2_unwind_info=no
fi
if test $libc_cv_gcc_dwarf2_unwind_info = no; then
if { ac_try='${CC-cc} $CFLAGS -DCHECK__register_frame
-nostdlib -nostartfiles
-o conftest conftest.c -lgcc >&5'; { (eval echo configure:2385: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; }; then
libc_cv_gcc_dwarf2_unwind_info=yes
else
libc_cv_gcc_dwarf2_unwind_info=no
fi
fi
rm -f conftest*
fi
echo "$ac_t""$libc_cv_gcc_dwarf2_unwind_info" 1>&6
if test $libc_cv_gcc_dwarf2_unwind_info = yes; then
case $libc_cv_gcc_dwarf2_unwind_info in
yes)
cat >> confdefs.h <<\EOF
#define HAVE_DWARF2_UNWIND_INFO 1
EOF
fi
;;
static)
cat >> confdefs.h <<\EOF
#define HAVE_DWARF2_UNWIND_INFO 1
EOF
cat >> confdefs.h <<\EOF
#define HAVE_DWARF2_UNWIND_INFO_STATIC 1
EOF
;;
esac
### End of automated tests.
### Now run sysdeps configure fragments.
@ -2425,7 +2452,7 @@ if test "$uname" = "sysdeps/generic"; then
fi
echo $ac_n "checking OS release for uname""... $ac_c" 1>&6
echo "configure:2429: checking OS release for uname" >&5
echo "configure:2456: 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
@ -2447,7 +2474,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:2451: checking OS version for uname" >&5
echo "configure:2478: 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
@ -2469,7 +2496,7 @@ else
fi
echo $ac_n "checking stdio selection""... $ac_c" 1>&6
echo "configure:2473: checking stdio selection" >&5
echo "configure:2500: checking stdio selection" >&5
case $stdio in
libio) cat >> confdefs.h <<\EOF
@ -2481,7 +2508,7 @@ esac
echo "$ac_t""$stdio" 1>&6
echo $ac_n "checking ldap selection""... $ac_c" 1>&6
echo "configure:2485: checking ldap selection" >&5
echo "configure:2512: checking ldap selection" >&5
case $add_ons in
*ldap*)
@ -2530,14 +2557,26 @@ if test $shared = default; then
fi
fi
if test $static = no && test $shared = yes; then
case "$host_os" in
linux* | gnu*)
{ echo "configure: error:
*** You must compile with support for the static library since the shared
*** library uses it. Restart configure without \`--disable-static'." 1>&2; exit 1; }
;;
*)
;;
esac
fi
echo $ac_n "checking whether -fPIC is default""... $ac_c" 1>&6
echo "configure:2535: checking whether -fPIC is default" >&5
echo "configure:2574: checking whether -fPIC is default" >&5
if eval "test \"`echo '$''{'pic_default'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
pic_default=yes
cat > conftest.c <<EOF
#if defined(__PIC__) || defined(__pic__) || defined(PIC) || defined(pic)
#if defined __PIC__ || defined __pic__ || defined PIC || defined pic
# error PIC is default.
#endif
EOF

View File

@ -837,7 +837,7 @@ cat > conftest.c <<\EOF
foo () { }
EOF
dnl
if AC_TRY_COMMAND([${CC-cc} -S conftest.c -o - | fgrep '$foo..ng' > /dev/null]);
if AC_TRY_COMMAND([${CC-cc} -S conftest.c -o - | fgrep "\$foo..ng" > /dev/null]);
then
libc_cv_gcc_alpha_ng_prefix=yes
else
@ -857,8 +857,14 @@ AC_CACHE_CHECK(for DWARF2 unwind info support, libc_cv_gcc_dwarf2_unwind_info,
static char __EH_FRAME_BEGIN__[];
_start ()
{
#ifdef CHECK__register_frame
__register_frame (__EH_FRAME_BEGIN__);
__deregister_frame (__EH_FRAME_BEGIN__);
#endif
#ifdef CHECK__register_frame_info
__register_frame_info (__EH_FRAME_BEGIN__);
__deregister_frame_info (__EH_FRAME_BEGIN__);
#endif
}
int __eh_pc;
__throw () {}
@ -873,17 +879,32 @@ abort () {}
__bzero () {}
EOF
dnl No \ in command here because it ends up inside ''.
if AC_TRY_COMMAND([${CC-cc} $CFLAGS
if AC_TRY_COMMAND([${CC-cc} $CFLAGS -DCHECK__register_frame_info
-nostdlib -nostartfiles
-o conftest conftest.c -lgcc >&AC_FD_CC]); then
libc_cv_gcc_dwarf2_unwind_info=yes
libc_cv_gcc_dwarf2_unwind_info=static
else
libc_cv_gcc_dwarf2_unwind_info=no
fi
rm -f conftest*])
if test $libc_cv_gcc_dwarf2_unwind_info = yes; then
AC_DEFINE(HAVE_DWARF2_UNWIND_INFO)
if test $libc_cv_gcc_dwarf2_unwind_info = no; then
if AC_TRY_COMMAND([${CC-cc} $CFLAGS -DCHECK__register_frame
-nostdlib -nostartfiles
-o conftest conftest.c -lgcc >&AC_FD_CC]); then
libc_cv_gcc_dwarf2_unwind_info=yes
else
libc_cv_gcc_dwarf2_unwind_info=no
fi
fi
rm -f conftest*])
case $libc_cv_gcc_dwarf2_unwind_info in
yes)
AC_DEFINE(HAVE_DWARF2_UNWIND_INFO)
;;
static)
AC_DEFINE(HAVE_DWARF2_UNWIND_INFO)
AC_DEFINE(HAVE_DWARF2_UNWIND_INFO_STATIC)
;;
esac
### End of automated tests.
### Now run sysdeps configure fragments.
@ -1024,10 +1045,23 @@ if test $shared = default; then
fi
fi
dnl We must not allow compilation without static library on some platforms.
if test $static = no && test $shared = yes; then
case "$host_os" in
linux* | gnu*)
AC_MSG_ERROR([
*** You must compile with support for the static library since the shared
*** library uses it. Restart configure without \`--disable-static'.])
;;
*)
;;
esac
fi
AC_CACHE_CHECK([whether -fPIC is default], pic_default,
[pic_default=yes
cat > conftest.c <<EOF
#if defined(__PIC__) || defined(__pic__) || defined(PIC) || defined(pic)
#if defined __PIC__ || defined __pic__ || defined PIC || defined pic
# error PIC is default.
#endif
EOF

View File

@ -123,7 +123,7 @@ extern struct dirent *__readdir __P ((DIR *__dirp));
#ifndef __USE_FILE_OFFSET64
extern struct dirent *readdir __P ((DIR *__dirp));
#else
extern struct dirent64 *readdir __P ((DIR *__dirp)) __asm__ ("readdir64");
extern struct dirent *readdir __P ((DIR *__dirp)) __asm__ ("readdir64");
#endif
#ifdef __USE_LARGEFILE64
@ -139,8 +139,8 @@ extern int __readdir_r __P ((DIR *__dirp, struct dirent *__entry,
extern int readdir_r __P ((DIR *__dirp, struct dirent *__entry,
struct dirent **__result));
# else
extern int readdir_r __P ((DIR *__dirp, struct dirent64 *__entry,
struct dirent64 **__result))
extern int readdir_r __P ((DIR *__dirp, struct dirent *__entry,
struct dirent **__result))
__asm__ ("readdir64_r");
# endif

View File

@ -21,8 +21,23 @@ run_hooks (void (*const list[]) (void))
static char __EH_FRAME_BEGIN__[]
__attribute__ ((section (".eh_frame")))
= { };
# ifdef HAVE_DWARF2_UNWIND_INFO_STATIC
/* This must match what's in frame.h in gcc. How can one do that? */
struct object
{
void *pc_begin;
void *pc_end;
void *fde_begin;
void *fde_array;
__SIZE_TYPE__ count;
struct object *next;
};
extern void __register_frame_info (const void *, struct object *);
extern void __deregister_frame_info (const void *);
# else
extern void __register_frame (const void *);
extern void __deregister_frame (const void *);
# endif
#endif
/* This function will be called from _init in init-first.c. */
@ -32,7 +47,14 @@ __libc_global_ctors (void)
/* Call constructor functions. */
run_hooks (__CTOR_LIST__);
#ifdef HAVE_DWARF2_UNWIND_INFO
# ifdef HAVE_DWARF2_UNWIND_INFO_STATIC
{
static struct object ob;
__register_frame_info (__EH_FRAME_BEGIN__, &ob);
}
# else
__register_frame (__EH_FRAME_BEGIN__);
# endif
#endif
}
@ -46,6 +68,10 @@ _fini (void)
/* Call destructor functions. */
run_hooks (__DTOR_LIST__);
#ifdef HAVE_DWARF2_UNWIND_INFO
# ifdef HAVE_DWARF2_UNWIND_INFO_STATIC
__deregister_frame_info (__EH_FRAME_BEGIN__);
# else
__deregister_frame (__EH_FRAME_BEGIN__);
# endif
#endif
}

View File

@ -1,4 +1,4 @@
#! /usr/local/bin/perl
#! /usr/bin/perl
=pod
This is a silly little program for generating the libc FAQ.

View File

@ -33,6 +33,12 @@ __BEGIN_DECLS
#include <stddef.h>
/* For the Single Unix specification we must define this type here. */
#if defined __USE_UNIX98 && !defined gid_t
typedef __gid_t gid_t;
# define gid_t gid_t
#endif
/* The group structure. */
struct group
{

View File

@ -28,9 +28,11 @@
should be used to obtain the actual value. */
#ifndef _XOPEN_LIM_H
#define _XOPEN_LIM_H 1
#define __need_FOPEN_MAX
#include <bits/stdio_lim.h>
/* We do not provide fixed values for
ARG_MAX Maximum length of argument to the `exec' function
@ -57,7 +59,7 @@
#define IOV_MAX _XOPEN_IOV_MAX
/* The number of streams that one process can have open at one time. */
#define STREAM_MAX _POSIX_STREAM_MAX
#define STREAM_MAX FOPEN_MAX
/* Maximum number of bytes supported for the name of a time zone. */
#define TZNAME_MAX _POSIX_TZNAME_MAX

View File

@ -109,7 +109,6 @@
#if defined _BSD_SOURCE && \
!(defined _POSIX_SOURCE || defined _POSIX_C_SOURCE || \
defined _XOPEN_SOURCE || defined _XOPEN_SOURCE_EXTENDED || \
defined _LARGEFILE64_SOURCE || defined _FILE_OFFSET_BITS || \
defined _GNU_SOURCE || defined _SVID_SOURCE)
# define __FAVOR_BSD 1
#endif
@ -139,7 +138,6 @@
#if (!defined __STRICT_ANSI__ && !defined _ISOC9X_SOURCE && \
!defined _POSIX_SOURCE && !defined _POSIX_C_SOURCE && \
!defined _XOPEN_SOURCE && !defined _XOPEN_SOURCE_EXTENDED && \
!defined _LARGEFILE64_SOURCE && !defined _FILE_OFFSET_BITS && \
!defined _BSD_SOURCE && !defined _SVID_SOURCE)
# define _BSD_SOURCE 1
# define _SVID_SOURCE 1
@ -171,13 +169,8 @@
# define __USE_POSIX2 1
#endif
#ifdef _POSIX_C_SOURCE
# if _POSIX_C_SOURCE >= 199309L
# define __USE_POSIX199309 1
# endif
# ifndef _XOPEN_SOURCE
# define _XOPEN_SOURCE 500
# endif
#if (_POSIX_C_SOURCE - 0) >= 199309L
# define __USE_POSIX199309 1
#endif
#ifdef _XOPEN_SOURCE

1
include/nl_types.h Normal file
View File

@ -0,0 +1 @@
#include <catgets/nl_types.h>

1
include/ulimit.h Normal file
View File

@ -0,0 +1 @@
#include <resource/ulimit.h>

View File

@ -51,6 +51,11 @@ main (void)
printf ("%3d", ni = if_nametoindex (p->if_name));
printf ("%15s", if_indextoname (p->if_index, buf));
result = (ni != p->if_index || (strcmp (buf, p->if_name)));
if (ni == p->if_index)
/* We have to make sure that this is not an alias with the
same interface number. */
if (p->if_index == if_nametoindex (buf))
result = 0;
printf ("%10s", result ? "fail" : "okay");
printf ("\n");
failures += result;

View File

@ -32,6 +32,11 @@ __BEGIN_DECLS
numbers and flag bits for `open', `fcntl', et al. */
#include <bits/fcntl.h>
/* For Unix98 all symbols from <sys/stat.h> should also be available. */
#ifdef __USE_UNIX98
# include <sys/stat.h>
#endif
#ifdef __USE_MISC
# ifndef R_OK /* Verbatim from <unistd.h>. Ugh. */
/* Values for the second argument to access.
@ -76,7 +81,8 @@ extern int creat __P ((__const char *__file, __mode_t __mode))
extern int creat64 __P ((__const char *__file, __mode_t __mode));
#endif
#if !defined F_LOCK && (defined __USE_MISC || defined __USE_XOPEN_EXTENDED)
#if !defined F_LOCK && (defined __USE_MISC || (defined __USE_XOPEN_EXTENDED \
&& !defined __USE_POSIX))
/* NOTE: These declarations also appear in <unistd.h>; be sure to keep both
files consistent. Some systems have them there and some here, and some
software depends on the macros being defined without including both. */

View File

@ -88,7 +88,7 @@ struct FTW
/* Convenient types for callback functions. */
typedef int (*__ftw_func_t) __P ((__const char *__filename,
__const struct stat *__status, int __flag));
#if defined __USE_LARGEFILE64 || defined __USE_FILE_OFFSET64
#ifdef __USE_LARGEFILE64
typedef int (*__ftw64_func_t) __P ((__const char *__filename,
__const struct stat64 *__status,
int __flag));
@ -97,7 +97,7 @@ typedef int (*__ftw64_func_t) __P ((__const char *__filename,
typedef int (*__nftw_func_t) __P ((__const char *__filename,
__const struct stat *__status, int __flag,
struct FTW *__info));
# if defined __USE_LARGEFILE64 || defined __USE_FILE_OFFSET64
# ifdef __USE_LARGEFILE64
typedef int (*__nftw64_func_t) __P ((__const char *__filename,
__const struct stat64 *__status,
int __flag, struct FTW *__info));
@ -109,7 +109,7 @@ typedef int (*__nftw64_func_t) __P ((__const char *__filename,
extern int ftw __P ((__const char *__dir, __ftw_func_t __func,
int __descriptors));
#else
extern int ftw __P ((__const char *__dir, __ftw64_func_t __func,
extern int ftw __P ((__const char *__dir, __ftw_func_t __func,
int __descriptors)) __asm__ ("ftw64");
#endif
#ifdef __USE_LARGEFILE64
@ -124,7 +124,7 @@ extern int ftw64 __P ((__const char *__dir, __ftw64_func_t __func,
extern int nftw __P ((__const char *__dir, __nftw_func_t __func,
int __descriptors, int __flag));
# else
extern int nftw __P ((__const char *__dir, __nftw64_func_t __func,
extern int nftw __P ((__const char *__dir, __nftw_func_t __func,
int __descriptors, int __flag)) __asm__ ("nftw64");
# endif
# ifdef __USE_LARGEFILE64

View File

@ -27,25 +27,79 @@
#include <bits/types.h> /* For __mode_t and __dev_t. */
#ifdef __USE_UNIX98
/* The Single Unix specification says that some more types are
available here. */
# ifndef dev_t
typedef __dev_t dev_t;
# define dev_t dev_t
# endif
# ifndef gid_t
typedef __gid_t gid_t;
# define gid_t gid_t
# endif
# ifndef ino_t
# ifndef __USE_FILE_OFFSET64
typedef __ino_t ino_t;
# else
typedef __ino64_t ino_t;
# endif
# define ino_t ino_t
# endif
# ifndef mode_t
typedef __mode_t mode_t;
# define mode_t mode_t
# endif
# ifndef nlink_t
typedef __nlink_t nlink_t;
# define nlink_t nlink_t
# endif
# ifndef off_t
# ifndef __USE_FILE_OFFSET64
typedef __off_t off_t;
# else
typedef __off64_t off_t;
# endif
# define off_t off_t
# endif
# ifndef uid_t
typedef __uid_t uid_t;
# define uid_t uid_t
# endif
# ifndef pid_t
typedef __pid_t pid_t;
# define pid_t pid_t
# endif
#endif /* Unix98 */
__BEGIN_DECLS
#include <bits/stat.h>
#if defined __USE_BSD || defined __USE_MISC
#if defined __USE_BSD || defined __USE_MISC || defined __USE_UNIX98
# define S_IFMT __S_IFMT
# define S_IFDIR __S_IFDIR
# define S_IFCHR __S_IFCHR
# define S_IFBLK __S_IFBLK
# define S_IFREG __S_IFREG
# ifdef __S_IFLNK
# define S_IFLNK __S_IFLNK
# endif
# ifdef __S_IFSOCK
# define S_IFSOCK __S_IFSOCK
# endif
# ifdef __S_IFIFO
# define S_IFIFO __S_IFIFO
# endif
# ifndef __USE_UNIX98
# ifdef __S_IFLNK
# define S_IFLNK __S_IFLNK
# endif
# ifdef __S_IFSOCK
# define S_IFSOCK __S_IFSOCK
# endif
# endif
#endif
/* Test macros for file types. */
@ -221,15 +275,25 @@ extern int mkfifo __P ((__const char *__path, __mode_t __mode));
#endif
/* Wrappers for stat and mknod system calls. */
#ifndef __USE_FILE_OFFSET64
extern int __fxstat __P ((int __ver, int __fildes,
struct stat *__stat_buf));
extern int __xstat __P ((int __ver, __const char *__filename,
struct stat *__stat_buf));
extern int __lxstat __P ((int __ver, __const char *__filename,
struct stat *__stat_buf));
extern int __xmknod __P ((int __ver, __const char *__path,
__mode_t __mode, __dev_t *__dev));
#if defined __USE_LARGEFILE64 || defined __USE_FILE_OFFSET64
#else
extern int __fxstat __P ((int __ver, int __fildes,
struct stat *__stat_buf))
__asm__ ("__fxstat64");
extern int __xstat __P ((int __ver, __const char *__filename,
struct stat *__stat_buf))
__asm__ ("__xstat64");
extern int __lxstat __P ((int __ver, __const char *__filename,
struct stat *__stat_buf))
__asm__ ("__lxstat64");
#endif
#ifdef __USE_LARGEFILE64
extern int __fxstat64 __P ((int __ver, int __fildes,
struct stat64 *__stat_buf));
extern int __xstat64 __P ((int __ver, __const char *__filename,
@ -237,61 +301,39 @@ extern int __xstat64 __P ((int __ver, __const char *__filename,
extern int __lxstat64 __P ((int __ver, __const char *__filename,
struct stat64 *__stat_buf));
#endif
extern int __xmknod __P ((int __ver, __const char *__path,
__mode_t __mode, __dev_t *__dev));
#if defined __GNUC__ && __GNUC__ >= 2
/* Inlined versions of the real stat and mknod functions. */
extern __inline__ int __stat (__const char *__path, struct stat *__statbuf)
{
# ifndef __USE_FILE_OFFSET64
return __xstat (_STAT_VER, __path, __statbuf);
# else
return __xstat64 (_STAT_VER, __path, __statbuf);
# endif
}
extern __inline__ int stat (__const char *__path, struct stat *__statbuf)
{
# ifndef __USE_FILE_OFFSET64
return __xstat (_STAT_VER, __path, __statbuf);
# else
return __xstat64 (_STAT_VER, __path, __statbuf);
# endif
}
extern __inline__ int __lstat (__const char *__path, struct stat *__statbuf)
{
# ifndef __USE_FILE_OFFSET64
return __lxstat (_STAT_VER, __path, __statbuf);
# else
return __lxstat64 (_STAT_VER, __path, __statbuf);
# endif
}
# if defined __USE_BSD || defined __USE_XOPEN_EXTENDED
extern __inline__ int lstat (__const char *__path, struct stat *__statbuf)
{
# ifndef __USE_FILE_OFFSET64
return __lxstat (_STAT_VER, __path, __statbuf);
# else
return __lxstat64 (_STAT_VER, __path, __statbuf);
# endif
}
# endif
extern __inline__ int __fstat (int __fd, struct stat *__statbuf)
{
# ifndef __USE_FILE_OFFSET64
return __fxstat (_STAT_VER, __fd, __statbuf);
# else
return __fxstat64 (_STAT_VER, __fd, __statbuf);
# endif
}
extern __inline__ int fstat (int __fd, struct stat *__statbuf)
{
# ifndef __USE_FILE_OFFSET64
return __fxstat (_STAT_VER, __fd, __statbuf);
# else
return __fxstat64 (_STAT_VER, __fd, __statbuf);
# endif
}
extern __inline__ int __mknod (__const char *__path, __mode_t __mode,

View File

@ -1,4 +1,4 @@
/* Copyright (C) 1991, 1992, 1996 Free Software Foundation, Inc.
/* Copyright (C) 1991, 1992, 1996, 1997 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@ -29,6 +29,11 @@ __BEGIN_DECLS
#include <bits/types.h>
#ifdef __USE_UNIX98
# define __need_time_t
# include <time.h>
#endif
/* Structure describing file times. */
struct utimbuf
{

View File

@ -98,8 +98,7 @@ GLIBC_2.0 {
# Exception handling support functions from libgcc
__register_frame; __register_frame_table; __deregister_frame;
__register_frame_new; __register_frame_table_new; __deregister_frame_new;
__frame_state_for;
__register_frame_info; __deregister_frame_info;
# variables in normal name space
argp_err_exit_status; argp_program_bug_address; argp_program_version;
@ -193,7 +192,7 @@ GLIBC_2.0 {
# g*
gai_strerror; gcvt; get_avphys_pages; get_current_dir_name;
get_myaddress; get_nprocs; get_nprocs_conf;
get_kernel_syms; get_myaddress; get_nprocs; get_nprocs_conf;
get_phys_pages; getaddrinfo; getaliasbyname; getaliasbyname_r;
getaliasent; getaliasent_r; getc; getc_unlocked; getchar;
getchar_unlocked; getcontext;

View File

@ -43,7 +43,7 @@ all: # Make this the default target; it will be defined in Rules.
include ../Makeconfig
ifeq ($(versioning),yes)
routines += oldiofopen oldiofclose oldiofclose
routines += oldiofopen oldiofdopen oldiofclose oldiofclose
endif
CPPFLAGS-.o += -DIO_DEBUG

View File

@ -22,7 +22,7 @@
#ifndef _STDIO_H
#if !defined __need_FILE
#ifndef __need_FILE
# define _STDIO_H 1
# include <features.h>
@ -32,6 +32,9 @@ __BEGIN_DECLS
# define __need_NULL
# include <stddef.h>
# define __need___va_list
# include <stdarg.h>
# include <bits/types.h>
#endif /* Don't need FILE. */
#undef __need_FILE
@ -282,7 +285,7 @@ vprintf (__const char *__restrict __fmt, _G_va_list __arg)
}
#endif /* Optimizing. */
#if defined __USE_BSD || defined __USE_ISOC9X
#if defined __USE_BSD || defined __USE_ISOC9X || defined __USE_UNIX98
/* Maximum chars of output to write in MAXLEN. */
extern int __snprintf __P ((char *__restrict __s, size_t __maxlen,
__const char *__restrict __format, ...))
@ -452,7 +455,7 @@ putchar_unlocked (int __c)
#endif /* Use POSIX or MISc. */
#if defined __USE_SVID || defined __USE_MISC
#if defined __USE_SVID || defined __USE_MISC || defined __USE_XOPEN
/* Get a word (int) from STREAM. */
extern int getw __P ((FILE *__stream));
@ -701,6 +704,21 @@ extern int ftrylockfile __P ((FILE *__stream));
extern void funlockfile __P ((FILE *__stream));
#endif /* POSIX || misc */
#if defined __USE_XOPEN && !defined __USE_GNU
/* The X/Open standard requires some functions and variables to be
declared here which do not belong into this header. But we have to
follow. In GNU mode we don't do this nonsense. */
/* For more information on these symbols look in <getopt.h>. */
extern char *optarg;
extern int optind;
extern int opterr;
extern int optopt;
extern int getopt __P ((int __argc, char *__const *__argv,
__const char *__shortopts));
#endif
__END_DECLS
/* Define helper macro. */

View File

@ -45,7 +45,7 @@ __duplocale (__locale_t dataset)
for (cnt = 0; cnt < LC_ALL; ++cnt)
{
result->__locales[cnt] = dataset->__locales[cnt];
if (result->__locales[cnt]->usage_count != MAX_USAGE_COUNT)
if (result->__locales[cnt]->usage_count < MAX_USAGE_COUNT)
++result->__locales[cnt]->usage_count;
}
}

View File

@ -38,7 +38,7 @@ __freelocale (__locale_t dataset)
__libc_lock_lock (__libc_setlocale_lock);
for (cnt = 0; cnt < LC_ALL; ++cnt)
if (dataset->__locales[cnt]->usage_count != MAX_USAGE_COUNT)
if (dataset->__locales[cnt]->usage_count != UNDELETABLE)
/* We can remove the data. */
_nl_remove_locale (cnt, dataset->__locales[cnt]);

View File

@ -1,5 +1,5 @@
/* nl_langinfo -- Access to locale-dependent parameters.
Copyright (C) 1995, 1996 Free Software Foundation, Inc.
/* Access to locale-dependent parameters.
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
@ -22,6 +22,10 @@
#include <locale.h> /* Define the LC_* category names. */
/* Get the type definition. */
#include <nl_types.h>
__BEGIN_DECLS
/* Construct an `nl_item' value for `nl_langinfo' from a locale category
@ -36,7 +40,7 @@ __BEGIN_DECLS
/* Enumeration of locale items that can be queried with `nl_langinfo'. */
typedef enum
enum
{
/* LC_TIME category: date and time formatting. */
@ -153,6 +157,9 @@ typedef enum
_NL_CTYPE_WIDTH,
_NL_CTYPE_MB_CUR_MAX,
_NL_CTYPE_CODESET_NAME,
#ifdef __USE_UNIX98
CODESET = _NL_CTYPE_CODESET_NAME,
#endif
_NL_NUM_LC_CTYPE,
/* LC_MONETARY category: formatting of monetary quantities.
@ -160,6 +167,9 @@ typedef enum
defined in <locale.h>. */
INT_CURR_SYMBOL = _NL_ITEM (LC_MONETARY, 0),
CURRENCY_SYMBOL,
#ifdef __USE_UNIX98
CRNCYSTR = CURRENCY_SYMBOL,
#endif
MON_DECIMAL_POINT,
MON_THOUSANDS_SEP,
MON_GROUPING,
@ -178,7 +188,13 @@ typedef enum
/* LC_NUMERIC category: formatting of numbers.
These also correspond to members of `struct lconv'; see <locale.h>. */
DECIMAL_POINT = _NL_ITEM (LC_NUMERIC, 0),
#ifdef __USE_UNIX98
RADIXCHAR = DECIMAL_POINT,
#endif
THOUSANDS_SEP,
#ifdef __USE_UNIX98
THOUSEP = THOUSANDS_SEP,
#endif
GROUPING,
_NL_NUM_LC_NUMERIC,
@ -190,7 +206,7 @@ typedef enum
/* This marks the highest value used. */
_NL_NUM
} nl_item;
};
/* Return the current locale's value for ITEM.

View File

@ -492,8 +492,9 @@ ctype_output (struct localedef_t *locale, struct charset_t *charset,
else
{
iov[2 + elem + offset].iov_base = alloca ((total + 3) & ~3);
memcpy (iov[2 + elem + offset].iov_base, ctype->codeset_name,
total);
memset (mempcpy (iov[2 + elem + offset].iov_base,
ctype->codeset_name, total),
'\0', 4 - (total & 3));
total = (total + 3) & ~3;
}
iov[2 + elem + offset].iov_len = total;

View File

@ -657,7 +657,8 @@ show_info (const char *name)
break;
case word:
{
unsigned int val = (unsigned int) nl_langinfo (item->item_id);
unsigned int val =
(unsigned int) (unsigned long int) nl_langinfo (item->item_id);
printf ("%d", val);
}
break;

View File

@ -312,8 +312,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. */
if (newdata[category]->usage_count != MAX_USAGE_COUNT)
newdata[category]->usage_count = MAX_USAGE_COUNT;
if (newdata[category]->usage_count != UNDELETABLE)
newdata[category]->usage_count = UNDELETABLE;
}
/* Create new composite name. */
@ -362,8 +362,8 @@ setlocale (int category, const char *locale)
Note: do ont remove the `if', it's necessary to copy with
the builtin locale data. */
if (newdata->usage_count != MAX_USAGE_COUNT)
newdata->usage_count = MAX_USAGE_COUNT;
if (newdata->usage_count != UNDELETABLE)
newdata->usage_count = UNDELETABLE;
}
/* Create new composite name. */

View File

@ -1522,7 +1522,7 @@ static unsigned long max_mmapped_mem = 0;
#endif
/* Already initialized? */
int __malloc_initialized = 0;
int __malloc_initialized = -1;
/* The following two functions are registered via thread_atfork() to
@ -1596,8 +1596,8 @@ ptmalloc_init __MALLOC_P((void))
const char* s;
#endif
if(__malloc_initialized) return;
__malloc_initialized = 1;
if(__malloc_initialized >= 0) return;
__malloc_initialized = 0;
#if defined _LIBC || defined MALLOC_HOOKS
/* With some threads implementations, creating thread-specific data
or initializing a mutex may call malloc() itself. Provide a
@ -1638,6 +1638,7 @@ ptmalloc_init __MALLOC_P((void))
if(__malloc_initialize_hook != NULL)
(*__malloc_initialize_hook)();
#endif
__malloc_initialized = 1;
}
/* There are platforms (e.g. Hurd) with a link-time hook mechanism. */

View File

@ -21,10 +21,10 @@
or (US mail) as Mike Haertel c/o Free Software Foundation. */
#ifndef _MALLOC_INTERNAL
#define _MALLOC_INTERNAL
#include <malloc.h>
#include <mcheck.h>
#include <stdio.h>
# define _MALLOC_INTERNAL
# include <malloc.h>
# include <mcheck.h>
# include <stdio.h>
#endif
/* Old hook values. */
@ -49,9 +49,9 @@ struct hdr
unsigned long int magic; /* Magic number to check header integrity. */
};
#if defined(_LIBC) || defined(STDC_HEADERS) || defined(USG)
#include <string.h>
#define flood memset
#if defined _LIBC || defined STDC_HEADERS || defined USG
# include <string.h>
# define flood memset
#else
static void flood __P ((__ptr_t, int, __malloc_size_t));
static void
@ -196,25 +196,25 @@ mabort (status)
switch (status)
{
case MCHECK_OK:
msg = _("memory is consistent, library is buggy");
msg = _("memory is consistent, library is buggy\n");
break;
case MCHECK_HEAD:
msg = _("memory clobbered before allocated block");
msg = _("memory clobbered before allocated block\n");
break;
case MCHECK_TAIL:
msg = _("memory clobbered past end of allocated block");
msg = _("memory clobbered past end of allocated block\n");
break;
case MCHECK_FREE:
msg = _("block freed twice");
msg = _("block freed twice\n");
break;
default:
msg = _("bogus mcheck_status, library is buggy");
msg = _("bogus mcheck_status, library is buggy\n");
break;
}
#ifdef _LIBC
__libc_fatal (msg);
#else
fprintf (stderr, "mcheck: %s\n", msg);
fprintf (stderr, "mcheck: %s", msg);
fflush (stderr);
abort ();
#endif
@ -229,7 +229,7 @@ mcheck (func)
abortfunc = (func != NULL) ? func : &mabort;
/* These hooks may not be safely inserted if malloc is already in use. */
if (!__malloc_initialized && !mcheck_used)
if (__malloc_initialized <= 0 && !mcheck_used)
{
old_free_hook = __free_hook;
__free_hook = freehook;

View File

@ -975,7 +975,7 @@ main (int argc, char *argv[])
@}
@end example
I.e., the user can start the memory debugger any time he wants if the
I.e., the user can start the memory debugger any time s/he wants if the
program was started with @code{MALLOC_TRACE} set in the environment.
The output will of course not show the allocations which happened before
the first signal but if there is a memory leak this will show up
@ -1004,9 +1004,9 @@ readability. Instead there is a program which comes with the GNU C
library which interprets the traces and outputs a summary in on
user-friendly way. The program is called @code{mtrace} (it is in fact a
Perl script) and it takes one or two arguments. In any case the name of
the file with the trace must be specified. If an optional precedes the
name of the trace file this must be the name of the program which
generated the trace.
the file with the trace output must be specified. If an optional argument
precedes the name of the trace file this must be the name of the program
which generated the trace.
@example
drepper$ mtrace tst-mtrace log
@ -1058,6 +1058,21 @@ Memory not freed:
Suddenly the output makes much more sense and the user can see
immediately where the function calls causing the trouble can be found.
Interpreting this output is not complicated. There are at most two
different situations being detected. First, @code{free} was called for
pointers which were never returned by one of the allocation functions.
This is usually a very bad problem and how this looks like is shown in
the first three lines of the output. Situations like this are quite
rare and if they appear they show up very drastically: the program
normally crashes.
The other situation which is much harder to detect are memory leaks. As
you can see in the output the @code{mtrace} function collects all this
information and so can say that the program calls an allocation function
from line 33 in the source file @file{/home/drepper/tst-mtrace.c} four
times without freeing this memory before the program terminates.
Whether this is a real problem keeps to be investigated.
@node Obstacks
@section Obstacks
@cindex obstacks

View File

@ -86,6 +86,9 @@ test-longdouble-yes = test-ldouble test-ildoubl
CFLAGS-test-float.c = -fno-inline -ffloat-store
CFLAGS-test-double.c = -fno-inline -ffloat-store
CFLAGS-test-ldouble.c = -fno-inline -ffloat-store
CFLAGS-test-ifloat.c = -U__LIBC_INTERNAL_MATH_INLINES
CFLAGS-test-idouble.c = -U__LIBC_INTERNAL_MATH_INLINES
CFLAGS-test-ildoubl.c = -U__LIBC_INTERNAL_MATH_INLINES
LDLIBS-test-ifloat = math/libm
LDLIBS-test-idouble = math/libm
LDLIBS-test-ildoubl = math/libm

View File

@ -844,8 +844,10 @@ acos_test (void)
check ("acos (1) == 0", FUNC(acos) (1), 0);
check ("acos (-1) == pi", FUNC(acos) (-1), M_PI);
check ("acos (0.5) == pi/3", FUNC(acos) (0.5), M_PI_6 * 2.0);
check ("acos (-0.5) == 2*pi/3", FUNC(acos) (-0.5), M_PI_6 * 4.0);
check_eps ("acos (0.5) == pi/3", FUNC(acos) (0.5), M_PI_6 * 2.0,
CHOOSE (1e-18, 0, 0));
check_eps ("acos (-0.5) == 2*pi/3", FUNC(acos) (-0.5), M_PI_6 * 4.0,
CHOOSE (1e-17, 0, 0));
check_eps ("acos (0.7) == 0.795398830...", FUNC(acos) (0.7),
0.7953988301841435554L, CHOOSE(7e-17L, 0, 0));
@ -927,8 +929,10 @@ atan_test (void)
check ("atan (+inf) == pi/2", FUNC(atan) (plus_infty), M_PI_2);
check ("atan (-inf) == -pi/2", FUNC(atan) (minus_infty), -M_PI_2);
check ("atan (1) == pi/4", FUNC(atan) (1), M_PI_4);
check ("atan (-1) == -pi/4", FUNC(atan) (1), M_PI_4);
check_eps ("atan (1) == pi/4", FUNC(atan) (1), M_PI_4,
CHOOSE (1e-18, 0, 0));
check_eps ("atan (-1) == -pi/4", FUNC(atan) (1), M_PI_4,
CHOOSE (1e-18, 0, 0));
check_eps ("atan (0.7) == 0.610725964...", FUNC(atan) (0.7),
0.6107259643892086165L, CHOOSE(3e-17L, 0, 0));
@ -1008,6 +1012,11 @@ atan2_test (void)
FUNC(atan2) (minus_infty, minus_infty), -3 * M_PI_4);
/* FIXME: Add some specific tests */
check_eps ("atan2 (0.7,1) == 0.61072...", FUNC(atan2) (0.7,1),
0.6107259643892086165L, CHOOSE(3e-17L, 0, 0));
check_eps ("atan2 (0.4,0.0003) == 1.57004...", FUNC(atan2) (0.4, 0.0003),
1.5700463269355215718L, CHOOSE(2e-19L, 0, 0));
}
@ -1168,8 +1177,10 @@ exp_test (void)
#endif
check_eps ("exp (1) == e", FUNC(exp) (1), M_E, CHOOSE (4e-18L, 5e-16, 0));
check ("exp (2) == e^2", FUNC(exp) (2), M_E * M_E);
check ("exp (3) == e^3", FUNC(exp) (3), M_E * M_E * M_E);
check_eps ("exp (2) == e^2", FUNC(exp) (2), M_E * M_E,
CHOOSE (1e-18, 0, 0));
check_eps ("exp (3) == e^3", FUNC(exp) (3), M_E * M_E * M_E,
CHOOSE (1.5e-17, 0, 0));
check_eps ("exp (0.7) == 2.0137527074...", FUNC(exp) (0.7),
2.0137527074704765216L, CHOOSE(9e-17L, 0, 0));
}
@ -1211,6 +1222,9 @@ expm1_test (void)
check_eps ("expm1 (1) == e-1", FUNC(expm1) (1), M_E - 1.0,
CHOOSE (4e-18L, 0, 2e-7));
check_eps ("expm1 (0.7) == 1.01375...", FUNC(expm1) (0.7),
1.0137527074704765216L, CHOOSE(9e-17L, 0, 0));
}
@ -1438,6 +1452,10 @@ gamma_test (void)
check ("gamma (1) == 1", FUNC(gamma) (1), 1);
check ("gamma (4) == 6", FUNC(gamma) (4), 6);
check_eps ("gamma (0.7) == 1.29805...", FUNC(gamma) (0.7),
1.29805533264755778568L, CHOOSE(0, 3e-16, 2e-7));
check ("gamma (1.2) == 0.91816...", FUNC(gamma) (1.2), 0.91816874239976061064L);
_LIB_VERSION = save_lib_version;
}
@ -1480,6 +1498,16 @@ lgamma_test (void)
check_int ("lgamma (-0.5) sets signgam to -1", signgam, -1);
signgam = 0;
check_eps ("lgamma (0.7) == 0.26086...", FUNC(lgamma) (0.7),
0.26086724653166651439L, CHOOSE(0, 6e-17, 3e-8));
check_int ("lgamma (0.7) sets signgam to 1", signgam, 1);
signgam = 0;
check_eps ("lgamma (1.2) == -0.08537...", FUNC(lgamma) (1.2),
-0.853740900033158497197e-1L, CHOOSE(0, 2e-17, 2e-8));
check_int ("lgamma (1.2) sets signgam to 1", signgam, 1);
}
@ -1595,6 +1623,8 @@ log1p_test (void)
check_eps ("log1p (e-1) == 1", FUNC(log1p) (M_E - 1.0), 1,
CHOOSE (1e-18L, 0, 6e-8));
check_eps ("log1p (-0.3) == -0.35667...", FUNC(log1p) (-0.3),
-0.35667494393873237891L, CHOOSE(2e-17L, 6e-17, 3e-8));
}
@ -1954,6 +1984,9 @@ hypot_test (void)
check ("hypot (x,0) == fabs (x)", FUNC(hypot) (1.0L, 0), 1.0L);
check ("hypot (x,0) == fabs (x)", FUNC(hypot) (-5.7e7L, 0), 5.7e7L);
check ("hypot (x,0) == fabs (x)", FUNC(hypot) (5.7e7L, 0), 5.7e7L);
check_eps ("hypot (0.7,1.2) == 1.38924...", FUNC(hypot) (0.7, 1.2),
1.3892443989449804508L, CHOOSE(7e-17L, 3e-16, 0));
}
@ -2146,6 +2179,9 @@ pow_test (void)
x = ((rand () % 1000000) + 1) * 2.0; /* Get random even integer > 1 */
check_ext ("pow (-0, y) == +0 for y > 0 and not an odd integer",
FUNC(pow) (minus_zero, x), 0.0, x);
check_eps ("pow (0.7, 1.2) == 0.65180...", FUNC(pow) (0.7, 1.2),
0.65180494056638638188L, CHOOSE(4e-17L, 0, 0));
}
@ -4541,7 +4577,7 @@ ctanh_test (void)
result = FUNC(ctanh) (BUILD_COMPLEX (0, M_PI_4));
check ("real(ctanh (0 + i pi/4)) == 0", __real__ result, 0);
check_eps ("imag(ctanh (0 + i pi/4)) == 1", __imag__ result, 1,
CHOOSE (0, 0, 2e-7));
CHOOSE (0, 2e-16, 2e-7));
result = FUNC(ctanh) (BUILD_COMPLEX (0.7, 1.2));
check_eps ("real(ctanh(0.7 + i 1.2)) == 1.34721...", __real__ result,
@ -5086,15 +5122,16 @@ cpow_test (void)
check ("imag(cpow (2 + i0), (10 + i0)) == 0", __imag__ result, 0);
result = FUNC (cpow) (BUILD_COMPLEX (M_E, 0), BUILD_COMPLEX (0, 2*M_PI));
check ("real(cpow (e + i0), (0 + i 2*PI)) == 1", __real__ result, 1);
check_eps ("real(cpow (e + i0), (0 + i 2*PI)) == 1", __real__ result, 1,
CHOOSE (0, 0, 6e-8));
check_eps ("imag(cpow (e + i0), (0 + i 2*PI)) == 0", __imag__ result, 0,
CHOOSE (1e-18L, 3e-16, 4e-7));
CHOOSE (3e-18L, 3e-16, 4e-7));
result = FUNC (cpow) (BUILD_COMPLEX (2, 3), BUILD_COMPLEX (4, 0));
check_eps ("real(cpow (2 + i3), (4 + i0)) == -119", __real__ result, -119,
CHOOSE (2e-17L, 2e-14, 4e-5));
CHOOSE (9e-16L, 2e-14, 4e-5));
check_eps ("imag(cpow (2 + i3), (4 + i0)) == -120", __imag__ result, -120,
CHOOSE (4e-17L, 0, 8e-6));
CHOOSE (1e-15L, 0, 5e-5));
}
@ -5137,6 +5174,8 @@ cabs_test (void)
check ("cabs (x,0) == fabs (x)", FUNC(cabs) (BUILD_COMPLEX(5.7e7L, 0)),
5.7e7L);
check_eps ("cabs (0.7 + i 1.2) == 1.38924...", FUNC(cabs) (BUILD_COMPLEX(0.7, 1.2)),
1.3892443989449804508L, CHOOSE(7e-17L, 3e-16, 0));
}

View File

@ -262,7 +262,7 @@ extern int matherr __P ((struct exception *__exc));
#endif /* SVID */
#ifdef __USE_BSD
#if defined __USE_BSD || defined __USE_UNIX98
/* Some useful constants. */
# define M_E _Mldbl(2.7182818284590452354) /* e */
@ -292,7 +292,7 @@ extern int matherr __P ((struct exception *__exc));
Please note we define the macro even if the constants are not defined.
This helps us to use the macros in other places. */
#if __STDC__ - 0 || __GNUC__ - 0
#if (__STDC__ - 0 || __GNUC__ - 0) && defined __USE_GNU
# define _Mldbl(x) x##L
#else /* Traditional C. */
# define _Mldbl(x) x

View File

@ -40,70 +40,70 @@
only defined on real valued parameters and those which are defined
for complex functions as well. */
# define __TGMATH_UNARY_REAL_ONLY(Val, Fct) \
(__extension__ (sizeof (__real__ (Val)) == sizeof (long double) \
? Fct##l (Val) \
: (sizeof (__real__ (Val)) == sizeof (double) \
? Fct (Val) \
(__extension__ (sizeof (__real__ (Val)) == sizeof (double) \
? Fct (Val) \
: (sizeof (__real__ (Val)) == sizeof (long double) \
? Fct##l (Val) \
: Fct##f (Val))))
# define __TGMATH_BINARY_FIRST_REAL_ONLY(Val1, Val2, Fct) \
(__extension__ (sizeof (__real__ (Val1)) == sizeof (long double) \
? Fct##l (Val1, Val2) \
: (sizeof (__real__ (Val1)) == sizeof (double) \
? Fct (Val1, Val2) \
(__extension__ (sizeof (__real__ (Val1)) == sizeof (double) \
? Fct (Val1, Val2) \
: (sizeof (__real__ (Val1)) == sizeof (long double) \
? Fct##l (Val1, Val2) \
: Fct##f (Val1, Val2))))
# define __TGMATH_BINARY_REAL_ONLY(Val1, Val2, Fct) \
(__extension__ (sizeof (Val1) == sizeof (long double) \
|| sizeof (Val2) == sizeof (long double) \
? Fct##l (Val1, Val2) \
: (sizeof (Val1) == sizeof (double) \
|| sizeof (Val2) == sizeof (double) \
? Fct (Val1, Val2) \
(__extension__ (sizeof (Val1) == sizeof (double) \
|| sizeof (Val2) == sizeof (double) \
? Fct (Val1, Val2) \
: (sizeof (Val1) == sizeof (long double) \
|| sizeof (Val2) == sizeof (long double) \
? Fct##l (Val1, Val2) \
: Fct##f (Val1, Val2))))
# define __TGMATH_TERNARY_FIRST_SECOND_REAL_ONLY(Val1, Val2, Val3, Fct) \
(__extension__ (sizeof (Val1) == sizeof (long double) \
|| sizeof (Val2) == sizeof (long double) \
? Fct##l (Val1, Val2, Val3) \
: (sizeof (Val1) == sizeof (double) \
|| sizeof (Val2) == sizeof (double) \
? Fct (Val1, Val2, Val3) \
(__extension__ (sizeof (Val1) == sizeof (double) \
|| sizeof (Val2) == sizeof (double) \
? Fct (Val1, Val2, Val3) \
: (sizeof (Val1) == sizeof (long double) \
|| sizeof (Val2) == sizeof (long double) \
? Fct##l (Val1, Val2, Val3) \
: Fct##f (Val1, Val2, Val3))))
# define __TGMATH_UNARY_REAL_IMAG(Val, Fct, Cfct) \
(__extension__ (sizeof (__real__ (Val)) == sizeof (long double) \
(__extension__ (sizeof (__real__ (Val)) == sizeof (double) \
? (sizeof (__real__ (Val)) == sizeof (Val) \
? Fct##l (Val) \
: Cfct##l (Val)) \
: (sizeof (__real__ (Val)) == sizeof (double) \
? Fct (Val) \
: Cfct (Val)) \
: (sizeof (__real__ (Val)) == sizeof (long double) \
? (sizeof (__real__ (Val)) == sizeof (Val) \
? Fct (Val) \
: Cfct (Val)) \
? Fct##l (Val) \
: Cfct##l (Val)) \
: (sizeof (__real__ (Val)) == sizeof (Val) \
? Fct##f (Val) \
: Cfct##f (Val)))))
# define __TGMATH_UNARY_IMAG_ONLY(Val, Fct) \
(__extension__ (sizeof (Val) == sizeof (__complex__ long double) \
? Fct##l (Val) \
: (sizeof (Val) == sizeof (__complex__ double) \
? Fct (Val) \
(__extension__ (sizeof (Val) == sizeof (__complex__ double) \
? Fct (Val) \
: (sizeof (Val) == sizeof (__complex__ long double) \
? Fct##l (Val) \
: Fct##f (Val))))
# define __TGMATH_BINARY_REAL_IMAG(Val1, Val2, Fct, Cfct) \
(__extension__ (sizeof (__real__ (Val1)) == sizeof (long double) \
|| sizeof (__real__ (Val2)) == sizeof (long double) \
(__extension__ (sizeof (__real__ (Val1)) == sizeof (double) \
|| sizeof (__real__ (Val2)) == sizeof (double) \
? (sizeof (__real__ (Val1)) == sizeof (Val1) \
&& sizeof (__real__ (Val2)) == sizeof (Val2) \
? Fct##l (Val1, Val2) \
: Cfct##l (Val1, Val2)) \
: (sizeof (__real__ (Val1)) == sizeof (double) \
|| sizeof (__real__ (Val2)) == sizeof (double) \
? Fct (Val1, Val2) \
: Cfct (Val1, Val2)) \
: (sizeof (__real__ (Val1)) == sizeof (long double) \
|| sizeof (__real__ (Val2)) == sizeof (long double) \
? (sizeof (__real__ (Val1)) == sizeof (Val1) \
&& sizeof (__real__ (Val2)) == sizeof (Val2) \
? Fct (Val1, Val2) \
: Cfct (Val1, Val2)) \
? Fct##l (Val1, Val2) \
: Cfct##l (Val1, Val2)) \
: (sizeof (__real__ (Val1)) == sizeof (Val1) \
&& sizeof (__real__ (Val2)) == sizeof (Val2) \
? Fct##f (Val1, Val2) \

View File

@ -48,7 +48,7 @@ routines := brk sbrk sstk ioctl \
ptrace \
fstab mntent mntent_r \
utimes \
truncate ftruncate \
truncate ftruncate truncate64 ftruncate64 \
chflags fchflags \
insremque getttyent getusershell getpass ttyslot \
syslog syscall daemon \

View File

@ -98,7 +98,7 @@ extern char *locs;
This function cannot be defined in the libc itself since it depends
on the macros. */
char *
compile (char *__instring, char *__expbuf, __const char *__endbuf, int __eof)
compile (char *instring, char *expbuf, __const char *endbuf, int eof)
{
char *__input_buffer = NULL;
size_t __input_size = 0;
@ -118,19 +118,19 @@ compile (char *__instring, char *__expbuf, __const char *__endbuf, int __eof)
this really proofs to be wrong. */
const size_t __req = 8;
# endif
__expbuf += __req;
__expbuf -= (__expbuf - ((char *) 0)) % __req;
if (__endbuf < __expbuf + sizeof (regex_t))
expbuf += __req;
expbuf -= (expbuf - ((char *) 0)) % __req;
if (endbuf < expbuf + sizeof (regex_t))
{
ERROR (50);
}
__expr_ptr = (regex_t *) __expbuf;
__expr_ptr = (regex_t *) expbuf;
/* The remaining space in the buffer can be used for the compiled
pattern. */
__expr_ptr->buffer = __expbuf + sizeof (regex_t);
__expr_ptr->allocated = __endbuf - (char *) __expr_ptr->buffer;
__expr_ptr->buffer = expbuf + sizeof (regex_t);
__expr_ptr->allocated = endbuf - (char *) __expr_ptr->buffer;
while ((__ch = (GETC ())) != __eof)
while ((__ch = (GETC ())) != eof)
{
if (__ch == '\0' || __ch == 'n')
{

View File

@ -159,7 +159,7 @@ internal_nis_getetherent_r (struct ether *eth, char *buffer, size_t buflen,
if (next == NULL)
return NSS_STATUS_NOTFOUND;
p = strcpy (buffer, next->val);
p = strncpy (buffer, next->val, buflen);
while (isspace (*p))
++p;

View File

@ -151,7 +151,7 @@ internal_nis_getprotoent_r (struct protoent *proto,
if (next == NULL)
return NSS_STATUS_NOTFOUND;
p = strcpy (buffer, next->val);
p = strncpy (buffer, next->val, buflen);
while (isspace (*p))
++p;

View File

@ -168,7 +168,7 @@ internal_nis_getrpcent_r (struct rpcent *rpc, char *buffer, size_t buflen,
{
if (data->next == NULL)
return NSS_STATUS_NOTFOUND;
p = strcpy (buffer, data->next->val);
p = strncpy (buffer, data->next->val, buflen);
while (isspace (*p))
++p;

View File

@ -168,7 +168,7 @@ internal_nis_getservent_r (struct servent *serv, char *buffer,
{
if (data->next == NULL)
return NSS_STATUS_NOTFOUND;
p = strcpy (buffer, data->next->val);
p = strncpy (buffer, data->next->val, buflen);
while (isspace (*p))
++p;

View File

@ -48,7 +48,7 @@
default:
af = (_res.options & RES_USE_INET6) ? AF_INET6 : AF_INET;
addr_size = (af == AF_INET6 ) ? IN6ADDRSZ : INADDRSZ;
addr_size = af == AF_INET6 ? IN6ADDRSZ : INADDRSZ;
break;
}

View File

@ -131,7 +131,7 @@ _nss_files_endaliasent (void)
/* Parsing the database file into `struct aliasent' data structures. */
static enum nss_status
get_next_alias (const char *match, struct aliasent *result,
char *buffer, int *errnop, size_t buflen)
char *buffer, size_t buflen, int *errnop)
{
enum nss_status status = NSS_STATUS_NOTFOUND;
int ignore = 0;

View File

@ -23,18 +23,24 @@
extern "C" {
#endif
#if (defined (__cplusplus) || (defined (__STDC__) && __STDC__) \
|| defined (WINDOWS32))
#undef __P
#define __P(protos) protos
#if defined __cplusplus || (defined __STDC__ && __STDC__) || defined WINDOWS32
# undef __P
# define __P(protos) protos
#else /* Not C++ or ANSI C. */
#undef __P
#define __P(protos) ()
# undef __P
# define __P(protos) ()
/* We can get away without defining `const' here only because in this file
it is used only inside the prototype for `fnmatch', which is elided in
non-ANSI C where `const' is problematical. */
#endif /* C++ or ANSI C. */
#ifndef const
# if (defined __STDC__ && __STDC__) || defined __cplusplus
# define __const const
# else
# define __const
# endif
#endif
/* We #undef these before defining them because some losing systems
(HP-UX A.08.07 for example) define these in <unistd.h>. */
@ -47,18 +53,26 @@ extern "C" {
#define FNM_NOESCAPE (1 << 1) /* Backslashes don't quote special chars. */
#define FNM_PERIOD (1 << 2) /* Leading `.' is matched only explicitly. */
#if !defined (_POSIX_C_SOURCE) || _POSIX_C_SOURCE < 2 || defined (_GNU_SOURCE)
#define FNM_FILE_NAME FNM_PATHNAME /* Preferred GNU name. */
#define FNM_LEADING_DIR (1 << 3) /* Ignore `/...' after a match. */
#define FNM_CASEFOLD (1 << 4) /* Compare without regard to case. */
#if !defined _POSIX_C_SOURCE || _POSIX_C_SOURCE < 2 || defined _GNU_SOURCE
# define FNM_FILE_NAME FNM_PATHNAME /* Preferred GNU name. */
# define FNM_LEADING_DIR (1 << 3) /* Ignore `/...' after a match. */
# define FNM_CASEFOLD (1 << 4) /* Compare without regard to case. */
#endif
/* Value returned by `fnmatch' if STRING does not match PATTERN. */
#define FNM_NOMATCH 1
/* This value is returned if the implementation does not support
`fnmatch'. Since this is not the case here it will never be
returned but the conformance test suites still require the symbol
to be defined. */
#if (_XOPEN_SOURCE - 0) == 500
# define FNM_NOSYS (-1)
#endif
/* Match STRING against the filename pattern PATTERN,
returning zero if it matches, FNM_NOMATCH if not. */
extern int fnmatch __P ((const char *__pattern, const char *__string,
extern int fnmatch __P ((__const char *__pattern, __const char *__string,
int __flags));
#ifdef __cplusplus

View File

@ -20,10 +20,14 @@
#include <errno.h>
#include <error.h>
#include <libintl.h>
#include <locale.h>
#include <string.h>
#include <stdlib.h>
#include <stdio.h>
#include "../version.h"
#define PACKAGE _libc_intl_domainname
struct conf
{
const char *name;
@ -148,6 +152,9 @@ static const struct conf vars[] =
{ "_T_IOV_MAX", _SC_T_IOV_MAX, SYSCONF },
{ "_XOPEN_CRYPT", _SC_XOPEN_CRYPT, SYSCONF },
{ "_XOPEN_ENH_I18N", _SC_XOPEN_ENH_I18N, SYSCONF },
{ "_XOPEN_LEGACY", _SC_XOPEN_LEGACY, SYSCONF },
{ "_XOPEN_REALTIME", _SC_XOPEN_REALTIME, SYSCONF },
{ "_XOPEN_REALTIME_THREADS", _SC_XOPEN_REALTIME_THREADS, SYSCONF },
{ "_XOPEN_SHM", _SC_XOPEN_SHM, SYSCONF },
{ "_XOPEN_UNIX", _SC_XOPEN_UNIX, SYSCONF },
{ "_XOPEN_VERSION", _SC_XOPEN_VERSION, SYSCONF },
@ -198,6 +205,31 @@ static const struct conf vars[] =
{ "LFS64_LIBS", _CS_LFS64_LIBS, CONFSTR },
{ "LFS64_LINTFLAGS", _CS_LFS64_LINTFLAGS, CONFSTR },
/* Programming environments. */
{ "XBS5_ILP32_OFF32", _SC_XBS5_ILP32_OFF32, SYSCONF },
{ "XBS5_ILP32_OFF32_CFLAGS", _CS_XBS5_ILP32_OFF32_CFLAGS, CONFSTR },
{ "XBS5_ILP32_OFF32_LDFLAGS", _CS_XBS5_ILP32_OFF32_LDFLAGS, CONFSTR },
{ "XBS5_ILP32_OFF32_LIBS", _CS_XBS5_ILP32_OFF32_LIBS, CONFSTR },
{ "XBS5_ILP32_OFF32_LINTFLAGS", _CS_XBS5_ILP32_OFF32_LINTFLAGS, CONFSTR },
{ "XBS5_ILP32_OFFBIG", _SC_XBS5_ILP32_OFFBIG, SYSCONF },
{ "XBS5_ILP32_OFFBIG_CFLAGS", _CS_XBS5_ILP32_OFFBIG_CFLAGS, CONFSTR },
{ "XBS5_ILP32_OFFBIG_LDFLAGS", _CS_XBS5_ILP32_OFFBIG_LDFLAGS, CONFSTR },
{ "XBS5_ILP32_OFFBIG_LIBS", _CS_XBS5_ILP32_OFFBIG_LIBS, CONFSTR },
{ "XBS5_ILP32_OFFBIG_LINTFLAGS", _CS_XBS5_ILP32_OFFBIG_LINTFLAGS, CONFSTR },
{ "XBS5_LP64_OFF64", _SC_XBS5_LP64_OFF64, SYSCONF },
{ "XBS5_LP64_OFF64_CFLAGS", _CS_XBS5_LP64_OFF64_CFLAGS, CONFSTR },
{ "XBS5_LP64_OFF64_LDFLAGS", _CS_XBS5_LP64_OFF64_LDFLAGS, CONFSTR },
{ "XBS5_LP64_OFF64_LIBS", _CS_XBS5_LP64_OFF64_LIBS, CONFSTR },
{ "XBS5_LP64_OFF64_LINTFLAGS", _CS_XBS5_LP64_OFF64_LINTFLAGS, CONFSTR },
{ "XBS5_LPBIG_OFFBIG", _SC_XBS5_LPBIG_OFFBIG, SYSCONF },
{ "XBS5_LPBIG_OFFBIG_CFLAGS", _CS_XBS5_LPBIG_OFFBIG_CFLAGS, CONFSTR },
{ "XBS5_LPBIG_OFFBIG_LDFLAGS", _CS_XBS5_LPBIG_OFFBIG_LDFLAGS, CONFSTR },
{ "XBS5_LPBIG_OFFBIG_LIBS", _CS_XBS5_LPBIG_OFFBIG_LIBS, CONFSTR },
{ "XBS5_LPBIG_OFFBIG_LINTFLAGS", _CS_XBS5_LPBIG_OFFBIG_LINTFLAGS, CONFSTR },
{ NULL, 0, SYSCONF }
};
@ -216,6 +248,26 @@ main (int argc, char *argv[])
{
register const struct conf *c;
/* Set locale. Do not set LC_ALL because the other categories must
not be affected (according to POSIX.2). */
setlocale (LC_CTYPE, "");
setlocale (LC_MESSAGES, "");
/* Initialize the message catalog. */
textdomain (PACKAGE);
if (argc > 1 && strcmp (argv[1], "--version") == 0)
{
fprintf (stderr, "getconf (GNU %s) %s\n", PACKAGE, VERSION);
fprintf (stderr, gettext ("\
Copyright (C) %s Free Software Foundation, Inc.\n\
This is free software; see the source for copying conditions. There is NO\n\
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n\
"), "1991, 1992, 1995, 1996, 1997");
fprintf (stderr, gettext ("Written by %s.\n"), "Roland McGrath");
return 0;
}
if (argc < 2 || argc > 3)
usage ();

View File

@ -19,13 +19,11 @@
#define _GLOB_H 1
#ifdef __cplusplus
extern "C"
{
extern "C" {
#endif
#undef __ptr_t
#if (defined __cplusplus || (defined __STDC__ && __STDC__) \
|| defined WINDOWS32)
#if defined __cplusplus || (defined __STDC__ && __STDC__) || defined WINDOWS32
# undef __P
# define __P(protos) protos
# define __ptr_t void *
@ -80,6 +78,14 @@ extern "C"
# define GLOB_ABEND GLOB_ABORTED
#endif
/* This value is returned if the implementation does not support
`glob'. Since this is not the case here it will never be
returned but the conformance test suites still require the symbol
to be defined. */
#if (_XOPEN_SOURCE - 0) == 500
# define GLOB_NOSYS (-1)
#endif
/* Structure describing a globbing run. */
#if !defined _AMIGA && !defined VMS /* Buggy compiler. */
struct stat;

View File

@ -282,6 +282,10 @@ extern reg_syntax_t re_syntax_options;
`re_error_msg' table in regex.c. */
typedef enum
{
#if (_XOPEN_SOURCE - 0) == 500
REG_NOSYS = -1, /* This will never happen for this implementation. */
#endif
REG_NOERROR = 0, /* Success. */
REG_NOMATCH, /* Didn't find a match (for regexec). */

View File

@ -39,25 +39,40 @@ typedef __u_quad_t u_quad_t;
typedef __fsid_t fsid_t;
#endif
typedef __dev_t dev_t;
typedef __mode_t mode_t;
typedef __nlink_t nlink_t;
typedef __loff_t loff_t;
#ifndef __USE_FILE_OFFSET64
#ifndef ino_t
# ifndef __USE_FILE_OFFSET64
typedef __ino_t ino_t;
#else
# else
typedef __ino64_t ino_t;
# endif
# define ino_t ino_t
#endif
#ifdef __USE_LARGEFILE64
typedef __ino64_t ino64_t;
#endif
#ifndef dev_t
typedef __dev_t dev_t;
# define dev_t dev_t
#endif
#ifndef gid_t
typedef __gid_t gid_t;
# define gid_t gid_t
#endif
#ifndef mode_t
typedef __mode_t mode_t;
# define mode_t mode_t
#endif
#ifndef nlink_t
typedef __nlink_t nlink_t;
# define nlink_t nlink_t
#endif
#ifndef uid_t
typedef __uid_t uid_t;
# define uid_t uid_t
@ -99,6 +114,9 @@ typedef __caddr_t caddr_t;
typedef __key_t key_t;
#endif
#ifdef __USE_XOPEN
# define __need_clock_t
#endif
#define __need_time_t
#include <time.h>

View File

@ -29,6 +29,11 @@ __BEGIN_DECLS
#include <bits/types.h>
#if defined __USE_UNIX98 && !defined pid_t
typedef __pid_t pid_t;
# define pid_t pid_t
#endif
/* This will define the `W*' macros for the flag
bits to `waitpid', `wait3', and `wait4'. */
#include <bits/waitflags.h>

View File

@ -40,6 +40,9 @@ __BEGIN_DECLS
/* POSIX Standard approved as ISO/IEC 9945-2 as of December, 1993. */
#define _POSIX2_C_VERSION 199209L
/* The utilities on GNU systems also correspond to this version. */
#define _POSIX2_VERSION 199209L
/* If defined, the implementation supports the
C Language Bindings Option. */
#define _POSIX2_C_BIND 1
@ -56,8 +59,12 @@ __BEGIN_DECLS
creation of locales with the localedef utility. */
#define _POSIX2_LOCALEDEF 1
/* Library conforms to X/Open version 4. */
#define _XOPEN_VERSION 4
/* X/Open version number to which the library conforms. It is selectable. */
#ifdef __USE_UNIX98
# define _XOPEN_VERSION 500
#else
# define _XOPEN_VERSION 4
#endif
/* Commands and utilities from XPG4 are available. */
#define _XOPEN_XCU_VERSION 4

View File

@ -1,4 +1,4 @@
/* Copyright (C) 1991, 1992, 1996 Free Software Foundation, Inc.
/* Copyright (C) 1991, 1992, 1996, 1997 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@ -47,6 +47,9 @@ typedef struct
/* Possible nonzero return values from `wordexp'. */
enum
{
#ifdef __USE_UNIX98
WRDE_NOSYS = -1, /* Never used since we support `wordexp'. */
#endif
WRDE_NOSPACE = 1, /* Ran out of memory. */
WRDE_BADCHAR, /* A metachar appears in the wrong place. */
WRDE_BADVAL, /* Undefined var reference with WRDE_UNDEF. */

View File

@ -32,6 +32,20 @@ __BEGIN_DECLS
#define __need_size_t
#include <stddef.h>
#ifdef __USE_UNIX98
/* The Single Unix specification says that some more types are
available here. */
# ifndef gid_t
typedef __gid_t gid_t;
# define gid_t gid_t
# endif
# ifndef uid_t
typedef __uid_t uid_t;
# define uid_t uid_t
# endif
#endif
/* The passwd structure. */
struct passwd
{

View File

@ -18,7 +18,8 @@
subdir := resource
headers := sys/resource.h bits/resource.h sys/vlimit.h sys/vtimes.h
headers := sys/resource.h bits/resource.h sys/vlimit.h sys/vtimes.h \
ulimit.h
routines := getrlimit setrlimit getrlimit64 setrlimit64 getrusage ulimit \
vlimit vtimes getpriority setpriority nice

View File

@ -21,11 +21,14 @@
#include <features.h>
__BEGIN_DECLS
/* Get the system-dependent definitions of structures and bit values. */
#include <bits/resource.h>
/* Get the definitions for the `ulimit' function. */
#include <ulimit.h>
__BEGIN_DECLS
/* Put the soft and hard limits for RESOURCE in *RLIMITS.
Returns 0 if successful, -1 if not (and sets errno). */
extern int __getrlimit __P ((enum __rlimit_resource __resource,
@ -62,16 +65,6 @@ extern int setrlimit64 __P ((enum __rlimit_resource __resource,
extern int __getrusage __P ((enum __rusage_who __who, struct rusage *__usage));
extern int getrusage __P ((enum __rusage_who __who, struct rusage *__usage));
/* Function depends on CMD:
1 = Return the limit on the size of a file, in units of 512 bytes.
2 = Set the limit on the size of a file to NEWLIMIT. Only the
super-user can increase the limit.
3 = Return the maximum possible address of the data segment.
4 = Return the maximum number of files that the calling process can open.
Returns -1 on errors. */
extern long int __ulimit __P ((int __cmd, long int __newlimit));
extern long int ulimit __P ((int __cmd, long int __newlimit));
/* Return the highest priority of any process specified by WHICH and WHO
(see above); if WHO is zero, the current process, process group, or user
(as specified by WHO) is used. A lower priority number means higher
@ -83,7 +76,6 @@ extern int getpriority __P ((enum __priority_which __which, int __who));
extern int setpriority __P ((enum __priority_which __which, int __who,
int __prio));
__END_DECLS
#endif /* sys/resource.h */

49
resource/ulimit.h Normal file
View File

@ -0,0 +1,49 @@
/* Copyright (C) 1997 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public License as
published by the Free Software Foundation; either version 2 of the
License, or (at your option) any later version.
The GNU C Library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public
License along with the GNU C Library; see the file COPYING.LIB. If not,
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
#ifndef _ULIMIT_H
#define _ULIMIT_H 1
#include <features.h>
/* Constants used as the first parameter for `ulimit'. They denote limits
which can be set or retrieved using this function. */
enum
{
UL_GETFSIZE = 1, /* Return limit on the size of a file,
in units of 512 bytes. */
#define UL_GETFSIZE UL_GETFSIZE
UL_SETFSIZE, /* Set limit on the size of a file to
second argument. */
#define UL_SETFSIZE UL_SETFSIZE
__UL_GETMAXBRK, /* Return the maximum possible address
of the data segment. */
__UL_GETOPENMAX /* Return the maximum number of files
that the calling process can open.*/
};
__BEGIN_DECLS
/* Control process limits according to CMD. */
extern long int __ulimit __P ((int __cmd, ...));
extern long int ulimit __P ((int __cmd, ...));
__END_DECLS
#endif /* ulimit.h */

View File

@ -32,11 +32,17 @@ __BEGIN_DECLS
#include <bits/types.h>
#include <bits/sigset.h> /* __sigset_t, __sig_atomic_t. */
#if defined _SIGNAL_H && defined __USE_UNIX98 && !defined pid_t
typedef __pid_t pid_t;
# define pid_t pid_t
#endif /* Unix98 */
#if !defined __sig_atomic_t_defined \
&& (defined _SIGNAL_H || defined __need_sig_atomic_t)
/* An integral type that can be modified atomically, without the
possibility of a signal arriving in the middle of the operation. */
typedef __sig_atomic_t sig_atomic_t;
# define __sig_atomic_t_defined
#endif /* `sig_atomic_t' undefined and <signal.h> or need `sig_atomic_t'. */
#undef __need_sig_atomic_t

View File

@ -237,18 +237,17 @@ __printf_fphex (FILE *fp,
info->spec == 'A');
/* Fill with zeroes. */
while (numstr > numbuf + (sizeof numbuf - 13)) /* 52 ÷ 4 = 13 */
while (numstr > numbuf + (sizeof numbuf - 52 / 4))
*--numstr = '0';
leading = fpnum.dbl.ieee.exponent == 0 ? '0' : '1';
exponent = fpnum.dbl.ieee.exponent;
if ((exponent != 0 && exponent < IEEE754_DOUBLE_BIAS)
|| (exponent == 0 && !zero_mantissa))
if (exponent == 0 ? !zero_mantissa : exponent < IEEE754_DOUBLE_BIAS)
{
expnegative = 1;
exponent = abs (exponent - IEEE754_DOUBLE_BIAS);
exponent = -(exponent - IEEE754_DOUBLE_BIAS);
}
else
{
@ -276,27 +275,27 @@ __printf_fphex (FILE *fp,
else
numstr = _itoa (num, numbuf + sizeof numbuf, 16, info->spec == 'A');
/* Fill with zeroes. */
while (numstr > numbuf + (sizeof numbuf - 64 / 4))
*--numstr = '0';
/* We use a full nibble for the leading digit. */
leading = *numstr++;
/* Fill with zeroes. */
while (numstr > numbuf + (sizeof numbuf - 15)) /* 60 ÷ 4 = 15 */
*--numstr = '0';
/* We have 3 bits from the mantissa in the leading nibble. */
exponent = fpnum.ldbl.ieee.exponent - 3;
exponent = fpnum.ldbl.ieee.exponent;
if ((exponent != 0 && exponent < IEEE854_LONG_DOUBLE_BIAS)
|| (exponent == 0 && !zero_mantissa))
if (exponent == 0 ? !zero_mantissa
: exponent < IEEE854_LONG_DOUBLE_BIAS + 3)
{
expnegative = 1;
exponent = abs (exponent - IEEE854_LONG_DOUBLE_BIAS);
exponent = -(exponent - (IEEE854_LONG_DOUBLE_BIAS + 3));
}
else
{
expnegative = 0;
if (exponent != 0)
exponent -= IEEE854_LONG_DOUBLE_BIAS;
exponent -= IEEE854_LONG_DOUBLE_BIAS + 3;
}
}
@ -310,8 +309,10 @@ __printf_fphex (FILE *fp,
if (precision == -1)
precision = numend - numstr;
else if (precision < numend - numstr
&& (numstr[precision] > 5
|| (numstr[precision] == 5
&& (numstr[precision] > '8'
|| (('A' < '0' || 'a' < '0')
&& numstr[precision] < '0')
|| (numstr[precision] == '8'
&& (precision + 1 < numend - numstr
/* Round to even. */
|| (precision > 0

View File

@ -213,7 +213,8 @@ extern char *strerror_r __P ((int __errnum, char *__buf, size_t __buflen));
the namespace rules does not allow this. */
extern void __bzero __P ((__ptr_t __s, size_t __n));
#if defined __USE_BSD || defined __USE_XOPEN_EXTENDED
#if defined __USE_BSD || (defined __USE_XOPEN_EXTENDED \
&& (_POSIX_C_SOURCE - 0) < 199506L)
/* Copy N bytes of SRC to DEST (like memmove, but args reversed). */
extern void bcopy __P ((__const __ptr_t __src, __ptr_t __dest, size_t __n));

View File

@ -114,7 +114,9 @@ include ../Rules
$(objpfx)rpcgen: $(addprefix $(objpfx),$(rpcgen-objs)) $(common-objpfx)libc.a
$(+link)
rpcgen-cmd = $(built-program-cmd)
# Tell rpcgen that it should unset LD_LIBRARY_PATH before executing the
# preprocessor.
rpcgen-cmd = $(built-program-cmd) -$$
# The proper file name is longer than 14 chars, so we install it under
# a shorter name. But if the filesystem can handle it, we want to

View File

@ -38,6 +38,7 @@ char main_rcsid[] =
* rpc_main.c, Top level of the RPC protocol compiler.
*/
#include <errno.h>
#include <stdio.h>
#include <string.h>
#include <unistd.h>
@ -79,7 +80,7 @@ static const char *cmdname;
static const char *svcclosetime = "120";
static const char *CPP = SVR4_CPP;
static char CPPFLAGS[] = "-C";
static char pathbuf[FILENAME_MAX + 1];
static char *pathbuf;
static const char *allv[] = {
"rpcgen", "-s", "udp", "-s", "tcp",
};
@ -167,6 +168,10 @@ int tirpcflag = 0; /* generating code for tirpc, by default */
int tirpcflag = 1; /* generating code for tirpc, by default */
#endif
#ifdef __GNU_LIBRARY__
int building_libc = 0; /* running as part of libc built process */
#endif
int
main(int argc, const char *argv[])
{
@ -334,6 +339,13 @@ open_input(const char *infile, const char *define)
(void) pipe(pd);
switch (fork()) {
case 0:
#ifdef __GNU_LIBRARY__
/* While building libc we don't want to use the libc from
the build directory which may be incompatible with the
installed dynamic linker. */
if (building_libc)
unsetenv ("LD_LIBRARY_PATH");
#endif
find_cpp();
putarg(0, CPP);
putarg(1, CPPFLAGS);
@ -939,7 +951,9 @@ parseargs(int argc, const char *argv[], struct commandline *cmd)
*/
tirpcflag = 1;
break;
case '$':
building_libc = 1;
break;
#endif
case 'I':
inetdflag = 1;
@ -998,12 +1012,21 @@ parseargs(int argc, const char *argv[], struct commandline *cmd)
if (++i == argc) {
return (0);
}
(void) strcpy(pathbuf, argv[i]);
(void) strcat(pathbuf, "/cpp");
CPP = pathbuf;
cppDefined = 1;
goto nextarg;
{
size_t len = strlen (argv[i]);
pathbuf = malloc (len + 5);
if (pathbuf == NULL) {
f_print(stderr, "%s\n",
strerror (errno));
crash();
}
stpcpy (stpcpy (pathbuf,
argv[i]),
"/cpp");
CPP = pathbuf;
cppDefined = 1;
goto nextarg;
}
default:

View File

@ -41,6 +41,7 @@ enum
_PC_NO_TRUNC,
#define _PC_NO_TRUNC _PC_NO_TRUNC
_PC_VDISABLE,
#define _PC_VDISABLE _PC_VDISABLE
_PC_SYNC_IO,
#define _PC_SYNC_IO _PC_SYNC_IO
_PC_ASYNC_IO,
@ -325,8 +326,15 @@ enum
#define _SC_XBS5_ILP32_OFFBIG _SC_XBS5_ILP32_OFFBIG
_SC_XBS5_LP64_OFF64,
#define _SC_XBS5_LP64_OFF64 _SC_XBS5_LP64_OFF64
_SC_XBS5_LPBIG_OFFBIG
_SC_XBS5_LPBIG_OFFBIG,
#define _SC_XBS5_LPBIG_OFFBIG _SC_XBS5_LPBIG_OFFBIG
_SC_XOPEN_LEGACY,
#define _SC_XOPEN_LEGACY _SC_XOPEN_LEGACY
_SC_XOPEN_REALTIME,
#define _SC_XOPEN_REALTIME _SC_XOPEN_REALTIME
_SC_XOPEN_REALTIME_THREADS
#define _SC_XOPEN_REALTIME_THREADS _SC_XOPEN_REALTIME_THREADS
};
#if (defined __USE_POSIX2 || defined __USE_UNIX98 \

View File

@ -66,11 +66,20 @@ enum __rlimit_resource
RLIMIT_NLIMITS, /* Number of limit flavors. */
RLIM_NLIMITS = RLIMIT_NLIMITS, /* Traditional name for same. */
RLIM_INFINITY = 0x7fffffff /* Value to indicate that there is no limit. */
#define RLIM_INFINITY RLIM_INFINITY
};
/* Value to indicate that there is no limit. */
#ifndef __USE_FILE_OFFSET64
# define RLIM_INFINITY 0x7fffffff
#else
# define RLIM_INFINITY 0x7fffffffffffffffLL
#endif
#ifdef __USE_LARGEFILE64
# define RLIM64_INFINITY 0x7fffffffffffffffLL
#endif
/* Type for resource quantity measurement. */
#ifndef __USE_FILE_OFFSET64
typedef __rlim_t rlim_t;

View File

@ -31,13 +31,21 @@ struct stat
/* These are the members that POSIX.1 requires. */
__mode_t st_mode; /* File mode. */
#ifndef __USE_FILE_OFFSET64
__ino_t st_ino; /* File serial number. */
#else
__ino64_t st_ino; /* File serial number. */
#endif
__dev_t st_dev; /* Device containing the file. */
__nlink_t st_nlink; /* Link count. */
__uid_t st_uid; /* User ID of the file's owner. */
__gid_t st_gid; /* Group ID of the file's group. */
#ifndef __USE_FILE_OFFSET64
__off_t st_size; /* Size of file, in bytes. */
#else
__off64_t st_size; /* Size of file, in bytes. */
#endif
__time_t st_atime; /* Time of last access. */
__time_t st_mtime; /* Time of last modification. */
@ -70,11 +78,11 @@ struct stat
#ifdef __USE_LARGEFILE64
struct stat64
{
__dev_t st_dev; /* Device. */
__ino64_t st_ino; /* File serial number. */
__mode_t st_mode; /* File mode. */
__ino64_t st_ino; /* File serial number. */
__dev_t st_dev; /* Device. */
__nlink_t st_nlink; /* Link count. */
__uid_t st_uid; /* User ID of the file's owner. */
__gid_t st_gid; /* Group ID of the file's group.*/
__off64_t st_size; /* Size of file, in bytes. */

View File

@ -35,12 +35,36 @@ struct statfs
{
unsigned int f_type;
unsigned int f_bsize;
#ifndef __USE_FILE_OFFSET64
__fsblkcnt_t f_blocks;
__fsblkcnt_t f_bfree;
__fsblkcnt_t f_bavail;
__fsblkcnt_t f_files;
__fsblkcnt_t f_ffree;
#else
__fsblkcnt64_t f_blocks;
__fsblkcnt64_t f_bfree;
__fsblkcnt64_t f_bavail;
__fsblkcnt64_t f_files;
__fsblkcnt64_t f_ffree;
#endif
__fsid_t f_fsid;
unsigned int f_namelen;
unsigned int f_spare[6];
};
#ifdef __USE_LARGEFILE64
struct statfs64
{
unsigned int f_type;
unsigned int f_bsize;
__fsblkcnt64_t f_blocks;
__fsblkcnt64_t f_bfree;
__fsblkcnt64_t f_bavail;
__fsblkcnt64_t f_files;
__fsblkcnt64_t f_ffree;
__fsid_t f_fsid;
unsigned int f_namelen;
unsigned int f_spare[6];
};
#endif

View File

@ -17,17 +17,24 @@
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
#ifndef _STDIO_H
#if !defined _STDIO_H && !defined __need_FOPEN_MAX
# error "Never include <bits/stdio_lim.h> directly; use <stdio.h> instead."
#endif
#define L_tmpnam 1
#define TMP_MAX 0
#ifndef __need_FOPEN_MAX
# define L_tmpnam 1
# define TMP_MAX 0
#ifdef __USE_POSIX
# define L_ctermid 1
# define L_cuserid 1
# ifdef __USE_POSIX
# define L_ctermid 1
# define L_cuserid 1
# endif
# define FILENAME_MAX 14
#endif
#define FOPEN_MAX 16
#define FILENAME_MAX 14
#if defined __need_FOPEN_MAX && !defined __defined_FOPEN_MAX
# define __defined_FOPEN_MAX
# define FOPEN_MAX 16
#endif
#undef __need_FOPEN_MAX

View File

@ -25,8 +25,21 @@
int
fstatfs64 (int fd, struct statfs64 *buf)
{
__set_errno (ENOSYS);
return -1;
struct statfs buf32;
if (fstatfs (fd, &buf32) < 0)
return -1;
buf->f_type = buf32.f_type;
buf->f_bsize = buf32.f_bsize;
buf->f_blocks = buf32.f_blocks;
buf->f_bfree = buf32.f_bfree;
buf->f_bavail = buf32.f_bavail;
buf->f_files = buf32.f_files;
buf->f_ffree = buf32.f_ffree;
buf->f_fsid = buf32.f_fsid;
buf->f_namelen = buf32.f_namelen;
memcpy (buf->f_spare, buf32.f_spare, sizeof (buf32.f_spare));
return 0;
}
stub_warning (fstatfs64)
#include <stub-tag.h>

View File

@ -0,0 +1,35 @@
/* Copyright (C) 1997 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public License as
published by the Free Software Foundation; either version 2 of the
License, or (at your option) any later version.
The GNU C Library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public
License along with the GNU C Library; see the file COPYING.LIB. If not,
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
#include <sys/types.h>
#include <errno.h>
#include <unistd.h>
/* Truncate the file FD refers to to LENGTH bytes. */
int
ftruncate64 (fd, length)
int fd;
off64_t length;
{
if ((off_t) length != length)
{
__set_errno (EINVAL);
return -1;
}
return ftruncate (fd, (off_t) length);
}

View File

@ -16,8 +16,9 @@
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
#include <sys/resource.h>
#include <errno.h>
#include <sys/resource.h>
#include <sys/types.h>
/* Put the soft and hard limits for RESOURCE in *RLIMITS.
Returns 0 if successful, -1 if not (and sets errno). */

View File

@ -16,17 +16,28 @@
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
#include <sys/resource.h>
#include <errno.h>
#include <sys/resource.h>
#include <sys/types.h>
/* Put the soft and hard limits for RESOURCE in *RLIMITS.
Returns 0 if successful, -1 if not (and sets errno). */
int
getrlimit64 (enum __rlimit_resource resource, struct rlimit64 *rlimits)
{
__set_errno (ENOSYS);
return -1;
}
struct rlimit rlimits32;
stub_warning (getrlimit64)
#include <stub-tag.h>
if (getrlimit (resource, &rlimits32) < 0)
return -1;
if (rlimits32.rlim_cur == RLIM_INFINITY)
rlimits->rlim_cur = RLIM64_INFINITY;
else
rlimits->rlim_cur = rlimits32.rlim_cur;
if (rlimits32.rlim_max == RLIM_INFINITY)
rlimits->rlim_max = RLIM64_INFINITY;
else
rlimits->rlim_max = rlimits32.rlim_max;
return 0;
}

View File

@ -16,8 +16,9 @@
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
#include <sys/resource.h>
#include <errno.h>
#include <sys/resource.h>
#include <sys/types.h>
/* Set the soft and hard limits for RESOURCE to *RLIMITS.
Only the super-user can increase hard limits.

View File

@ -16,8 +16,9 @@
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
#include <sys/resource.h>
#include <errno.h>
#include <sys/resource.h>
#include <sys/types.h>
/* Set the soft and hard limits for RESOURCE to *RLIMITS.
Only the super-user can increase hard limits.
@ -27,8 +28,18 @@ setrlimit64 (resource, rlimits)
enum __rlimit_resource resource;
struct rlimit64 *rlimits;
{
__set_errno (ENOSYS);
return -1;
struct rlimit rlimits32;
if (rlimits->rlim_cur >= RLIM_INFINITY)
rlimits32.rlim_cur = RLIM_INFINITY;
else
rlimits32.rlim_cur = rlimits->rlim_cur;
if (rlimits->rlim_max >= RLIM_INFINITY)
rlimits32.rlim_max = RLIM_INFINITY;
else
rlimits32.rlim_max = rlimits->rlim_max;
return setrlimit (resource, &rlimits32);
}
stub_warning (setrlimit64)

View File

@ -25,8 +25,21 @@
int
statfs64 (const char *file, struct statfs64 *buf)
{
__set_errno (ENOSYS);
return -1;
struct statfs buf32;
if (statfs (file, &buf32) < 0)
return -1;
buf->f_type = buf32.f_type;
buf->f_bsize = buf32.f_bsize;
buf->f_blocks = buf32.f_blocks;
buf->f_bfree = buf32.f_bfree;
buf->f_bavail = buf32.f_bavail;
buf->f_files = buf32.f_files;
buf->f_ffree = buf32.f_ffree;
buf->f_fsid = buf32.f_fsid;
buf->f_namelen = buf32.f_namelen;
memcpy (buf->f_spare, buf32.f_spare, sizeof (buf32.f_spare));
return 0;
}
stub_warning (statfs64)
#include <stub-tag.h>

View File

@ -1,4 +1,4 @@
/* Copyright (C) 1991, 1993, 1995, 1996 Free Software Foundation, Inc.
/* Copyright (C) 1991, 1993, 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
@ -242,6 +242,15 @@ __sysconf (name)
case _SC_NL_SETMAX:
case _SC_NL_TEXTMAX:
case _SC_XBS5_ILP32_OFF32:
case _SC_XBS5_ILP32_OFFBIG:
case _SC_XBS5_LP64_OFF64:
case _SC_XBS5_LPBIG_OFFBIG:
case _SC_XOPEN_LEGACY:
case _SC_XOPEN_REALTIME:
case _SC_XOPEN_REALTIME_THREADS:
break;
}

View File

@ -21,7 +21,7 @@
#include <string.h>
#include <sys/utsname.h>
int
static int
kernel_has_rtsig (void)
{
return 0;

View File

@ -0,0 +1,35 @@
/* Copyright (C) 1997 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public License as
published by the Free Software Foundation; either version 2 of the
License, or (at your option) any later version.
The GNU C Library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public
License along with the GNU C Library; see the file COPYING.LIB. If not,
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
#include <sys/types.h>
#include <errno.h>
#include <unistd.h>
/* Truncate PATH to LENGTH bytes. */
int
truncate64 (path, length)
const char *path;
off64_t length;
{
if ((off_t) length != length)
{
__set_errno (EINVAL);
return -1;
}
return truncate (path, (off_t) length);
}

View File

@ -16,8 +16,8 @@
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
#include <sys/resource.h>
#include <errno.h>
#include <sys/resource.h>
/* Function depends on CMD:
1 = Return the limit on the size of a file, in units of 512 bytes.
@ -28,9 +28,7 @@
can open.
Returns -1 on errors. */
long int
__ulimit (cmd, newlimit)
int cmd;
long int newlimit;
__ulimit (int cmd, ...)
{
__set_errno (ENOSYS);
return -1;

View File

@ -19,6 +19,7 @@
Boston, MA 02111-1307, USA. */
#include <errno.h>
#include <sys/types.h>
#include <sys/wait.h>
int

View File

@ -173,7 +173,6 @@ __inline_mathop(significand, getman)
# ifdef __USE_ISOC9X
__inline_mathop(log2, log2)
__inline_mathop(exp2, twotox)
__inline_mathop(trunc, intrz)
# endif
@ -445,7 +444,6 @@ __inline_forward_c(double,ceil, (double __x), (__x))
__inline_forward_c(int,isinf, (double __value), (__value))
__inline_forward_c(int,finite, (double __value), (__value))
__inline_forward_c(double,scalbn, (double __x, int __n), (__x, __n))
__inline_forward_c(double,scalbln, (double __x, long int __n), (__x, __n))
# endif
# if defined __USE_MISC || defined __USE_XOPEN
# ifndef __USE_ISOC9X /* Conflict with macro of same name. */
@ -453,6 +451,7 @@ __inline_forward_c(int,isnan, (double __value), (__value))
# endif
# endif
# ifdef __USE_ISOC9X
__inline_forward_c(double,scalbln, (double __x, long int __n), (__x, __n))
__inline_forward_c(double,nearbyint, (double __value), (__value))
__inline_forward_c(long int,lrint, (double __value), (__value))
__inline_forward_c(double,fma, (double __x, double __y, double __z),
@ -473,10 +472,10 @@ __inline_forward_c(float,ceilf, (float __x), (__x))
__inline_forward_c(int,isinff, (float __value), (__value))
__inline_forward_c(int,finitef, (float __value), (__value))
__inline_forward_c(float,scalbnf, (float __x, int __n), (__x, __n))
__inline_forward_c(float,scalblnf, (float __x, long int __n), (__x, __n))
__inline_forward_c(int,isnanf, (float __value), (__value))
# endif
# ifdef __USE_ISOC9X
__inline_forward_c(float,scalblnf, (float __x, long int __n), (__x, __n))
__inline_forward_c(float,nearbyintf, (float __value), (__value))
__inline_forward_c(long int,lrintf, (float __value), (__value))
__inline_forward_c(float,fmaf, (float __x, float __y, float __z),
@ -495,11 +494,11 @@ __inline_forward_c(long double,ceill, (long double __x), (__x))
__inline_forward_c(int,isinfl, (long double __value), (__value))
__inline_forward_c(int,finitel, (long double __value), (__value))
__inline_forward_c(long double,scalbnl, (long double __x, int __n), (__x, __n))
__inline_forward_c(long double,scalblnl, (long double __x, long int __n),
(__x, __n))
__inline_forward_c(int,isnanl, (long double __value), (__value))
# endif
# ifdef __USE_ISOC9X
__inline_forward_c(long double,scalblnl, (long double __x, long int __n),
(__x, __n))
__inline_forward_c(long double,nearbyintl, (long double __value), (__value))
__inline_forward_c(long int,lrintl, (long double __value), (__value))
__inline_forward_c(long double,fmal,

View File

@ -42,42 +42,23 @@ main()
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,\n\
Boston, MA 02111-1307, USA. */\n\
\n\
#ifndef _STDIO_H\n\
#if !defined _STDIO_H && !defined __need_FOPEN_MAX\n\
# error \"Never include <bits/stdio_lim.h> directly; use <stdio.h> instead.\"\n\
#endif\n\
\n");
/* These values correspond to the code in sysdeps/posix/tempname.c.
Change the values here if you change that code. */
printf ("#define L_tmpnam %u\n", sizeof ("/usr/tmp/") + 9);
printf ("#define TMP_MAX %u\n", 62 * 62 * 62);
puts ("#ifndef __need_FOPEN_MAX");
printf ("# define L_tmpnam %u\n", sizeof ("/usr/tmp/") + 9);
printf ("# define TMP_MAX %u\n", 62 * 62 * 62);
puts ("#ifdef __USE_POSIX");
printf ("# define L_ctermid %u\n", sizeof ("/dev/tty"));
printf ("# define L_cuserid 9\n");
puts ("#endif");
puts ("# ifdef __USE_POSIX");
printf ("# define L_ctermid %u\n", sizeof ("/dev/tty"));
printf ("# define L_cuserid 9\n");
puts ("# endif");
/* POSIX does not require that OPEN_MAX and PATH_MAX be defined, so
<bits/local_lim.h> will not define them if they are run-time
variant (which is the case in the Hurd). ISO still requires
that FOPEN_MAX and FILENAME_MAX be defined, however. */
printf ("#define FOPEN_MAX %u\n",
#ifdef OPEN_MAX
OPEN_MAX
#else
/* This is the minimum number of files that the implementation
guarantees can be open simultaneously. OPEN_MAX not being
defined means the maximum is run-time variant; but POSIX.1
requires that it never be less than _POSIX_OPEN_MAX, so that is
a good minimum to use. */
_POSIX_OPEN_MAX
#endif
);
printf ("#define FILENAME_MAX %u\n",
printf (" #define FILENAME_MAX %u\n",
#ifdef PATH_MAX
PATH_MAX
#else
@ -93,5 +74,31 @@ main()
#endif
);
exit(0);
puts ("#endif\n");
/* POSIX does not require that OPEN_MAX and PATH_MAX be defined, so
<bits/local_lim.h> will not define them if they are run-time
variant (which is the case in the Hurd). ISO still requires
that FOPEN_MAX and FILENAME_MAX be defined, however. */
puts ("#if defined __need_FOPEN_MAX && !defined __defined_FOPEN_MAX");
puts ("# define __defined_FOPEN_MAX");
printf ("# define FOPEN_MAX %u\n",
#ifdef OPEN_MAX
OPEN_MAX
#else
/* This is the minimum number of files that the implementation
guarantees can be open simultaneously. OPEN_MAX not being
defined means the maximum is run-time variant; but POSIX.1
requires that it never be less than _POSIX_OPEN_MAX, so that is
a good minimum to use. */
_POSIX_OPEN_MAX
#endif
);
puts ("#endif");
puts ("#undef __need_FOPEN_MAX");
exit (0);
}

View File

@ -1,4 +1,4 @@
/* Copyright (C) 1991, 1993, 1995, 1996 Free Software Foundation, Inc.
/* Copyright (C) 1991, 1993, 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
@ -443,9 +443,7 @@ __sysconf (name)
#endif
case _SC_2_VERSION:
/* This is actually supposed to return the version
of the 1003.2 utilities on the system {POSIX2_VERSION}. */
return _POSIX2_C_VERSION;
return _POSIX2_VERSION;
case _SC_2_C_BIND:
#ifdef _POSIX2_C_BIND
@ -783,6 +781,47 @@ __sysconf (name)
#else
return -1;
#endif
case _SC_XBS5_ILP32_OFF32:
#ifdef _XBS5_ILP32_OFF32
return _XBS5_ILP32_OFF32;
#else
return -1;
#endif
case _SC_XBS5_ILP32_OFFBIG:
#ifdef _XBS5_ILP32_OFFBIG
return _XBS5_ILP32_OFFBIG;
#else
return -1;
#endif
case _SC_XBS5_LP64_OFF64:
#ifdef _XBS5_LP64_OFF64
return _XBS5_LP64_OFF64;
#else
return -1;
#endif
case _SC_XBS5_LPBIG_OFFBIG:
#ifdef _XBS5_LPBIG_OFFBIG
return _XBS5_LPBIG_OFFBIG;
#else
return -1;
#endif
case _SC_XOPEN_LEGACY:
return _XOPEN_LEGACY;
case _SC_XOPEN_REALTIME:
#ifdef _XOPEN_REALTIME
return _XOPEN_REALTIME;
#else
return -1;
#endif
case _SC_XOPEN_REALTIME_THREADS:
#ifdef _XOPEN_REALTIME_THREADS
return _XOPEN_REALTIME_THREADS;
#else
return -1;
#endif
}
}

View File

@ -56,6 +56,7 @@
# define EIO 28
# define ENOSPC 29
# define EEXIST 30
# define EBUSY 31
#endif
#define __set_errno(val) errno = (val)

View File

@ -65,11 +65,11 @@ enum __rlimit_resource
#ifndef __USE_FILE_OFFSET64
# define RLIM_INFINITY 0x7fffffff
#else
# define RLIM_INFINITY 0x7fffffffffffffffL
# define RLIM_INFINITY 0x7fffffffffffffffLL
#endif
#ifdef __USE_LARGEFILE64
# define RLIM64_INFINITY 0x7fffffffffffffffL
# define RLIM64_INFINITY 0x7fffffffffffffffLL
#endif

View File

@ -16,10 +16,11 @@
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
#include <sysdep.h>
#include <sys/resource.h>
#include <unistd.h>
#include <errno.h>
#include <stdarg.h>
#include <sysdep.h>
#include <unistd.h>
#include <sys/resource.h>
#ifndef HAVE_GNU_LD
#define _etext etext
@ -36,51 +37,50 @@ extern int _etext;
can open.
Returns -1 on errors. */
long int
ulimit (cmd, newlimit)
int cmd;
long int newlimit;
ulimit (int cmd, ...)
{
int status;
struct rlimit limit;
va_list va;
long int result = -1;
va_start (va, cmd);
switch (cmd)
{
case 1:
{
/* Get limit on file size. */
struct rlimit fsize;
status = getrlimit (RLIMIT_FSIZE, &fsize);
if (status < 0)
return -1;
case UL_GETFSIZE:
/* Get limit on file size. */
if (getrlimit (RLIMIT_FSIZE, &limit) == 0)
/* Convert from bytes to 512 byte units. */
return fsize.rlim_cur / 512;
}
case 2:
result = limit.rlim_cur / 512;
break;
case UL_SETFSIZE:
/* Set limit on file size. */
{
struct rlimit fsize;
fsize.rlim_cur = newlimit * 512;
fsize.rlim_max = newlimit * 512;
long int newlimit = va_arg (va, long int);
return setrlimit (RLIMIT_FSIZE, &fsize);
limit.rlim_cur = newlimit * 512;
limit.rlim_max = newlimit * 512;
result = setrlimit (RLIMIT_FSIZE, &limit);
}
case 3:
break;
case __UL_GETMAXBRK:
/* Get maximum address for `brk'. */
{
struct rlimit dsize;
if (getrlimit (RLIMIT_DATA, &limit) == 0)
result = ((long int) &_etext) + limit.rlim_cur;
break;
status = getrlimit (RLIMIT_DATA, &dsize);
if (status < 0)
return -1;
return ((long int) &_etext) + dsize.rlim_cur;
}
case 4:
return sysconf (_SC_OPEN_MAX);
case __UL_GETOPENMAX:
result = sysconf (_SC_OPEN_MAX);
break;
default:
__set_errno (EINVAL);
return -1;
}
va_end (va);
return result;
}

View File

@ -32,6 +32,7 @@ netinet/udp.h
netipx/ipx.h
nfs/nfs.h
rt_sigaction.c
rt_sigpending.c
rt_sigprocmask.c
rt_sigqueueinfo.c
rt_sigreturn.c
@ -61,3 +62,4 @@ sys/ultrasound.h
sys/user.h
sys/vt.h
xstatconv.c
getdents64.c

View File

@ -120,4 +120,8 @@ sysdep_routines += rt_sigsuspend rt_sigprocmask rt_sigtimedwait \
rt_sigqueueinfo rt_sigaction rt_sigpending
endif
ifeq ($(subdir),dirent)
sysdep_routines += getdents64
endif
common-generated += bits/stdio_lim.h bits/stdio_lim.d

View File

@ -77,6 +77,9 @@ typedef long int __swblk_t; /* Type of a swap block maybe? */
typedef long int __clock_t;
typedef int __key_t; /* Type of a SYSV IPC key. */
/* Used in `struct shmid_ds'. */
typedef int __ipc_pid_t;
/* One element in the file descriptor mask array. */
typedef unsigned long int __fd_mask;

View File

@ -0,0 +1 @@
/* fstatfs64 is the same as fstatfs. */

View File

@ -0,0 +1 @@
/* ftruncate64 is the same as ftruncate. */

View File

@ -0,0 +1 @@
/* getrlimit64 is the same as getrlimit. */

View File

@ -2,28 +2,26 @@
This is done in one of two ways: either in the stack context
of program start, or having dlopen pass them in. */
#define SYSDEP_CALL_INIT(NAME, INIT) \
asm(".weak _dl_starting_up\n\t" \
".globl " #NAME "\n\t" \
".ent " #NAME "\n" \
#NAME ":\n\t" \
"ldgp $29, 0($27)\n\t" \
".prologue 1\n\t" \
".set at\n\t" \
/* Are we a dynamic libc being loaded into a static program? */ \
"lda $0, _dl_starting_up\n\t" \
"beq $0, 1f\n\t" \
"ldl $0, 0($0)\n" \
"cmpeq $31, $0, $0\n" \
"1:\t" \
"stl $0, __libc_multiple_libcs\n\t" \
/* If so, argc et al are in a0-a2 already. Otherwise, load them. */ \
"bne $0, 2f\n\t" \
"ldl $16, 0($30)\n\t" \
"lda $17, 8($30)\n\t" \
"s8addq $16, $17, $18\n\t" \
"addq $18, 8, $18\n" \
"2:\t" \
"br $31, " #INIT "..ng\n\t" \
".set noat\n\t" \
".end " #NAME);
#define SYSDEP_CALL_INIT(NAME, INIT) asm("\
.weak _dl_starting_up
.globl " #NAME "
.ent " #NAME "
" #NAME ":
ldgp $29, 0($27)
.prologue 1
.set at
/* Are we a dynamic libc being loaded into a static program? */
lda $0, _dl_starting_up
beq $0, 1f
ldl $0, 0($0)
cmpeq $31, $0, $0
1: stl $0, __libc_multiple_libcs
/* If so, argc et al are in a0-a2 already. Otherwise, load them. */
bne $0, 2f
ldl $16, 0($30)
lda $17, 8($30)
s8addq $16, $17, $18
addq $18, 8, $18
2: br $31, " ASM_ALPHA_NG_SYMBOL_PREFIX #INIT "..ng
.set noat
.end " #NAME);

View File

@ -0,0 +1,4 @@
#define readdir64 __no_readdir64_decl
#include <sysdeps/unix/readdir.c>
#undef readdir64
weak_alias (__readdir, readdir64)

View File

@ -0,0 +1 @@
/* readdir64 is in readdir.c */

View File

@ -0,0 +1 @@
/* readdir64_r is in readdir_r.c */

View File

@ -0,0 +1,4 @@
#define readdir64_r __no_readdir64_r_decl
#include <sysdeps/unix/readdir_r.c>
#undef readdir64_r
weak_alias (__readdir_r, readdir64_r)

View File

@ -0,0 +1 @@
/* setrlimit64 is the same as setrlimit. */

Some files were not shown because too many files have changed in this diff Show More