]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
Update. cvs/libc-ud-971222
authorUlrich Drepper <drepper@redhat.com>
Mon, 22 Dec 1997 20:53:38 +0000 (20:53 +0000)
committerUlrich Drepper <drepper@redhat.com>
Mon, 22 Dec 1997 20:53:38 +0000 (20:53 +0000)
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.

153 files changed:
ChangeLog
Makefile
Makerules
bits/confname.h
bits/resource.h
bits/stat.h
bits/statfs.h
catgets/nl_types.h
config.h.in
configure
configure.in
dirent/dirent.h
elf/soinit.c
gen-FAQ.pl
grp/grp.h
include/bits/xopen_lim.h
include/features.h
include/nl_types.h [new file with mode: 0644]
include/ulimit.h [new file with mode: 0644]
inet/test_ifindex.c
io/fcntl.h
io/ftw.h
io/sys/stat.h
io/utime.h
libc.map
libio/Makefile
libio/stdio.h
locale/duplocale.c
locale/freelocale.c
locale/langinfo.h
locale/programs/ld-ctype.c
locale/programs/locale.c
locale/setlocale.c
malloc/malloc.c
malloc/mcheck.c
manual/memory.texi
math/Makefile
math/libm-test.c
math/math.h
math/tgmath.h
misc/Makefile
misc/regexp.h
nis/nss_nis/nis-ethers.c
nis/nss_nis/nis-proto.c
nis/nss_nis/nis-rpc.c
nis/nss_nis/nis-service.c
nss/digits_dots.c
nss/nss_files/files-alias.c
posix/fnmatch.h
posix/getconf.c
posix/glob.h
posix/regex.h
posix/sys/types.h
posix/sys/wait.h
posix/unistd.h
posix/wordexp.h
pwd/pwd.h
resource/Makefile
resource/sys/resource.h
resource/ulimit.h [new file with mode: 0644]
signal/signal.h
stdio-common/printf_fphex.c
string/string.h
sunrpc/Makefile
sunrpc/rpc_main.c
sysdeps/generic/bits/confname.h
sysdeps/generic/bits/resource.h
sysdeps/generic/bits/stat.h
sysdeps/generic/bits/statfs.h
sysdeps/generic/bits/stdio_lim.h
sysdeps/generic/fstatfs64.c
sysdeps/generic/ftruncate64.c [new file with mode: 0644]
sysdeps/generic/getrlimit.c
sysdeps/generic/getrlimit64.c
sysdeps/generic/setrlimit.c
sysdeps/generic/setrlimit64.c
sysdeps/generic/statfs64.c
sysdeps/generic/sysconf.c
sysdeps/generic/testrtsig.h
sysdeps/generic/truncate64.c [new file with mode: 0644]
sysdeps/generic/ulimit.c
sysdeps/generic/waitid.c
sysdeps/m68k/fpu/bits/mathinline.h
sysdeps/posix/mk-stdiolim.c
sysdeps/posix/sysconf.c
sysdeps/standalone/arm/bits/errno.h
sysdeps/unix/bsd/sun/sunos4/bits/resource.h
sysdeps/unix/bsd/ulimit.c
sysdeps/unix/sysv/linux/Dist
sysdeps/unix/sysv/linux/Makefile
sysdeps/unix/sysv/linux/alpha/bits/types.h
sysdeps/unix/sysv/linux/alpha/fstatfs64.c [new file with mode: 0644]
sysdeps/unix/sysv/linux/alpha/ftruncate64.c [new file with mode: 0644]
sysdeps/unix/sysv/linux/alpha/getrlimit64.c [new file with mode: 0644]
sysdeps/unix/sysv/linux/alpha/init-first.h
sysdeps/unix/sysv/linux/alpha/readdir.c [new file with mode: 0644]
sysdeps/unix/sysv/linux/alpha/readdir64.c [new file with mode: 0644]
sysdeps/unix/sysv/linux/alpha/readdir64_r.c [new file with mode: 0644]
sysdeps/unix/sysv/linux/alpha/readdir_r.c [new file with mode: 0644]
sysdeps/unix/sysv/linux/alpha/setrlimit64.c [new file with mode: 0644]
sysdeps/unix/sysv/linux/alpha/statfs64.c [new file with mode: 0644]
sysdeps/unix/sysv/linux/alpha/syscalls.list
sysdeps/unix/sysv/linux/alpha/truncate64.c [new file with mode: 0644]
sysdeps/unix/sysv/linux/bits/msq.h
sysdeps/unix/sysv/linux/bits/resource.h
sysdeps/unix/sysv/linux/bits/shm.h
sysdeps/unix/sysv/linux/bits/termios.h
sysdeps/unix/sysv/linux/bits/types.h
sysdeps/unix/sysv/linux/fxstat64.c [new file with mode: 0644]
sysdeps/unix/sysv/linux/getdents.c
sysdeps/unix/sysv/linux/getdents64.c [new file with mode: 0644]
sysdeps/unix/sysv/linux/lxstat64.c [new file with mode: 0644]
sysdeps/unix/sysv/linux/mips/bits/types.h [new file with mode: 0644]
sysdeps/unix/sysv/linux/readdir64.c [new file with mode: 0644]
sysdeps/unix/sysv/linux/readdir64_r.c [new file with mode: 0644]
sysdeps/unix/sysv/linux/rt_sigpending.c [moved from sysdeps/unix/sysv/linux/powerpc/sigreturn.S with 81% similarity]
sysdeps/unix/sysv/linux/siglist.c
sysdeps/unix/sysv/linux/sparc/sparc64/bits/types.h
sysdeps/unix/sysv/linux/sparc/sparc64/fstatfs64.c [new file with mode: 0644]
sysdeps/unix/sysv/linux/sparc/sparc64/ftruncate64.c [new file with mode: 0644]
sysdeps/unix/sysv/linux/sparc/sparc64/getrlimit64.c [new file with mode: 0644]
sysdeps/unix/sysv/linux/sparc/sparc64/readdir.c [new file with mode: 0644]
sysdeps/unix/sysv/linux/sparc/sparc64/readdir64.c [new file with mode: 0644]
sysdeps/unix/sysv/linux/sparc/sparc64/readdir64_r.c [new file with mode: 0644]
sysdeps/unix/sysv/linux/sparc/sparc64/readdir_r.c [new file with mode: 0644]
sysdeps/unix/sysv/linux/sparc/sparc64/setrlimit64.c [new file with mode: 0644]
sysdeps/unix/sysv/linux/sparc/sparc64/statfs64.c [new file with mode: 0644]
sysdeps/unix/sysv/linux/sparc/sparc64/syscalls.list
sysdeps/unix/sysv/linux/sparc/sparc64/truncate64.c [new file with mode: 0644]
sysdeps/unix/sysv/linux/stdio_lim.h.in
sysdeps/unix/sysv/linux/testrtsig.h
sysdeps/unix/sysv/linux/ulimit.c
sysdeps/unix/sysv/linux/xstat64.c [new file with mode: 0644]
sysdeps/unix/sysv/linux/xstatconv.c
sysdeps/wordsize-32/inttypes.h
sysdeps/wordsize-64/inttypes.h
time/README
time/africa
time/antarctica
time/asia
time/australasia
time/backward
time/etcetera
time/europe
time/factory
time/northamerica
time/pacificnew
time/southamerica
time/tzfile.h
time/zic.c
wcsmbs/wchar.h
wctype/towctrans.c
wctype/wctype.h

index 841c2d9afa3e4d3e361c2c66fcf8c8f2f5ee7aba..00185bf0a3c78d3ed117bca6f413cb1c3590a65a 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -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.
index dbacf8b6697d942701ca3ad9824244944a905136..9e7679bcf4bae32920044e4d11364d0e5004bf22 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -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
index 53fa726aec2dba5939a17276028d2597fe22e9d0..62fd79f684ba4ac39824ac775e31e67b5677a6a4 100644 (file)
--- a/Makerules
+++ b/Makerules
@@ -448,9 +448,7 @@ endif
 endif
 \f\f
 # 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.
 %/:
index 1b75d6e5b527ce12c4f8a704ea74327ff5186dfa..8aac5cb67d0889d610685a6e3c64e00d9e27c4dd 100644 (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 \
index e72836d3c742f3bd426bca4d693ef7ceb9679394..e29be98210087365a885c729fd4155ca60f561a5 100644 (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;
index a0edf2be52ffbfbc8c5c7f3bcf4d2d3dae5fec4d..bdc3a48de9de9cc0a8f8d4053c316f48b1f3e2a4 100644 (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.  */
index a92cf523157e46120668583e89169bbdca9701bd..03b92d8faa5eef648b51c01473156f0cb8a50c4b 100644 (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
index bf07fcd1e4269b8deaff5ddc614efba737313ff6..960edb5365f9d6479cc3238837cda73b00d828f1 100644 (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));
 
index a38900b64aecb468b3cf7e3bad853c6ab209e383..9e85c7e5cdadcccdfc40139a8b3ed3e56ac1ac23 100644 (file)
 /* 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
index 133194c598077d38ed47cade4d0c1597b82157c9..625d2f75bafe0314d03bf60724790121372b6d19 100755 (executable)
--- a/configure
+++ b/configure
@@ -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
index 939fda8a4ec3df8ea7473b78fbb3bdbbedb3bd36..4aeeae047a3813f2c118e14f6007c8c8168df610 100644 (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
+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*])
-if test $libc_cv_gcc_dwarf2_unwind_info = yes; then
+case $libc_cv_gcc_dwarf2_unwind_info in
+yes)
   AC_DEFINE(HAVE_DWARF2_UNWIND_INFO)
-fi
+  ;;
+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
index e2fab0ab0343304cbb95f83c17535692edbb3c44..d7e8a543b9ba3b652d55d7a4df5cd30c5c5b69df 100644 (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
 
index 2b333b7ace98288117f9cfb082c6751ce13adb37..1dee73c3be37a5a888fd4d0ff06aa4d81cf82261 100644 (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
 }
index e8b55ac7aba980e56061cfd47e5c4b98b1e04ad9..9503903f8ca022d35a67579b3dab476b844ebddb 100755 (executable)
@@ -1,4 +1,4 @@
-#! /usr/local/bin/perl
+#! /usr/bin/perl
 
 =pod
 This is a silly little program for generating the libc FAQ.
index f5db84f7dc10ef1a6a2b6f70a5d7f483dfb67e87..11883ab1f10c35e07ed7b7e6ef6ef8882935c2c4 100644 (file)
--- a/grp/grp.h
+++ b/grp/grp.h
@@ -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
   {
index c8b847fbc2c9848e65021499f43edc315b57051d..9f22e44e25dc6cecffdb8785dcf74ce0cf82b731 100644 (file)
    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
index b6118a1cf647b593fb9f4ba9d01e13210fd7df9f..141c05031fae00dbb4c8f13a4c95438c01a52ffd 100644 (file)
 #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
 #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
 # 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
diff --git a/include/nl_types.h b/include/nl_types.h
new file mode 100644 (file)
index 0000000..71cb425
--- /dev/null
@@ -0,0 +1 @@
+#include <catgets/nl_types.h>
diff --git a/include/ulimit.h b/include/ulimit.h
new file mode 100644 (file)
index 0000000..1e6cf9e
--- /dev/null
@@ -0,0 +1 @@
+#include <resource/ulimit.h>
index d44e0b1cb4a52493528581bcf26588b309115faf..0441bf0feb3cedf5303f475079a0da34aa323d7f 100644 (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;
index d47da0a1ffb195d0c95c8412d513c065256921c3..14a165539b78ed7e03e910851738b533c6925f14 100644 (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.  */
index 298e58ed8a69ea7ff6e2046c7d450e8d93c494e2..b7417fc70c9d8aaab883d11f9f75a78d234feaba 100644 (file)
--- a/io/ftw.h
+++ b/io/ftw.h
@@ -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
index d57b8d6ee81403a2ca672e37fab6a8e1ca7d385a..76ef3c5f28d02d2a2c599b67c28adda7f5b8f270 100644 (file)
 
 #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,
index 7cb4724f93fe3eeef9aefcbcbc7da9cd05817a94..3bfdd092a8f125e4f97917b1b7c625104adb8820 100644 (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
   {
index e301159cdbd1b045ba1039bc84fbde8effc2dec4..902d8f89c8a137c8356e3697f6156e0321e4d848 100644 (file)
--- a/libc.map
+++ b/libc.map
@@ -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;
index 0997b5d8bf907162c6ebeb7530b91a02aedb2267..4ad342ec05c76f4886d57b561861d0fc51a429eb 100644 (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
index 99b61aae0116a2fb1fa1c25a23d292aa88e901f4..13287f98800971150e03d01da89aa815bdbac48d 100644 (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.  */
index b3aa4af68c0a81f5bbf996e9b78617d442cdcdc9..2dcc0f5b02b62c10de393c132b14ab0bb2fa1f2b 100644 (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;
        }
     }
index a09a744ebf8dfb2ed01a30054d253ebe3e528fb7..3cfa5276ca1d5d6bc8997edc2885528ecfa8ec65 100644 (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]);
 
index 81696479e515cd2b7fe789848868586ca71f4ea1..8cdb104c0d88fbececd306580ab911f0b75d9fdd 100644 (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
 
 #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.
index 0a5e4eebf108854e31343127ba79d5a8c926d7bb..f2ad46f09218d97d9ee570c25fc740c946ca2943 100644 (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;
index e09e6f1e37ed03ca18f65c8b6f4d136083cf2d5f..93818e02e21fa6ff48106ebd5862bb081540d23f 100644 (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;
index 42c1e5033a03c2a187e160332ee21087a4225a52..33599c64db2dfbc7f5fa78e3d774b5897c008246 100644 (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.  */
index 058c156be4a9ecc481d51a0200005777f473ad8e..3d4933cd7cd4f789b361244565f7b872278594e4 100644 (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. */
index 47d35f1f1f072181b6e27525709d6e138026603e..4547a312994222f793a4351dcfbe744c5af15fee 100644 (file)
    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;
index a186fd4b8c1bef0022549676b22edb1156f6feec..343fcd1c8a9451a1ad5fdf23a31e33e053c9dc3e 100644 (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
index d52de78c3dda4c67442036beb516859a29d6f04b..2be1718d32a743e3057e7920699986dcf7dd635e 100644 (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
index a1050ba0aafa61efcfc9c82ee4c3cbb328eca8d8..1b0b163e99c27149ce395f6c856612bb99837f1b 100644 (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));
 }
 
 
index 0aedaf1d56c9621754783118e729de38a2310c6c..ae83262338864e67270227f4142a1f7fd48c3f2d 100644 (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
index b0ce202d359fe89c5e423e4b85d1c052d84ad05c..5880e666d5bb5f48b8495b3d9abf0b5ec92ad266 100644 (file)
    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)                              \
index 7975964471d7a99bd7b2e706f0368f5c2790a798..842f9839bbbe388a9413bfd8e7c06f5bd9d3188e 100644 (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 \
index 384001366e73a4e1535a406e7f0b08189ad43060..c2633eb8da97c96d558f29051e6d65639c10abd8 100644 (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')
        {
index 365f9c9c1d4c8dc1932672ac92d3d71ee445be0b..cbc37591ee86f5de5cf87142a1ae75573a048641 100644 (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;
index e0c976041d829614ee2e13f1e306148a7ce172be..a6f57fde98997106419ec7c5536e06fe1fc35c75 100644 (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;
index 274ef04b7aa1d979eb87112d9808da7ba5b0bb04..3be99496e442ad72c251df6df303d2219cfd2fdb 100644 (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;
 
index c55b3e019113341c01e1c4aa0d0a0014e4405045..0aa35cc34b7dceb32324bdfeb78cceeff2bb2068 100644 (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;
 
index 29aa5b1c5cf3c5dac38da59a1b2fe71492026df3..944b328a1a1dd44c8602ed76872602907925d74d 100644 (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;
        }
 
index 7eb22bb18778f4f3ec137f0eca5f941016ad6613..733e5991035fc5dbf0783b2edb04b774a1b37168 100644 (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;
index 38b7255f4d2bf96ea87f1e3449cac20e43c6b8f0..4d1eb3e2d301b41800bd817a24d0228384a230a5 100644 (file)
 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
index c6371cb60b7e0daea4f8099694eb0069b81a1661..8aaa75ba67cb97fa06254615b8fff4b62b0a485e 100644 (file)
 #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 ();
 
index a15d8ef92f7a6711d8f4f1e5118ccee68068b4fa..a546c865f21d3aa3ca6086d25db57942a7613b35 100644 (file)
 #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;
index 22d316b0f118dc7075767f3c6642cbf92e9b2367..44f6b557b6f9f3bce1dbfb4eeaa202734dc70eaa 100644 (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).  */
 
index d48e0d23eb5a75d828e1ab0a0f3f5dfb43734ae7..113dd1415d6f8c0c17b15e1b41cf662cfbc81800 100644 (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>
 
index e663f41e05b247381377db7a746946536abdd99b..ed904d909b930aaaf5228a8efa9d42b1dfddac89 100644 (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>
index 2fbdae5652b2eb21f87cc2442f1b9b32fd734057..0147594f538de0d3485c1f2756a5a1b2608a1d56 100644 (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
index 6fa02b78c4369de0a049fbfb305def24f77e5689..cd5fba9b41d5ab2164b8f8e698b65c739c0cde26 100644 (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.  */
index 3b639305cf744af09036b674a5e4ea48dcff9a5e..ef16963c0e29b942350fa01c50b32bd266ed0197 100644 (file)
--- a/pwd/pwd.h
+++ b/pwd/pwd.h
@@ -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
 {
index 1ad0bb3bc4741ebdffa858f341d9810f4568ce64..5a4d9603c8facc351778f8cd0840cb25c049d888 100644 (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
index f9c6bb248831431c0d7ec723cb75f7b0f9bf8188..488612ffad390248b5bc72b020e6d9d8a54a8626 100644 (file)
 
 #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  */
diff --git a/resource/ulimit.h b/resource/ulimit.h
new file mode 100644 (file)
index 0000000..651e9f4
--- /dev/null
@@ -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 */
index 11b6565be685d21f4487fff23feaa91dfdcf7b85..589b8708068551ed33ab05e297a92ac1de052085 100644 (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
 
index eaae77a8d52d949e9865db285a637b8fa80f8651..76084a8de501d9a086acc54d65291da5cee107af 100644 (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');
 
-      /* We use a full nibble for the leading digit.  */
-      leading = *numstr++;
-
       /* Fill with zeroes.  */
-      while (numstr > numbuf + (sizeof numbuf - 15))   /* 60 Ã· 4 = 15 */
+      while (numstr > numbuf + (sizeof numbuf - 64 / 4))
        *--numstr = '0';
 
+      /* We use a full nibble for the leading digit.  */
+      leading = *numstr++;
+
       /* 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
index 2b4d6b95453eb9f21c8fa166b85d80b027de3df1..3e978520a7f99c13c4943af992835754710e48c1 100644 (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));
 
index bde8cdc7176e08a7401c4e8327d6e2e3efe0252d..db5278ff5effa6fb7744b7c17a5faeedf16ccf4c 100644 (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
index ec990d18461fbdca6d166bdd4c7ee0c19e548146..7d64e1b784d456c78c66203d056b9cb7bd89010a 100644 (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:
index 1b75d6e5b527ce12c4f8a704ea74327ff5186dfa..8aac5cb67d0889d610685a6e3c64e00d9e27c4dd 100644 (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 \
index e72836d3c742f3bd426bca4d693ef7ceb9679394..e29be98210087365a885c729fd4155ca60f561a5 100644 (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;
index a0edf2be52ffbfbc8c5c7f3bcf4d2d3dae5fec4d..bdc3a48de9de9cc0a8f8d4053c316f48b1f3e2a4 100644 (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.  */
index a92cf523157e46120668583e89169bbdca9701bd..03b92d8faa5eef648b51c01473156f0cb8a50c4b 100644 (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
index d9b8fbc749fc36b29e878f71ca2942db6ba71b35..86e83cf1e2872ac631e86a302a4e97d38081c028 100644 (file)
    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
index 99a2452558b5b612ce9af30228648bf60080fca9..e34af2aa45db5fd9d164d872c884e748a31a2d93 100644 (file)
 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>
diff --git a/sysdeps/generic/ftruncate64.c b/sysdeps/generic/ftruncate64.c
new file mode 100644 (file)
index 0000000..40c312c
--- /dev/null
@@ -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);
+}
index c283f770381f6331e465cbc9d466d4f52907df33..285133c1a1394190da31620d1281686aaa1d67a3 100644 (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).  */
index 6c581edf728c416b5581a5898af7e5406fdd25d8..742505f4b5454a92eebef2da1610e53c47303f22 100644 (file)
    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;
+}
index b969ea19f78b64117e4302dcfbed1453aee3be0e..85eb74051b35c6267cd95aa08beede478d4c5f51 100644 (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.
index 3d1a12279fb6482e0067e0129a2d0ccc26aba19b..97329c58d86bee294a69f2d92a41e41f3078761e 100644 (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)
index 93b640eb74c7c16d0250ed64c6eb5b0427a9db8e..050c05d65912b4119bc5c97de63375c27339bae6 100644 (file)
 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>
index b3fa62aa9ae5e1e004ecc37398acd3d6caaa4cb7..bb6955d212fac6edb9fbc1b8225a758ae59bdf36 100644 (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;
     }
 
index 25eb488f844523da84db29641ef7d5021454e463..6937372b8b631c51f84b182801d871984f9f8142 100644 (file)
@@ -21,7 +21,7 @@
 #include <string.h>
 #include <sys/utsname.h>
 
-int
+static int
 kernel_has_rtsig (void)
 {
   return 0;
diff --git a/sysdeps/generic/truncate64.c b/sysdeps/generic/truncate64.c
new file mode 100644 (file)
index 0000000..6a9d91f
--- /dev/null
@@ -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);
+}
index 3d90170b501732dbc68f43e372e85083267a27f1..d62ba32a5428eb533fa906fc7366e9e5042cf1c7 100644 (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;
index 8843977a010e475080126d4a50e61de3c3c74db4..4454f7d34bad47a5b9fcedf16e959d72f1d7f1e8 100644 (file)
@@ -19,6 +19,7 @@
    Boston, MA 02111-1307, USA.  */
 
 #include <errno.h>
+#include <sys/types.h>
 #include <sys/wait.h>
 
 int
index 034b6f82949eb980ee6693a68fb3ba0990420d75..569e5a06c427af287a0cea1b68f755c243285055 100644 (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,
index c268b642de4db36a3cc8c94caae984b0f040e68e..8858ebeae5915a9fcce797dc14fb8b34d7b4355f 100644 (file)
@@ -42,27 +42,48 @@ 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");
+
+  printf (" #define FILENAME_MAX %u\n",
+#ifdef PATH_MAX
+         PATH_MAX
+#else
+        /* This is supposed to be the size needed to hold the longest file
+           name string the implementation guarantees can be opened.
+           PATH_MAX not being defined means the actual limit on the length
+           of a file name is runtime-variant (or it is unlimited).  ISO
+           says in such a case FILENAME_MAX should be a good size to
+           allocate for a file name string.  POSIX.1 guarantees that a
+           file name up to _POSIX_PATH_MAX chars long can be opened, so
+           this value must be at least that.  */
+         1024          /* _POSIX_PATH_MAX is 255.  */
+#endif
+         );
+
+  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.  */
 
-  printf ("#define FOPEN_MAX %u\n",
+  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
@@ -76,22 +97,8 @@ main()
 #endif
 
          );
+  puts ("#endif");
+  puts ("#undef __need_FOPEN_MAX");
 
-  printf ("#define FILENAME_MAX %u\n",
-#ifdef PATH_MAX
-         PATH_MAX
-#else
-        /* This is supposed to be the size needed to hold the longest file
-           name string the implementation guarantees can be opened.
-           PATH_MAX not being defined means the actual limit on the length
-           of a file name is runtime-variant (or it is unlimited).  ISO
-           says in such a case FILENAME_MAX should be a good size to
-           allocate for a file name string.  POSIX.1 guarantees that a
-           file name up to _POSIX_PATH_MAX chars long can be opened, so
-           this value must be at least that.  */
-         1024          /* _POSIX_PATH_MAX is 255.  */
-#endif
-         );
-
-  exit(0);
+  exit (0);
 }
index 8dde095b792dc2311c4ee220650fb40d142951bb..b0c559f70bb2ac49c99317464926a7a9c577242c 100644 (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
     }
 }
 
index 391f92548f3044a6dee9c6f53fa13eb9d858f95b..373d701bc3b965294f1f9f81421e77e14f1e89f0 100644 (file)
@@ -56,6 +56,7 @@
 # define EIO           28
 # define ENOSPC                29
 # define EEXIST                30
+# define EBUSY         31
 #endif
 
 #define __set_errno(val) errno = (val)
index 6978c87dd2b9ef9472b2c6df972aba732ca57988..c0b40ba0d107055e2891139639eb3509563da0e4 100644 (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
 
 
index b25a58314d51b58fe8feea71c94b5523f1de9990..4a242efe1ced53dd1bfebcd211f7ab7a09df2f89 100644 (file)
    write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
    Boston, MA 02111-1307, USA.  */
 
+#include <errno.h>
+#include <stdarg.h>
 #include <sysdep.h>
-#include <sys/resource.h>
 #include <unistd.h>
-#include <errno.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);
+
+       limit.rlim_cur = newlimit * 512;
+       limit.rlim_max = newlimit * 512;
 
-       return setrlimit (RLIMIT_FSIZE, &fsize);
+       result = setrlimit (RLIMIT_FSIZE, &limit);
       }
-    case 3:
-      /* Get maximum address for `brk'.  */
-      {
-       struct rlimit dsize;
+      break;
 
-       status = getrlimit (RLIMIT_DATA, &dsize);
-       if (status < 0)
-         return -1;
+    case __UL_GETMAXBRK:
+      /* Get maximum address for `brk'.  */
+      if (getrlimit (RLIMIT_DATA, &limit) == 0)
+       result = ((long int) &_etext) + limit.rlim_cur;
+      break;
 
-       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;
 }
index fa95317ec96043a73e194ae49980e3caf7c43f16..e22cec7dec41c41b30627f34cc9ddbb917303a9d 100644 (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
index 27684ef3fe0aa86a1a017e226f82a72ba7429568..152c7984bd77c82ce3a1a65661e5de5825c3e1a5 100644 (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
index 9acdf0c490db235047878e616ec13ce6c76a8fe4..9033fdb362c3449b6dd6eb32d97121ff6b163fa0 100644 (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;
 
diff --git a/sysdeps/unix/sysv/linux/alpha/fstatfs64.c b/sysdeps/unix/sysv/linux/alpha/fstatfs64.c
new file mode 100644 (file)
index 0000000..2be4e59
--- /dev/null
@@ -0,0 +1 @@
+/* fstatfs64 is the same as fstatfs. */
diff --git a/sysdeps/unix/sysv/linux/alpha/ftruncate64.c b/sysdeps/unix/sysv/linux/alpha/ftruncate64.c
new file mode 100644 (file)
index 0000000..673a8b5
--- /dev/null
@@ -0,0 +1 @@
+/* ftruncate64 is the same as ftruncate. */
diff --git a/sysdeps/unix/sysv/linux/alpha/getrlimit64.c b/sysdeps/unix/sysv/linux/alpha/getrlimit64.c
new file mode 100644 (file)
index 0000000..9feab0e
--- /dev/null
@@ -0,0 +1 @@
+/* getrlimit64 is the same as getrlimit. */
index ffbcaf152112f1dbc9146415ba35577b83735d1c..a3f5d8f0c4e62e40268d35d1799e7bc6a0f8dc31 100644 (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);
diff --git a/sysdeps/unix/sysv/linux/alpha/readdir.c b/sysdeps/unix/sysv/linux/alpha/readdir.c
new file mode 100644 (file)
index 0000000..96a6a76
--- /dev/null
@@ -0,0 +1,4 @@
+#define readdir64 __no_readdir64_decl
+#include <sysdeps/unix/readdir.c>
+#undef readdir64
+weak_alias (__readdir, readdir64)
diff --git a/sysdeps/unix/sysv/linux/alpha/readdir64.c b/sysdeps/unix/sysv/linux/alpha/readdir64.c
new file mode 100644 (file)
index 0000000..9796431
--- /dev/null
@@ -0,0 +1 @@
+/* readdir64 is in readdir.c */
diff --git a/sysdeps/unix/sysv/linux/alpha/readdir64_r.c b/sysdeps/unix/sysv/linux/alpha/readdir64_r.c
new file mode 100644 (file)
index 0000000..b8fe9a3
--- /dev/null
@@ -0,0 +1 @@
+/* readdir64_r is in readdir_r.c */
diff --git a/sysdeps/unix/sysv/linux/alpha/readdir_r.c b/sysdeps/unix/sysv/linux/alpha/readdir_r.c
new file mode 100644 (file)
index 0000000..adb92db
--- /dev/null
@@ -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)
diff --git a/sysdeps/unix/sysv/linux/alpha/setrlimit64.c b/sysdeps/unix/sysv/linux/alpha/setrlimit64.c
new file mode 100644 (file)
index 0000000..8edcff0
--- /dev/null
@@ -0,0 +1 @@
+/* setrlimit64 is the same as setrlimit. */
diff --git a/sysdeps/unix/sysv/linux/alpha/statfs64.c b/sysdeps/unix/sysv/linux/alpha/statfs64.c
new file mode 100644 (file)
index 0000000..06bc688
--- /dev/null
@@ -0,0 +1 @@
+/* statfs64 is the same as statfs. */
index d3bc033b3de3108a7bf1fa274d8bad9b2764738a..af964718bc15252aeab04ade5820eff7ee98c7fc 100644 (file)
@@ -23,10 +23,14 @@ mmap                -       mmap            6       __mmap          mmap
 llseek         EXTRA   lseek           3       __llseek        llseek lseek64
 pread          EXTRA   pread           4       __pread         pread __pread64 pread64
 pwrite         EXTRA   pwrite          4       __pwrite        pwrite __pwrite64 pwrite64
+fstatfs                -       fstatfs         2       __fstatfs       fstatfs fstatfs64
+statfs         -       statfs          2       __statfs        statfs statfs64
+getrlimit      -       getrlimit       2       getrlimit       getrlimit64
+setrlimit      -       setrlimit       2       setrlimit       setrlimit64
+ftruncate      -       ftruncate       2       ftruncate       ftruncate64
+truncate       -       truncate        2       truncate        truncate64
 
 # these are actually common with the x86:
-fstatfs                -       fstatfs         2       __fstatfs       fstatfs
-statfs         -       statfs          2       __statfs        statfs
 sys_ustat      ustat   ustat           2       __syscall_ustat
 sys_mknod      xmknod  mknod           3       __syscall_mknod
 
diff --git a/sysdeps/unix/sysv/linux/alpha/truncate64.c b/sysdeps/unix/sysv/linux/alpha/truncate64.c
new file mode 100644 (file)
index 0000000..8999768
--- /dev/null
@@ -0,0 +1 @@
+/* truncate64 is the same as truncate. */
index 9d0b9a9afa81bc799efda0d90b6b15b386cc63ed..d7a8e5ee0f450a53f07d52399adba0f8c903173d 100644 (file)
@@ -17,7 +17,7 @@
    Boston, MA 02111-1307, USA.  */
 
 #ifndef _SYS_MSG_H
-#error "Never use <bits/msq.h> directly; include <sys/msg.h> instead."
+# error "Never use <bits/msq.h> directly; include <sys/msg.h> instead."
 #endif
 
 #include <sys/types.h>
@@ -28,7 +28,7 @@
 
 
 /* Structure of record for one message inside the kernel.
-   The type `struct __msg' is opaque.  */
+   The type `struct msg' is opaque.  */
 struct msqid_ds
 {
   struct ipc_perm msg_perm;    /* structure describing operation permission */
@@ -42,17 +42,17 @@ struct msqid_ds
   unsigned short int __msg_cbytes;/* current number of bytes on queue */
   unsigned short int msg_qnum; /* number of messages currently on queue */
   unsigned short int msg_qbytes;/* max number of bytes allowed on queue */
-  int msg_lspid;               /* pid of last msgsnd() */
-  int msg_lrpid;               /* pid of last msgrcv() */
+  __ipc_pid_t msg_lspid;       /* pid of last msgsnd() */
+  __ipc_pid_t msg_lrpid;       /* pid of last msgrcv() */
 };
 
 #ifdef __USE_MISC
 
-#define msg_cbytes     __msg_cbytes
+# define msg_cbytes    __msg_cbytes
 
 /* ipcs ctl commands */
-#define MSG_STAT 11
-#define MSG_INFO 12
+# define MSG_STAT 11
+# define MSG_INFO 12
 
 /* buffer for msgctl calls IPC_INFO, MSG_INFO */
 struct msginfo
@@ -64,7 +64,7 @@ struct msginfo
     int msgmni;
     int msgssz;
     int msgtql;
-    ushort  msgseg;
+    unsigned short int msgseg;
   };
 
 #endif /* __USE_MISC */
index f825cba929c4bb589c5d2b3fe9d0cc726176e592..c649217e7e129aa4c310c47a682049d175df73af 100644 (file)
@@ -102,12 +102,20 @@ enum __rlimit_resource
   RLIM_NLIMITS = RLIMIT_NLIMITS,
 #define RLIMIT_NLIMITS RLIMIT_NLIMITS
 #define RLIM_NLIMITS RLIM_NLIMITS
-
-  /* Value to indicate that there is no limit.  */
-  RLIM_INFINITY = (long int)(~0UL >> 1)
-#define RLIM_INFINITY RLIM_INFINITY
 };
 
+/* Value to indicate that there is no limit.  */
+#ifndef __USE_FILE_OFFSET64
+# define RLIM_INFINITY ((long int)(~0UL >> 1))
+#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;
index 6f5f840909ddf0d047988d542fe76af981bbdc5d..c7070595b81eec5c0cbec5fc758fbf2bad25820b 100644 (file)
@@ -44,8 +44,8 @@ struct shmid_ds
     __time_t shm_atime;                        /* time of last shmat() */
     __time_t shm_dtime;                        /* time of last shmdt() */
     __time_t shm_ctime;                        /* time of last change by shmctl() */
-    int shm_cpid;                      /* pid of creator */
-    int shm_lpid;                      /* pid of last shmop */
+    __ipc_pid_t shm_cpid;              /* pid of creator */
+    __ipc_pid_t shm_lpid;              /* pid of last shmop */
     unsigned short int shm_nattch;     /* number of current attaches */
     unsigned short int __shm_npages;   /* size of segment (pages) */
     unsigned long int *__shm_pages;    /* array of ptrs to frames -> SHMMAX */
@@ -73,12 +73,12 @@ struct      shminfo
 
 struct shm_info
   {
-    int   used_ids;
-    ulong shm_tot;     /* total allocated shm */
-    ulong shm_rss;     /* total resident shm */
-    ulong shm_swp;     /* total swapped shm */
-    ulong swap_attempts;
-    ulong swap_successes;
+    int used_ids;
+    unsigned long int shm_tot; /* total allocated shm */
+    unsigned long int shm_rss; /* total resident shm */
+    unsigned long int shm_swp; /* total swapped shm */
+    unsigned long int swap_attempts;
+    unsigned long int swap_successes;
   };
 
 #endif /* __USE_MISC */
index 926c3f32f4567a577d23b293bc7bf37c014e85f6..0a5891210e9adec65adee1d1626dd999a2bea633 100644 (file)
@@ -82,32 +82,40 @@ struct termios
 #define ONLRET 0000040
 #define OFILL  0000100
 #define OFDEL  0000200
-#define NLDLY  0000400
-#define   NL0  0000000
-#define   NL1  0000400
-#define CRDLY  0003000
-#define   CR0  0000000
-#define   CR1  0001000
-#define   CR2  0002000
-#define   CR3  0003000
-#define TABDLY 0014000
-#define   TAB0 0000000
-#define   TAB1 0004000
-#define   TAB2 0010000
-#define   TAB3 0014000
-#define   XTABS        0014000
-#define BSDLY  0020000
-#define   BS0  0000000
-#define   BS1  0020000
+#if !defined __USE_POSIX || defined __USE_UNIX98
+# define NLDLY 0000400
+# define   NL0 0000000
+# define   NL1 0000400
+# define CRDLY 0003000
+# define   CR0 0000000
+# define   CR1 0001000
+# define   CR2 0002000
+# define   CR3 0003000
+# define TABDLY        0014000
+# define   TAB0        0000000
+# define   TAB1        0004000
+# define   TAB2        0010000
+# define   TAB3        0014000
+# define BSDLY 0020000
+# define   BS0 0000000
+# define   BS1 0020000
+# define FFDLY 0100000
+# define   FF0 0000000
+# define   FF1 0100000
+#endif
+
 #define VTDLY  0040000
 #define   VT0  0000000
 #define   VT1  0040000
-#define FFDLY  0100000
-#define   FF0  0000000
-#define   FF1  0100000
+
+#if (!defined __USE_POSIX && !defined __USE_XOPEN) || defined __USE_GNU
+# define XTABS 0014000
+#endif
 
 /* c_cflag bit meaning */
-#define CBAUD  0010017
+#if (!defined __USE_POSIX && !defined __USE_XOPEN) || defined __USE_GNU
+# define CBAUD 0010017
+#endif
 #define  B0    0000000         /* hang up */
 #define  B50   0000001
 #define  B75   0000002
@@ -124,8 +132,10 @@ struct termios
 #define  B9600 0000015
 #define  B19200        0000016
 #define  B38400        0000017
-#define EXTA B19200
-#define EXTB B38400
+#if (!defined __USE_POSIX && !defined __USE_XOPEN) || defined __USE_GNU
+# define EXTA B19200
+# define EXTB B38400
+#endif
 #define CSIZE  0000060
 #define   CS5  0000000
 #define   CS6  0000020
@@ -137,29 +147,37 @@ struct termios
 #define PARODD 0001000
 #define HUPCL  0002000
 #define CLOCAL 0004000
-#define CBAUDEX 0010000
+#if (!defined __USE_POSIX && !defined __USE_XOPEN) || defined __USE_GNU
+# define CBAUDEX 0010000
+#endif
 #define  B57600  0010001
 #define  B115200 0010002
 #define  B230400 0010003
 #define  B460800 0010004
-#define CIBAUD   002003600000  /* input baud rate (not used) */
-#define CRTSCTS          020000000000          /* flow control */
+#if (!defined __USE_POSIX && !defined __USE_XOPEN) || defined __USE_GNU
+# define CIBAUD          002003600000          /* input baud rate (not used) */
+# define CRTSCTS  020000000000         /* flow control */
+#endif
 
 /* c_lflag bits */
 #define ISIG   0000001
 #define ICANON 0000002
-#define XCASE  0000004
+#if !defined __USE_POSIX || defined __USE_UNIX98
+# define XCASE 0000004
+#endif
 #define ECHO   0000010
 #define ECHOE  0000020
 #define ECHOK  0000040
 #define ECHONL 0000100
 #define NOFLSH 0000200
 #define TOSTOP 0000400
-#define ECHOCTL        0001000
-#define ECHOPRT        0002000
-#define ECHOKE 0004000
-#define FLUSHO 0010000
-#define PENDIN 0040000
+#if (!defined __USE_POSIX && !defined __USE_XOPEN) || defined __USE_GNU
+# define ECHOCTL 0001000
+# define ECHOPRT 0002000
+# define ECHOKE         0004000
+# define FLUSHO         0010000
+# define PENDIN         0040000
+#endif
 #define IEXTEN 0100000
 
 /* tcflow() and TCXONC use these */
index dec60e244bc8096970fbb2285da1717f4946b6af..723e0ff2236b281d313e7d3cfd8a4f24a7b1054c 100644 (file)
@@ -103,6 +103,9 @@ typedef struct
 
 typedef int __key_t;
 
+/* Used in `struct shmid_ds'.  */
+typedef short int __ipc_pid_t;
+
 
 /* Types from the Large File Support interface.  */
 
diff --git a/sysdeps/unix/sysv/linux/fxstat64.c b/sysdeps/unix/sysv/linux/fxstat64.c
new file mode 100644 (file)
index 0000000..f688499
--- /dev/null
@@ -0,0 +1,41 @@
+/* fxstat64 using old-style Unix fstat system call.
+   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 <errno.h>
+#include <stddef.h>
+#include <sys/stat.h>
+#include <kernel_stat.h>
+
+#include <xstatconv.c>
+
+extern int __syscall_fstat (int, struct kernel_stat *);
+
+/* Get information about the file FD in BUF.  */
+int
+__fxstat64 (int vers, int fd, struct stat64 *buf)
+{
+  struct kernel_stat kbuf;
+  int result;
+
+  result =  __syscall_fstat (fd, &kbuf);
+  if (result == 0)
+    result = xstat64_conv (vers, &kbuf, buf);
+
+  return result;
+}
index b4b12d48eb1c8a3bf2904cb395bd4f3c6e5539ab..b1b532a396145abb8f57094968fe95eb80d00e58 100644 (file)
@@ -46,6 +46,10 @@ struct kernel_dirent
     char d_name[256];
   };
 
+#ifdef GETDENTS64
+#define __getdirentries __getdirentries64
+#define dirent dirent64
+#endif
 
 /* The problem here is that we cannot simply read the next NBYTES
    bytes.  We need to take the additional field into account.  We use
@@ -111,4 +115,6 @@ __getdirentries (fd, buf, nbytes, basep)
   return (char *) dp - buf;
 }
 
+#ifndef GETDENTS64
 weak_alias (__getdirentries, getdirentries)
+#endif
diff --git a/sysdeps/unix/sysv/linux/getdents64.c b/sysdeps/unix/sysv/linux/getdents64.c
new file mode 100644 (file)
index 0000000..f50b0be
--- /dev/null
@@ -0,0 +1,2 @@
+#define GETDENTS64
+#include <getdents.c>
diff --git a/sysdeps/unix/sysv/linux/lxstat64.c b/sysdeps/unix/sysv/linux/lxstat64.c
new file mode 100644 (file)
index 0000000..8813fad
--- /dev/null
@@ -0,0 +1,41 @@
+/* lxstat64 using old-style Unix lstat system call.
+   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 <errno.h>
+#include <stddef.h>
+#include <sys/stat.h>
+#include <kernel_stat.h>
+
+#include <xstatconv.c>
+
+extern int __syscall_lstat (const char *, struct kernel_stat *);
+
+/* Get information about the file NAME in BUF.  */
+int
+__lxstat64 (int vers, const char *name, struct stat64 *buf)
+{
+  struct kernel_stat kbuf;
+  int result;
+
+  result =  __syscall_lstat (name, &kbuf);
+  if (result == 0)
+    result = xstat64_conv (vers, &kbuf, buf);
+
+  return result;
+}
diff --git a/sysdeps/unix/sysv/linux/mips/bits/types.h b/sysdeps/unix/sysv/linux/mips/bits/types.h
new file mode 100644 (file)
index 0000000..56075d1
--- /dev/null
@@ -0,0 +1,130 @@
+/* Copyright (C) 1991, 92, 94, 95, 96, 97 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   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.  */
+
+/*
+ * Never include this file directly; use <sys/types.h> instead.
+ */
+
+#ifndef        _BITS_TYPES_H
+#define        _BITS_TYPES_H   1
+
+#include <features.h>
+
+/* Convenience types.  */
+typedef unsigned char __u_char;
+typedef unsigned short __u_short;
+typedef unsigned int __u_int;
+typedef unsigned long __u_long;
+#ifdef __GNUC__
+typedef unsigned long long int __u_quad_t;
+typedef long long int __quad_t;
+#else
+typedef struct
+  {
+    long int __val[2];
+  } __quad_t;
+typedef struct
+  {
+    __u_long __val[2];
+  } __u_quad_t;
+#endif
+typedef signed char __int8_t;
+typedef unsigned char __uint8_t;
+typedef signed short int __int16_t;
+typedef unsigned short int __uint16_t;
+typedef signed int __int32_t;
+typedef unsigned int __uint32_t;
+#ifdef __GNUC__
+typedef signed long long int __int64_t;
+typedef unsigned long long int __uint64_t;
+#endif
+typedef __quad_t *__qaddr_t;
+
+typedef __u_quad_t __dev_t;            /* Type of device numbers.  */
+typedef __u_int __uid_t;               /* Type of user identifications.  */
+typedef __u_int __gid_t;               /* Type of group identifications.  */
+typedef __u_long __ino_t;              /* Type of file serial numbers.  */
+typedef __u_int __mode_t;              /* Type of file attribute bitmasks.  */
+typedef __u_int __nlink_t;             /* Type of file link counts.  */
+typedef long int __off_t;              /* Type of file sizes and offsets.  */
+typedef __quad_t __loff_t;             /* Type of file sizes and offsets.  */
+typedef int __pid_t;                   /* Type of process identifications.  */
+typedef int __ssize_t;                 /* Type of a byte count, or error.  */
+typedef long int __rlim_t;             /* Type of resource counts.  */
+typedef __quad_t __rlim64_t;           /* Type of resource counts (LFS).  */
+typedef __u_int __id_t;                        /* General type for ID.  */
+
+typedef struct
+  {
+    int __val[2];
+  } __fsid_t;                          /* Type of file system IDs.  */
+
+/* Everythin' else.  */
+typedef int __daddr_t;                 /* The type of a disk address.  */
+typedef char *__caddr_t;
+typedef long int __time_t;
+typedef long int __swblk_t;            /* Type of a swap block maybe?  */
+\f
+typedef long int __clock_t;
+
+/* One element in the file descriptor mask array.  */
+typedef unsigned long int __fd_mask;
+
+/* Number of descriptors that can fit in an `fd_set'.  */
+#define __FD_SETSIZE   1024
+
+/* It's easier to assume 8-bit bytes than to get CHAR_BIT.  */
+#define __NFDBITS      (8 * sizeof (__fd_mask))
+#define        __FDELT(d)      ((d) / __NFDBITS)
+#define        __FDMASK(d)     ((__fd_mask) 1 << ((d) % __NFDBITS))
+
+/* fd_set for select and pselect.  */
+typedef struct
+  {
+    /* XPG4.2 requires this member name.  */
+    __fd_mask fds_bits[__FD_SETSIZE / __NFDBITS];
+  } __fd_set;
+
+
+typedef int __key_t;
+
+/* Used in `struct shmid_ds'.  */
+typedef long int __ipc_pid_t;
+
+
+/* Types from the Large File Support interface.  */
+
+/* Type to count number os disk blocks.  */
+typedef __u_long __blkcnt_t;
+typedef __u_quad_t __blkcnt64_t;
+
+/* Type to count file system blocks.  */
+typedef long int __fsblkcnt_t;
+typedef __quad_t __fsblkcnt64_t;
+
+/* Type to count file system inodes.  */
+typedef __u_long __fsfilcnt_t;
+typedef __u_quad_t __fsfilcnt64_t;
+
+/* Type of file serial numbers.  */
+typedef __u_long __ino64_t;
+
+/* Type of file sizes and offsets.  */
+typedef __loff_t __off64_t;
+
+#endif /* bits/types.h */
diff --git a/sysdeps/unix/sysv/linux/readdir64.c b/sysdeps/unix/sysv/linux/readdir64.c
new file mode 100644 (file)
index 0000000..3762365
--- /dev/null
@@ -0,0 +1,103 @@
+/* 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 <errno.h>
+#include <limits.h>
+#include <stddef.h>
+#include <string.h>
+#include <dirent.h>
+#include <unistd.h>
+#include <sys/types.h>
+#include <assert.h>
+
+#include <dirstream.h>
+
+extern ssize_t __getdirentries64 (int, char *, size_t, off_t *);
+
+
+/* Read a directory entry from DIRP.  */
+struct dirent64 *
+readdir64 (DIR *dirp)
+{
+  struct dirent64 *dp;
+
+  __libc_lock_lock (dirp->lock);
+
+  do
+    {
+      size_t reclen;
+
+      if (dirp->offset >= dirp->size)
+       {
+         /* We've emptied out our buffer.  Refill it.  */
+
+         size_t maxread;
+         off_t base;
+         ssize_t bytes;
+
+#ifndef _DIRENT_HAVE_D_RECLEN
+         /* Fixed-size struct; must read one at a time (see below).  */
+         maxread = sizeof *dp;
+#else
+         maxread = dirp->allocation;
+#endif
+
+         base = dirp->filepos;
+         bytes = __getdirentries64 (dirp->fd, dirp->data, maxread, &base);
+         if (bytes <= 0)
+           {
+             dp = NULL;
+             break;
+           }
+         dirp->size = (size_t) bytes;
+
+         /* Reset the offset into the buffer.  */
+         dirp->offset = 0;
+       }
+
+      dp = (struct dirent64 *) &dirp->data[dirp->offset];
+
+#ifdef _DIRENT_HAVE_D_RECLEN
+      reclen = dp->d_reclen;
+#else
+      /* The only version of `struct dirent64' that lacks `d_reclen'
+        is fixed-size.  */
+      assert (sizeof dp->d_name > 1);
+      reclen = sizeof *dp;
+      /* The name is not terminated if it is the largest possible size.
+        Clobber the following byte to ensure proper null termination.  We
+        read jst one entry at a time above so we know that byte will not
+        be used later.  */
+      dp->d_name[sizeof dp->d_name] = '\0';
+#endif
+
+      dirp->offset += reclen;
+
+#ifdef _DIRENT_HAVE_D_OFF
+      dirp->filepos = dp->d_off;
+#else
+      dirp->filepos += reclen;
+#endif
+
+      /* Skip deleted files.  */
+    } while (dp->d_ino == 0);
+
+  __libc_lock_unlock (dirp->lock);
+
+  return dp;
+}
diff --git a/sysdeps/unix/sysv/linux/readdir64_r.c b/sysdeps/unix/sysv/linux/readdir64_r.c
new file mode 100644 (file)
index 0000000..57ae4c7
--- /dev/null
@@ -0,0 +1,107 @@
+/* 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 <errno.h>
+#include <limits.h>
+#include <stddef.h>
+#include <string.h>
+#include <dirent.h>
+#include <unistd.h>
+#include <sys/types.h>
+#include <assert.h>
+
+#include <dirstream.h>
+
+extern ssize_t __getdirentries64 (int, char *, size_t, off_t *);
+
+
+/* Read a directory entry from DIRP, store result in ENTRY and return
+   pointer to result in *RESULT.  */
+int
+readdir64_r (DIR *dirp, struct dirent64 *entry, struct dirent64 **result)
+{
+  struct dirent64 *dp;
+  size_t reclen;
+
+  __libc_lock_lock (dirp->lock);
+
+  do
+    {
+      if (dirp->offset >= dirp->size)
+       {
+         /* We've emptied out our buffer.  Refill it.  */
+
+         size_t maxread;
+         off_t base;
+         ssize_t bytes;
+
+#ifndef _DIRENT_HAVE_D_RECLEN
+         /* Fixed-size struct; must read one at a time (see below).  */
+         maxread = sizeof *dp;
+#else
+         maxread = dirp->allocation;
+#endif
+
+         base = dirp->filepos;
+         bytes = __getdirentries64 (dirp->fd, dirp->data, maxread, &base);
+         if (bytes <= 0)
+           {
+             dp = NULL;
+             reclen = 0;
+             break;
+           }
+         dirp->size = (size_t) bytes;
+
+         /* Reset the offset into the buffer.  */
+         dirp->offset = 0;
+       }
+
+      dp = (struct dirent64 *) &dirp->data[dirp->offset];
+
+#ifdef _DIRENT_HAVE_D_RECLEN
+      reclen = dp->d_reclen;
+#else
+      /* The only version of `struct dirent64' that lacks `d_reclen'
+        is fixed-size.  */
+      assert (sizeof dp->d_name > 1);
+      reclen = sizeof *dp;
+      /* The name is not terminated if it is the largest possible size.
+        Clobber the following byte to ensure proper null termination.  We
+        read just one entry at a time above so we know that byte will not
+        be used later.  */
+      dp->d_name[sizeof dp->d_name] = '\0';
+#endif
+
+      dirp->offset += reclen;
+
+#ifdef _DIRENT_HAVE_D_OFF
+      dirp->filepos = dp->d_off;
+#else
+      dirp->filepos += reclen;
+#endif
+
+      /* Skip deleted files.  */
+    } while (dp->d_ino == 0);
+
+  if (dp != NULL)
+    *result = memcpy (entry, dp, reclen);
+
+  __libc_lock_unlock (dirp->lock);
+
+  return dp != NULL ? 0 : errno;
+}
similarity index 81%
rename from sysdeps/unix/sysv/linux/powerpc/sigreturn.S
rename to sysdeps/unix/sysv/linux/rt_sigpending.c
index 9b9413e2f32ad4e291ecdfb72f7008e16e46c04d..b605315644f4b801f8325991238f33dcdd8f9451 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 1995, 1996, 1997 Free Software Foundation, Inc.
+/* 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
    write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
    Boston, MA 02111-1307, USA.  */
 
-#include <sysdep.h>
+#include <errno.h>
+#include <signal.h>
 
-PSEUDO (__sigreturn, sigreturn, 1)
-       /* Shouldn't get here.  */
-PSEUDO_END(__sigreturn)
+int
+__syscall_rt_sigpending (sigset_t *set, size_t setsize)
+{
+  __set_errno (ENOSYS);
+  return -1;
+}
index 9f42cc0a878e24e5dcb1346ec48aea311bd23724..6bb8562899d61d0b730b987144e874e4c535e40b 100644 (file)
@@ -21,6 +21,6 @@ default_symbol_version (__new_sys_siglist, _sys_siglist, GLIBC_2.1);
 default_symbol_version (_new_sys_siglist, sys_siglist, GLIBC_2.1);
 default_symbol_version (__new_sys_sigabbrev, sys_sigabbrev, GLIBC_2.1);
 #else
-weak_alias(_sys_siglist, sys_siglist)
-weak_alias(_sys_sigabbrev, sys_sigabbrev)
+weak_alias(__new_sys_siglist, sys_siglist)
+weak_alias(__new_sys_sigabbrev, sys_sigabbrev)
 #endif
index 0c421fb7a711326cb89fd6efc12e9c3035e32950..5ee6c0ee7ae431609dedf42deb41caf794414d60 100644 (file)
@@ -95,6 +95,9 @@ typedef struct
 
 typedef int __key_t;
 
+/* Used in `struct shmid_ds'.  */
+typedef int __ipc_pid_t;
+
 
 /* Types from the Large File Support interface.  */
 
diff --git a/sysdeps/unix/sysv/linux/sparc/sparc64/fstatfs64.c b/sysdeps/unix/sysv/linux/sparc/sparc64/fstatfs64.c
new file mode 100644 (file)
index 0000000..2be4e59
--- /dev/null
@@ -0,0 +1 @@
+/* fstatfs64 is the same as fstatfs. */
diff --git a/sysdeps/unix/sysv/linux/sparc/sparc64/ftruncate64.c b/sysdeps/unix/sysv/linux/sparc/sparc64/ftruncate64.c
new file mode 100644 (file)
index 0000000..673a8b5
--- /dev/null
@@ -0,0 +1 @@
+/* ftruncate64 is the same as ftruncate. */
diff --git a/sysdeps/unix/sysv/linux/sparc/sparc64/getrlimit64.c b/sysdeps/unix/sysv/linux/sparc/sparc64/getrlimit64.c
new file mode 100644 (file)
index 0000000..9feab0e
--- /dev/null
@@ -0,0 +1 @@
+/* getrlimit64 is the same as getrlimit. */
diff --git a/sysdeps/unix/sysv/linux/sparc/sparc64/readdir.c b/sysdeps/unix/sysv/linux/sparc/sparc64/readdir.c
new file mode 100644 (file)
index 0000000..96a6a76
--- /dev/null
@@ -0,0 +1,4 @@
+#define readdir64 __no_readdir64_decl
+#include <sysdeps/unix/readdir.c>
+#undef readdir64
+weak_alias (__readdir, readdir64)
diff --git a/sysdeps/unix/sysv/linux/sparc/sparc64/readdir64.c b/sysdeps/unix/sysv/linux/sparc/sparc64/readdir64.c
new file mode 100644 (file)
index 0000000..9796431
--- /dev/null
@@ -0,0 +1 @@
+/* readdir64 is in readdir.c */
diff --git a/sysdeps/unix/sysv/linux/sparc/sparc64/readdir64_r.c b/sysdeps/unix/sysv/linux/sparc/sparc64/readdir64_r.c
new file mode 100644 (file)
index 0000000..b8fe9a3
--- /dev/null
@@ -0,0 +1 @@
+/* readdir64_r is in readdir_r.c */
diff --git a/sysdeps/unix/sysv/linux/sparc/sparc64/readdir_r.c b/sysdeps/unix/sysv/linux/sparc/sparc64/readdir_r.c
new file mode 100644 (file)
index 0000000..adb92db
--- /dev/null
@@ -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)
diff --git a/sysdeps/unix/sysv/linux/sparc/sparc64/setrlimit64.c b/sysdeps/unix/sysv/linux/sparc/sparc64/setrlimit64.c
new file mode 100644 (file)
index 0000000..8edcff0
--- /dev/null
@@ -0,0 +1 @@
+/* setrlimit64 is the same as setrlimit. */
diff --git a/sysdeps/unix/sysv/linux/sparc/sparc64/statfs64.c b/sysdeps/unix/sysv/linux/sparc/sparc64/statfs64.c
new file mode 100644 (file)
index 0000000..06bc688
--- /dev/null
@@ -0,0 +1 @@
+/* statfs64 is the same as statfs. */
index 6491a9ccac5fb8e47aded56e2014ec2a760cd109..7e64daf57845bbfc7e64cfd11e7dadac73744e19 100644 (file)
@@ -4,6 +4,12 @@
 llseek         EXTRA   lseek           3       __llseek        llseek lseek64
 pread          EXTRA   pread           4       __pread         pread __pread64 pread64
 pwrite         EXTRA   pwrite          4       __pwrite        pwrite __pwrite64 pwrite64
+fstatfs                -       fstatfs         2       __fstatfs       fstatfs fstatfs64
+statfs         -       statfs          2       __statfs        statfs statfs64
+getrlimit      -       getrlimit       2       getrlimit       getrlimit64
+setrlimit      -       setrlimit       2       setrlimit       setrlimit64
+ftruncate      -       ftruncate       2       ftruncate       ftruncate64
+truncate       -       truncate        2       truncate        truncate64
 
 # Override select.S in parent directory:
 select         -       select          5       __select        select
diff --git a/sysdeps/unix/sysv/linux/sparc/sparc64/truncate64.c b/sysdeps/unix/sysv/linux/sparc/sparc64/truncate64.c
new file mode 100644 (file)
index 0000000..8999768
--- /dev/null
@@ -0,0 +1 @@
+/* truncate64 is the same as truncate. */
index 7fa98f7733332c12d5470892b733feef0206a785..07280956f25c3d25616e111de09ee21854f15e67 100644 (file)
    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 19
-#define TMP_MAX 238328
+#ifndef __need_FOPEN_MAX
+# define L_tmpnam 19
+# define TMP_MAX 238328
 
-#ifdef __USE_POSIX
-# define L_ctermid 9
-# define L_cuserid 9
+# ifdef __USE_POSIX
+#  define L_ctermid 9
+#  define L_cuserid 9
+# endif
+
+# define FILENAME_MAX  DEFAULT_FILENAME_MAX
 #endif
 
-#define FOPEN_MAX      DEFAULT_FOPEN_MAX
-#define FILENAME_MAX   DEFAULT_FILENAME_MAX
+#if defined __need_FOPEN_MAX && !defined __defined_FOPEN_MAX
+# define __defined_FOPEN_MAX
+# define FOPEN_MAX     DEFAULT_FOPEN_MAX
+#endif
+#undef __need_FOPEN_MAX
index 7256d7122769de315a01c0ab7d168f4e652917db..7c41877e66bf7d205a77c596320d205dd202983b 100644 (file)
 #include <string.h>
 #include <sys/utsname.h>
 
-int
+static int
 kernel_has_rtsig (void)
 {
   struct utsname name;
 
-  return uname (&name) < 0 || __strverscmp (name.release, "2.1.70") >= 0;
+  return uname (&name) == 0 && __strverscmp (name.release, "2.1.70") >= 0;
 }
index ef224d22ac6bbdf6bb0b4f9d70bcbf66d822390c..58ff111612709e84d7ff4ad9e39cedfc1de0919f 100644 (file)
    write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
    Boston, MA 02111-1307, USA.  */
 
+#include <errno.h>
+#include <stdarg.h>
 #include <sysdep.h>
-#include <sys/resource.h>
 #include <unistd.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.
        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);
+
+       limit.rlim_cur = newlimit * 512;
+       limit.rlim_max = newlimit * 512;
 
-       return setrlimit (RLIMIT_FSIZE, &fsize);
+       result = setrlimit (RLIMIT_FSIZE, &limit);
       }
-    case 4:
-      return sysconf (_SC_OPEN_MAX);
+      break;
+
+    case __UL_GETOPENMAX:
+      result = sysconf (_SC_OPEN_MAX);
+      break;
 
     default:
       __set_errno (EINVAL);
-      return -1;
     }
+
+  va_end (va);
+
+  return result;
 }
 
 weak_alias (__ulimit, ulimit);
diff --git a/sysdeps/unix/sysv/linux/xstat64.c b/sysdeps/unix/sysv/linux/xstat64.c
new file mode 100644 (file)
index 0000000..02f70c5
--- /dev/null
@@ -0,0 +1,41 @@
+/* xstat64 using old-style Unix stat system call.
+   Copyright (C) 1991, 1995, 1996, 1997 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Library General Public License as
+   published by the Free Software Foundation; either version 2 of the
+   License, or (at your option) any later version.
+
+   The GNU C Library is 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 <errno.h>
+#include <stddef.h>
+#include <sys/stat.h>
+#include <kernel_stat.h>
+
+#include <xstatconv.c>
+
+extern int __syscall_stat (const char *, struct kernel_stat *);
+
+/* Get information about the file NAME in BUF.  */
+int
+__xstat64 (int vers, const char *name, struct stat64 *buf)
+{
+  struct kernel_stat kbuf;
+  int result;
+
+  result =  __syscall_stat (name, &kbuf);
+  if (result == 0)
+    result = xstat64_conv (vers, &kbuf, buf);
+
+  return result;
+}
index fcf2f3b9f628aca80c49b7a99ede47b6ce9687b8..0a8e0c47f90d7d3a538e2793135e37d80cd666d6 100644 (file)
@@ -81,3 +81,65 @@ xstat_conv (int vers, struct kernel_stat *kbuf, void *ubuf)
 
   return 0;
 }
+
+static inline int
+xstat64_conv (int vers, struct kernel_stat *kbuf, void *ubuf)
+{
+#ifdef XSTAT_IS_XSTAT64
+  return xstat_conv (vers, kbuf, ubuf);
+#else
+  switch (vers)
+    {
+    case _STAT_VER_LINUX:
+      {
+       struct stat64 *buf = ubuf;
+
+       /* Convert to current kernel version of `struct stat64'.  */
+       buf->st_dev = kbuf->st_dev;
+#ifdef _HAVE___PAD1
+       buf->__pad1 = 0;
+#endif
+       buf->st_ino = kbuf->st_ino;
+       buf->st_mode = kbuf->st_mode;
+       buf->st_nlink = kbuf->st_nlink;
+       buf->st_uid = kbuf->st_uid;
+       buf->st_gid = kbuf->st_gid;
+       buf->st_rdev = kbuf->st_rdev;
+#ifdef _HAVE___PAD2
+       buf->__pad2 = 0;
+#endif
+       buf->st_size = kbuf->st_size;
+       buf->st_blksize = kbuf->st_blksize;
+       buf->st_blocks = kbuf->st_blocks;
+       buf->st_atime = kbuf->st_atime;
+#ifdef _HAVE___UNUSED1
+       buf->__unused1 = 0;
+#endif
+       buf->st_mtime = kbuf->st_mtime;
+#ifdef _HAVE___UNUSED2
+       buf->__unused2 = 0;
+#endif
+       buf->st_ctime = kbuf->st_ctime;
+#ifdef _HAVE___UNUSED3
+       buf->__unused3 = 0;
+#endif
+#ifdef _HAVE___UNUSED4
+       buf->__unused4 = 0;
+#endif
+#ifdef _HAVE___UNUSED5
+       buf->__unused5 = 0;
+#endif
+      }
+      break;
+
+      /* If struct stat64 is different from struct stat then
+        _STAT_VER_KERNEL does not make sense.  */
+    case _STAT_VER_KERNEL:
+    default:
+      __set_errno (EINVAL);
+      return -1;
+    }
+
+  return 0;
+#endif
+}
index f569be5b5168065b8c6de806c8c4dada9e42cacc..9200b8c2b8f8191de7b7441abf2ba2870e1aadbe 100644 (file)
@@ -313,20 +313,29 @@ typedef unsigned long long int uint_fast64_t;
 /* Macros for printing format specifiers.  */
 
 /* Decimal notation.  */
+#define SCNd8          "hhd"
 #define SCNd16         "hd"
 #define SCNd32         "d"
 #define SCNd64         "lld"
 
+#define SCNi8          "hhi"
 #define SCNi16         "hi"
 #define SCNi32         "i"
 #define SCNi64         "lli"
 
+#define SCNu8          "hhu"
+#define SCNu16         "hu"
+#define SCNu32         "u"
+#define SCNu64         "llu"
+
 /* Octal notation.  */
+#define SCNo8          "hho"
 #define SCNo16         "ho"
 #define SCNo32         "o"
 #define SCNo64         "llo"
 
 /* Hexadecimal notation.  */
+#define SCNx8          "hhx"
 #define SCNx16         "hx"
 #define SCNx32         "x"
 #define SCNx64         "llx"
index c62d516c4b3a5740b158fb58a07ea479a5ee9464..8ec8095620a5b3810e04ef9ef56276708eb2d4a2 100644 (file)
@@ -313,20 +313,29 @@ typedef unsigned long int uint_fast64_t;
 /* Macros for printing format specifiers.  */
 
 /* Decimal notation.  */
+#define SCNd8          "hhd"
 #define SCNd16         "hd"
 #define SCNd32         "d"
 #define SCNd64         "ld"
 
+#define SCNi8          "hhi"
 #define SCNi16         "hi"
 #define SCNi32         "i"
 #define SCNi64         "li"
 
+#define SCNu8          "hhu"
+#define SCNu16         "hu"
+#define SCNu32         "u"
+#define SCNu64         "lu"
+
 /* Octal notation.  */
+#define SCNo8          "hho"
 #define SCNo16         "ho"
 #define SCNo32         "o"
 #define SCNo64         "lo"
 
 /* Hexadecimal notation.  */
+#define SCNx8          "hhx"
 #define SCNx16         "hx"
 #define SCNx32         "x"
 #define SCNx64         "lx"
index 1c3160106e008e162c54f92c8c50a824d1eeedff..7875a929228295dec471345be8af1d8eaced6db0 100644 (file)
@@ -1,14 +1,14 @@
 The files
        zic.c zdump.c ialloc.c scheck.c tzfile.h
        private.h tzselect.ksh checktab.awk
-come from the tzcode1997g package by Arthur David Olson et.al.
+come from the tzcode1997h package by Arthur David Olson et.al.
 
 The files
        africa antarctica asia australasia europe
        northamerica southamerica pacificnew etcetera factory
        backward systemv solar87 solar88 solar89
        iso3166.tab zone.tab leapseconds yearistype
-come from the tzdata1997i package by Arthur David Olson et.al.
+come from the tzdata1997j package by Arthur David Olson et.al.
 
 These packages may be found at ftp://elsie.nci.nih.gov/pub/.  Commentary
 should be addressed to tz@elsie.nci.nih.gov.
index f58719da5b8fe0d395b1080979459bdf0b70f237..4b56816f40859e2c97a31171b47c968cd6239b82 100644 (file)
@@ -1,4 +1,4 @@
-# @(#)africa   7.20
+# @(#)africa   7.22
 
 # This data is by no means authoritative; if you think you know better,
 # go ahead and edit the file (and please send any changes to
index 83f0cfed760f81b8fd2a6794ddff7a7ba2a777b5..75d2cf63e44e5e958a216ac61c60e9f2886ea10f 100644 (file)
@@ -1,4 +1,4 @@
-# @(#)antarctica       7.8
+# @(#)antarctica       7.10
 
 # From Paul Eggert (1997-03-28):
 # To keep things manageable, we list only locations occupied year-round;
index 67347491793726e1ba7cd44ff88c6511d9e3deae..34960d88e6ea406d7ecad7e2ba39266a3c1adcc2 100644 (file)
--- a/time/asia
+++ b/time/asia
@@ -1,4 +1,4 @@
-# @(#)asia     7.30
+# @(#)asia     7.33
 
 # This data is by no means authoritative; if you think you know better,
 # go ahead and edit the file (and please send any changes to
@@ -45,8 +45,6 @@
 #      9:30    CST     (Australian) Central Standard Time
 #
 # See the `europe' file for Russia and Turkey in Asia.
-#
-# See the `africa' file for time zone naming and abbreviation conventions.
 
 # From Guy Harris:
 # Incorporates data for Singapore from Robert Elz' asia 1.1, as well as
index d981a6a9168be95938276658f4b7ac659db12ed8..2726a25d3dcfa96c1782cf721efce98ec91e238e 100644 (file)
@@ -1,4 +1,4 @@
-# @(#)australasia      7.34
+# @(#)australasia      7.37
 # This file also includes Pacific islands.
 
 # Notes are at the end of this file
@@ -472,8 +472,6 @@ Zone        Pacific/Wallis  12:15:20 -      LMT     1901
 #
 # See the `northamerica' file for Hawaii.
 # See the `southamerica' file for Easter I and the Galapagos Is.
-#
-# See the `africa' file for time zone naming and abbreviation conventions.
 
 ###############################################################################
 
index 59fcffcdffe3e8f5d0496c1efa0c6475302d4c36..4c7a19d2cff821ba6ec53cb96d105b49be53db2c 100644 (file)
@@ -1,4 +1,4 @@
-# @(#)backward 7.13
+# @(#)backward 7.14
 
 # This file provides links between current names for time zones
 # and their old names.  Many names changed in late 1993.
index c47fae7a68c39e0fb9ffeafa9b55541c59ae42d1..a6a65db40a68d25905e6b61894569b938d7413af 100644 (file)
@@ -1,4 +1,4 @@
-# @(#)etcetera 7.6
+# @(#)etcetera 7.8
 
 # These entries are mostly present for historical reasons, so that
 # people in areas not otherwise covered by the tz files could "zic -l"
index 2948ba1cafdaface282062c6e220622a3d11f539..4e30ab493402d924b9a39f8ff9a7eb4e46c27b85 100644 (file)
@@ -1,4 +1,4 @@
-# @(#)europe   7.46
+# @(#)europe   7.49
 
 # This data is by no means authoritative; if you think you know better,
 # go ahead and edit the file (and please send any changes to
@@ -37,8 +37,6 @@
 #       2:00   EET EEST Eastern Europe
 #       3:00   MSK MSD Moscow
 #
-# See the `africa' file for time zone naming and abbreviation conventions.
-#
 # A reliable and entertaining source about time zones, especially in Britain,
 # is Derek Howse, Greenwich time and the discovery of the longitude,
 # Oxford University Press (1980).
index d95df23c1dfe5a31862fd7c8d9a1755cd23f783b..ba27c63269400d29e2f339e21784ec8d47bd88f8 100644 (file)
@@ -1,4 +1,4 @@
-# @(#)factory  7.1
+# @(#)factory  7.3
 
 # For companies who don't want to put time zone specification in
 # their installation procedures.  When users run date, they'll get the message.
index 635c4ef1806958eb36b44c92eb53efa8c3af0825..a978333503bb0f076be54687bf52b7a8fd7eb5ac 100644 (file)
@@ -1,4 +1,4 @@
-# @(#)northamerica     7.32
+# @(#)northamerica     7.35
 # also includes Central America and the Caribbean
 
 # This data is by no means authoritative; if you think you know better,
@@ -481,8 +481,6 @@ Link        Pacific/Honolulu        HST
 # I found in the UCLA library.
 #
 # See the `europe' file for Greenland.
-#
-# See the `africa' file for time zone naming and abbreviation conventions.
 
 # Canada
 
index 883ccdca6978bb0e941fd1b3f4912905c23d34e9..86dd68834113434ba9e4e6d3dbabf233f881cbaf 100644 (file)
@@ -1,4 +1,4 @@
-# @(#)pacificnew       7.9
+# @(#)pacificnew       7.10
 
 # From Arthur David Olson (1989-04-05):
 # On 1989-04-05, the U. S. House of Representatives passed (238-154) a bill
index 09e0aa6d28af6c2c3b558d1b916529b48b32912e..4f8cb906d93ce60b0371763b6f474720b2a4c247 100644 (file)
@@ -1,4 +1,4 @@
-# @(#)southamerica     7.18
+# @(#)southamerica     7.21
 
 # This data is by no means authoritative; if you think you know better,
 # go ahead and edit the file (and please send any changes to
@@ -28,7 +28,6 @@
 #      -4:00   AST     ADT     Atlantic
 #      -5:00   AST     ADT     Acre
 #
-# See the `africa' file for time zone naming and abbreviation conventions.
 # Earlier editions of these tables used the North American style (e.g. ARST and
 # ARDT for Argentine Standard and Daylight Time), but the following quote
 # suggests that it's better to use European style (e.g. ART and ARST).
index a26fbbeefc5ff9e5d04fb709de928a734c0cc0af..90441cbbc374bd7c0169e64a9b4d01fe2041d83d 100644 (file)
@@ -21,7 +21,7 @@
 
 #ifndef lint
 #ifndef NOID
-static char    tzfilehid[] = "@(#)tzfile.h     7.9";
+static char    tzfilehid[] = "@(#)tzfile.h     7.13";
 #endif /* !defined NOID */
 #endif /* !defined lint */
 
@@ -45,8 +45,11 @@ static char  tzfilehid[] = "@(#)tzfile.h     7.9";
 ** Each file begins with. . .
 */
 
+#define        TZ_MAGIC        "TZif"
+
 struct tzhead {
-       char    tzh_reserved[20];       /* reserved for future use */
+       char    tzh_magic[4];           /* TZ_MAGIC */
+       char    tzh_reserved[16];       /* reserved for future use */
        char    tzh_ttisgmtcnt[4];      /* coded number of trans. time flags */
        char    tzh_ttisstdcnt[4];      /* coded number of trans. time flags */
        char    tzh_leapcnt[4];         /* coded number of leap seconds */
index c95887c9b4b945beee37829b929730b83e12aea0..2780e4c99629a0efdd926fca194115d75bd7039f 100644 (file)
@@ -1,6 +1,6 @@
 #ifndef lint
 #ifndef NOID
-static char    elsieid[] = "@(#)zic.c  7.87";
+static char    elsieid[] = "@(#)zic.c  7.91";
 #endif /* !defined NOID */
 #endif /* !defined lint */
 
@@ -1464,7 +1464,9 @@ const char * const        name;
        convert(eitol(timecnt), tzh.tzh_timecnt);
        convert(eitol(typecnt), tzh.tzh_typecnt);
        convert(eitol(charcnt), tzh.tzh_charcnt);
+       (void) strncpy(tzh.tzh_magic, TZ_MAGIC, sizeof tzh.tzh_magic);
 #define DO(field)      (void) fwrite((void *) tzh.field, (size_t) sizeof tzh.field, (size_t) 1, fp)
+       DO(tzh_magic);
        DO(tzh_reserved);
        DO(tzh_ttisgmtcnt);
        DO(tzh_ttisstdcnt);
index 4c8f9a4dcf7a54e23736d34eb6a71c240f244dac..4bba959387b2725ee2c9a3203faed2f739b0df90 100644 (file)
@@ -26,7 +26,9 @@
 
 #include <features.h>
 
-__BEGIN_DECLS
+/* Get FILE definition.  */
+#define __need_FILE
+#include <stdio.h>
 
 /* Get size_t, wchar_t, wint_t and NULL from <stddef.h>.  */
 #define __need_size_t
@@ -35,7 +37,6 @@ __BEGIN_DECLS
 #define __need_NULL
 #include <stddef.h>
 
-
 /* We try to get wint_t from <stddef.h>, but not all GCC versions define it
    there.  So define it ourselves if it remains undefined.  */
 #ifndef _WINT_T
@@ -65,6 +66,12 @@ typedef struct
 # define WEOF (0xffffffffu)
 #endif
 
+/* This incomplete type is defined in <time.h> but needed here because
+   of `wcsftime'.  */
+struct tm;
+
+
+__BEGIN_DECLS
 
 /* Copy SRC to DEST.  */
 extern wchar_t *wcscpy __P ((wchar_t *__restrict __dest,
@@ -283,17 +290,18 @@ extern size_t wmemrtombs __P ((char *__restrict __dst,
                               __const wchar_t **__restrict __src,
                               size_t __nwc, size_t len,
                               mbstate_t *__restrict __ps));
+#endif /* use GNU */
 
 
 /* The following functions are extensions found in X/Open CAE.  */
-
+#ifdef __USE_XOPEN
 /* Determine number of column positions required for C.  */
 extern int wcwidth __P ((wint_t __c));
 
 /* Determine number of column positions required for first N wide
    characters (or fewer if S ends before this) in S.  */
 extern int wcswidth __P ((__const wchar_t *__s, size_t __n));
-#endif /* use GNU */
+#endif /* Use X/Open.  */
 
 
 /* Convert initial portion of the wide string NPTR to `double'
@@ -494,6 +502,17 @@ extern wchar_t *wcpncpy __P ((wchar_t *__dest, __const wchar_t *__src,
 #endif /* use GNU */
 
 
+/* The X/Open standard demands that most of the functions defined in
+   the <wctype.h> header must also appear here.  This is probably
+   because some X/Open members wrote their implementation before the
+   ISO C standard was published and introduced the better solution.
+   We have to provide these definitions for compliance reasons but we
+   do this nonsense only if really necessary.  */
+#if defined __USE_UNIX98 && !defined __USE_GNU
+# define __need_iswxxx
+# include <wctype.h>
+#endif
+
 __END_DECLS
 
 #endif /* wchar.h  */
index 91e591dbb3343ca011a3ece75cec3eb9d5a03b8b..b0180fde55f7e44575fe236a7d419f5624dcf023 100644 (file)
@@ -23,7 +23,7 @@
 #include "cname-lookup.h"
 
 wint_t
-towctrans (wint_t wc, wctrans_t desc)
+__towctrans (wint_t wc, wctrans_t desc)
 {
   size_t idx;
 
@@ -34,3 +34,4 @@ towctrans (wint_t wc, wctrans_t desc)
 
   return (wint_t) desc[idx];
 }
+weak_alias (__towctrans, towctrans)
index ffa4b25808f63d7c687ccb3be8a11afebe3825a6..8ab8d7b79328a3152e126f95dca09e1dfb6dd68a 100644 (file)
  */
 
 #ifndef _WCTYPE_H
-#define _WCTYPE_H      1
 
-#include <features.h>
-#include <bits/types.h>
+#ifndef __need_iswxxx
+# define _WCTYPE_H     1
 
-__BEGIN_DECLS
+# include <features.h>
+# include <bits/types.h>
 
 /* We try to get wint_t from <stddef.h>, but not all GCC versions define it
    there.  So define it ourselves if it remains undefined.  */
-#define __need_wint_t
-#include <stddef.h>
-#ifndef _WINT_T
+# define __need_wint_t
+# include <stddef.h>
+# ifndef _WINT_T
 /* Integral type unchanged by default argument promotions that can
    hold any value corresponding to members of the extended character
    set, as well as at least one value that does not correspond to any
    member of the extended character set.  */
-# define _WINT_T
+#  define _WINT_T
 typedef unsigned int wint_t;
+# endif
+
+/* Constant expression of type `wint_t' whose value does not correspond
+   to any member of the extended character set.  */
+# ifndef WEOF
+#  define WEOF (0xffffffffu)
+# endif
 #endif
+#undef __need_iswxxx
 
-/* Scalar type that can hold values which represent locale-specific
-   character mappings.  */
-typedef __const unsigned int *wctrans_t;
+
+/* The following part is also used in the <wcsmbs.h> header when compiled
+   in the Unix98 compatibility mode.  */
+#ifndef __iswxxx_defined
+# define __iswxxx_defined      1
 
 /* Scalar type that can hold values which represent locale-specific
    character classifications.  */
 typedef unsigned long int wctype_t;
 
-/* Constant expression of type `wint_t' whose value does not correspond
-   to any member of the extended character set.  */
-#ifndef WEOF
-# define WEOF (0xffffffffu)
-#endif
-
-#ifndef _ISbit
+# ifndef _ISbit
 /* The characteristics are stored always in network byte order (big
    endian).  We define the bit value interpretations here dependent on the
    machine's byte order.  */
 
-# include <endian.h>
-# if __BYTE_ORDER == __BIG_ENDIAN
-#  define _ISbit(bit)  (1 << bit)
-# else /* __BYTE_ORDER == __LITTLE_ENDIAN */
-#  define _ISbit(bit)  (bit < 8 ? ((1 << bit) << 8) : ((1 << bit) >> 8))
-# endif
+#  include <endian.h>
+#  if __BYTE_ORDER == __BIG_ENDIAN
+#   define _ISbit(bit) (1 << bit)
+#  else /* __BYTE_ORDER == __LITTLE_ENDIAN */
+#   define _ISbit(bit) (bit < 8 ? ((1 << bit) << 8) : ((1 << bit) >> 8))
+#  endif
 
 enum
 {
@@ -83,9 +87,11 @@ enum
   _ISpunct = _ISbit (10),      /* Punctuation.  */
   _ISalnum = _ISbit (11)       /* Alphanumeric.  */
 };
-#endif /* Not _ISbit  */
+# endif /* Not _ISbit  */
 
 
+__BEGIN_DECLS
+
 /*
  * Wide-character classification functions: 7.15.2.1.
  */
@@ -157,54 +163,72 @@ extern int iswctype __P ((wint_t __wc, wctype_t __desc));
  * Wide-character case-mapping functions: 7.15.3.1.
  */
 
+/* Scalar type that can hold values which represent locale-specific
+   character mappings.  */
+typedef __const __int32_t *wctrans_t;
+
 /* Converts an uppercase letter to the corresponding lowercase letter.  */
 extern wint_t towlower __P ((wint_t __wc));
 
 /* Converts an lowercase letter to the corresponding uppercase letter.  */
 extern wint_t towupper __P ((wint_t __wc));
 
-/*
- * Extensible wide-character mapping functions: 7.15.3.2.
- */
-
-/* Construct value that describes a mapping between wide characters
-   identified by the string argument PROPERTY.  */
-extern wctrans_t wctrans __P ((__const char *__property));
-
 /* Map the wide character WC using the mapping described by DESC.  */
-extern wint_t towctrans __P ((wint_t __wc, wctrans_t __desc));
+extern wint_t __towctrans __P ((wint_t __wc, wctrans_t __desc));
 
 
+# ifndef __NO_WCTYPE
+#  define iswalnum(wc) __iswctype ((wc), _ISalnum)
+#  define iswalpha(wc) __iswctype ((wc), _ISalpha)
+#  define iswcntrl(wc) __iswctype ((wc), _IScntrl)
+#  define iswdigit(wc) __iswctype ((wc), _ISdigit)
+#  define iswlower(wc) __iswctype ((wc), _ISlower)
+#  define iswgraph(wc) __iswctype ((wc), _ISgraph)
+#  define iswprint(wc) __iswctype ((wc), _ISprint)
+#  define iswpunct(wc) __iswctype ((wc), _ISpunct)
+#  define iswspace(wc) __iswctype ((wc), _ISspace)
+#  define iswupper(wc) __iswctype ((wc), _ISupper)
+#  define iswxdigit(wc)        __iswctype ((wc), _ISxdigit)
+
+#  ifdef __USE_GNU
+#   define iswblank(wc)        __iswctype ((wc), _ISblank)
+#  endif
 
-#ifndef        __NO_WCTYPE
-# define iswalnum(wc)  __iswctype ((wc), _ISalnum)
-# define iswalpha(wc)  __iswctype ((wc), _ISalpha)
-# define iswcntrl(wc)  __iswctype ((wc), _IScntrl)
-# define iswdigit(wc)  __iswctype ((wc), _ISdigit)
-# define iswlower(wc)  __iswctype ((wc), _ISlower)
-# define iswgraph(wc)  __iswctype ((wc), _ISgraph)
-# define iswprint(wc)  __iswctype ((wc), _ISprint)
-# define iswpunct(wc)  __iswctype ((wc), _ISpunct)
-# define iswspace(wc)  __iswctype ((wc), _ISspace)
-# define iswupper(wc)  __iswctype ((wc), _ISupper)
-# define iswxdigit(wc) __iswctype ((wc), _ISxdigit)
-
-# ifdef        __USE_GNU
-#  define iswblank(wc) __iswctype ((wc), _ISblank)
-# endif
 
 /* Pointer to conversion tables.  */
 extern __const __int32_t *__ctype_tolower; /* Case conversions.  */
 extern __const __int32_t *__ctype_toupper; /* Case conversions.  */
 
-# define towlower(wc)  towctrans ((wc), __ctype_tolower)
-# define towupper(wc)  towctrans ((wc), __ctype_toupper)
+#  define towlower(wc) __towctrans ((wc), __ctype_tolower)
+#  define towupper(wc) __towctrans ((wc), __ctype_toupper)
+
+# endif /* Not __NO_WCTYPE.  */
+
+__END_DECLS
+
+#endif /* need iswxxx.  */
+
 
-#endif /* Not __NO_WCTYPE.  */
+/* The remaining definitions and declarations must not appear in the
+   <wcsmbs.h> header.  */
+#ifdef _WCTYPE_H
 
-#ifdef __USE_GNU
+/*
+ * Extensible wide-character mapping functions: 7.15.3.2.
+ */
+
+__BEGIN_DECLS
+
+/* Construct value that describes a mapping between wide characters
+   identified by the string argument PROPERTY.  */
+extern wctrans_t wctrans __P ((__const char *__property));
+
+/* Map the wide character WC using the mapping described by DESC.  */
+extern wint_t towctrans __P ((wint_t __wc, wctrans_t __desc));
+
+# ifdef __USE_GNU
 /* Declare the interface to extended locale model.  */
-# include <xlocale.h>
+#  include <xlocale.h>
 
 /* Test for any wide character for which `iswalpha' or `iswdigit' is
    true.  */
@@ -282,30 +306,32 @@ extern wint_t __towctrans_l __P ((wint_t __wc, wctrans_t __desc,
                                  __locale_t __locale));
 
 
-# ifndef __NO_WCTYPE
-#  define __iswalnum_l(wc, loc)         __iswctype_l ((wc), _ISalnum, (loc))
-#  define __iswalpha_l(wc, loc)         __iswctype_l ((wc), _ISalpha, (loc))
-#  define __iswcntrl_l(wc, loc)         __iswctype_l ((wc), _IScntrl, (loc))
-#  define __iswdigit_l(wc, loc)         __iswctype_l ((wc), _ISdigit, (loc))
-#  define __iswlower_l(wc, loc)         __iswctype_l ((wc), _ISlower, (loc))
-#  define __iswgraph_l(wc, loc)         __iswctype_l ((wc), _ISgraph, (loc))
-#  define __iswprint_l(wc, loc)         __iswctype_l ((wc), _ISprint, (loc))
-#  define __iswpunct_l(wc, loc)         __iswctype_l ((wc), _ISpunct, (loc))
-#  define __iswspace_l(wc, loc)         __iswctype_l ((wc), _ISspace, (loc))
-#  define __iswupper_l(wc, loc)         __iswctype_l ((wc), _ISupper, (loc))
-#  define __iswxdigit_l(wc, loc) __iswctype_l ((wc), _ISxdigit, (loc))
-
-#  define __iswblank_l(wc, loc)         __iswctype_l ((wc), _ISblank, (loc))
-
-#  define __towlower_l(wc, loc)         __towctrans_l ((wc), (loc)->__ctype_tolower, \
+#  ifndef __NO_WCTYPE
+#   define __iswalnum_l(wc, loc) __iswctype_l ((wc), _ISalnum, (loc))
+#   define __iswalpha_l(wc, loc) __iswctype_l ((wc), _ISalpha, (loc))
+#   define __iswcntrl_l(wc, loc) __iswctype_l ((wc), _IScntrl, (loc))
+#   define __iswdigit_l(wc, loc) __iswctype_l ((wc), _ISdigit, (loc))
+#   define __iswlower_l(wc, loc) __iswctype_l ((wc), _ISlower, (loc))
+#   define __iswgraph_l(wc, loc) __iswctype_l ((wc), _ISgraph, (loc))
+#   define __iswprint_l(wc, loc) __iswctype_l ((wc), _ISprint, (loc))
+#   define __iswpunct_l(wc, loc) __iswctype_l ((wc), _ISpunct, (loc))
+#   define __iswspace_l(wc, loc) __iswctype_l ((wc), _ISspace, (loc))
+#   define __iswupper_l(wc, loc) __iswctype_l ((wc), _ISupper, (loc))
+#   define __iswxdigit_l(wc, loc) __iswctype_l ((wc), _ISxdigit, (loc))
+
+#   define __iswblank_l(wc, loc) __iswctype_l ((wc), _ISblank, (loc))
+
+#   define __towlower_l(wc, loc) __towctrans_l ((wc), (loc)->__ctype_tolower, \
                                                (loc))
-#  define __towupper_l(wc, loc)         __towctrans_l ((wc), (loc)->__ctype_toupper, \
+#   define __towupper_l(wc, loc) __towctrans_l ((wc), (loc)->__ctype_toupper, \
                                                (loc))
 
-# endif /* Not __NO_WCTYPE.  */
+#  endif /* Not __NO_WCTYPE.  */
 
-#endif /* Use GNU.  */
+# endif /* Use GNU.  */
 
 __END_DECLS
 
+#endif /* __WCTYPE_H defined.  */
+
 #endif /* wctype.h  */