about summary refs log tree commit diff
path: root/sysdeps/unix/sysv/linux
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>1997-03-16 20:28:07 +0000
committerUlrich Drepper <drepper@redhat.com>1997-03-16 20:28:07 +0000
commit0d8733c4fc3695c7987548d10c344445f3eb552d (patch)
tree4a2fe41c465963794a6f9d4d1717494972336e14 /sysdeps/unix/sysv/linux
parent1ed4222e5724ce863a95c15eb530dfab7ef0451c (diff)
downloadglibc-0d8733c4fc3695c7987548d10c344445f3eb552d.tar.gz
glibc-0d8733c4fc3695c7987548d10c344445f3eb552d.tar.xz
glibc-0d8733c4fc3695c7987548d10c344445f3eb552d.zip
1997-03-16 18:43  Ulrich Drepper  <drepper@cygnus.com>

	* manual/filesys.texi: Add documentation for scandir and alphasort.

	* math/math.c (fpclassify): Correct stupid typos.

	* math/libm-test.c: New file.  libm test suite by Andreas Jaeger.

	* nss/nss_files/files-hosts.c: Add gethostbyname2 imlementation.

	* posix/Makefile (routines): Add bsd-getpgrp.
	* posix/bsd-getpgrp.c: New file.
	* posix/unistd.h [__FAVOR_BSD]: Define macro getpgrp which maps
	calls to __bsd_getpgrp.

	* sysdeps/generic/getpgrp.c: De-ANSI-declfy.

	* sysdeps/i386/huge_val.h: New file.  ix87 specific infinity values.
	* sysdeps/m68k/huge_val.h: New file.  m68k specific infinity values.
	* sysdeps/generic/huge_val.h: Remove definition of long double
	definition.  Make it the same as the double definition.

	* sysdeps/libm-i387/e_acos.S: Fix bug in FPU stack handling.
	* sysdeps/libm-i387/e_acosf.S: Likewise.
	* sysdeps/libm-i387/e_acosl.S: Likewise.
	* sysdeps/libm-i387/e_asin.S: Likewise.
	* sysdeps/libm-i387/e_asinf.S: Likewise.
	* sysdeps/libm-i387/e_asinl.S: Likewise.
	* sysdeps/libm-i387/e_exp.S: Likewise.
	* sysdeps/libm-i387/e_expf.S: Likewise.
	* sysdeps/libm-i387/e_expl.S: Likewise.
	* sysdeps/libm-i387/e_scalbn.S: Likewise.
	* sysdeps/libm-i387/e_scalbnf.S: Likewise.
	* sysdeps/libm-i387/e_scalbnl.S: Likewise.

	* sysdeps/libm-i387/e_log.S: Optimize branch code.
	* sysdeps/libm-i387/e_logf.S: Likewise.
	* sysdeps/libm-i387/e_logl.S: Likewise.
	* sysdeps/libm-i387/e_log10.S: Likewise.
	* sysdeps/libm-i387/e_log10f.S: Likewise.
	* sysdeps/libm-i387/e_log10l.S: Likewise.

	* sysdeps/libm-i387/e_pow.S: Major rewrite to handle special cases.
	* sysdeps/libm-i387/e_powf.S: Likewise.
	* sysdeps/libm-i387/e_powl.S: Likewise.

	* sysdeps/libm-i387/e_expm1.S: Change return value for -inf
	argument to -1.0.
	* sysdeps/libm-i387/e_expm1f.S: Likewise.
	* sysdeps/libm-i387/e_expm1l.S: Likewise.

	* sysdeps/libm-i387/e_isinfl.c: Return -1 for -inf.

	* sysdeps/libm-i387/e_logbl.S: Correct return value.  Discard first
	stack element after fxtract.

	* sysdeps/libm-ieee754/e_atan2l.c: New file.  `long double'
	implementation for atan2 function.

	* sysdeps/libm-ieee754/k_standard.c: Return NAN for libm not in
	_SVID_ mode when acos, asin, atan2, log, log10 is called with
	argument out of range.
	Add new error case for pow(+0,neg).

	* sysdeps/libm-ieee754/s_fpclassifyf.c: Correct recognition of
	NaN and +-inf.
	* sysdeps/libm-ieee754/s_fpclassifyl.c: Mask out explicit leading
	digit in stupid 80 bit formats.

	* sysdeps/libm-ieee754/s_isinf.c: Rewrite to return -1 for -inf.
	* sysdeps/libm-ieee754/s_isinff.c: Likewise.
	* sysdeps/libm-ieee754/s_isinfl.c: Likewise.

	* sysdeps/libm-ieee754/s_scalbnl.c (huge, tiny): Adapt values for
	long double type.

	* sysdeps/libm-ieee754/w_atan2.c: Do not raise exception expect when
	in SVID mode.
	* sysdeps/libm-ieee754/w_atan2f.c: Likewise.
	* sysdeps/libm-ieee754/w_atan2l.c: Likewise.

	* sysdeps/libm-ieee754/w_pow.c: Distinguish error cases for x is +0
	or -0.

	* sysdeps/posix/isfdtype.c: Add cast to prevent warning.

	* sysdeps/stub/fcntlbits.h: Update copyright.
	* sysdeps/unix/bsd/fcntlbits.h: Likewise.
	* sysdeps/unix/bsd/bsd4.4/fcntlbits.h: Likewise.
	* sysdeps/unix/bsd/sun/sunos4/fcntlbits.h: Likewise.
	* sysdeps/unix/bsd/ultrix4/fcntlbits.h: Likewise.
	* sysdeps/unix/common/fcntlbits.h: Likewise.
	* sysdeps/unix/sysv/fcntlbits.h: Likewise.  Define O_FSYNC as alias
	of O_SYNC.  Add BSD compatibility macros FAPPEND, FFSYNC, FNONBLOCK,
	and FNDELAY.
	* sysdeps/unix/sysv/irix4/fcntlbits.h: Likewise.

	* sysdeps/unix/readdir_r.c: Don't copy whole `struct dirent' record,
	only reclen bytes.

	* sysdeps/unix/sysv/linux/fcntlbits.h [__USE_GNU]: Add O_READ, O_WRITE
	and O_NORW.
	* sysdeps/unix/sysv/linux/alpha/fcntlbits.h: Likewise.

	* sysdeps/unix/sysv/linux/init-first.h: Add copyright.

	* sysdeps/unix/sysv/linux/fxstat.c: New file.  Rewrite kernel-level
	struct stat to user-level form.
	* sysdeps/unix/sysv/linux/lxstat: New file.
	* sysdeps/unix/sysv/linux/xstat: New file.
	* sysdeps/unix/sysv/linux/kernel_stat.h: Define struct stat used in
	kernel.
	* sysdeps/unix/sysv/linux/statbuf.h (struct stat): Change definition
	to use prescribed types for elements.
	(_STAT_VER): Change to value 3.
	* sysdeps/unix/sysv/linux/alph/statbuf.h: Likewise.
	* sysdeps/unix/sysv/linux/Dist: Add kernel_stat.h.
	* sysdeps/unix/sysv/linux/alpha/Dist: Likewise.

	* time/Makefile: Correct dependencies for test-tz.

1997-03-16 14:59  Philip Blundell  <phil@london.uk.eu.org>

	* resolv/netdb.h: Add prototypes for gai_strerror and getnameinfo
	(needed for IPv6 basic sockets API).

1997-03-16 15:02  a sun  <asun@zoology.washington.edu>

	* sysdeps/unix/sysv/linux/net/if_ppp.h: Don't use incompatible
	kernel header.
	* sysdeps/unix/sysv/linux/net/ppp_defs.h: Likewise.

1997-03-14 17:15  Ulrich Drepper  <drepper@cygnus.com>

	* db/hash/hash_bigkey.c (__big_delete): Don't call __free_ovflpage
	without testing for last_bfp to be NULL.
	Reported by fabsoft@fabserver1.zarm.uni-bremen.de.

1997-03-13 11:42  Jim Meyering  <meyering@asic.sc.ti.com>

	* time/mktime.c (TIME_T_MIN): Work around a bug in Cray C 5.0.3.0.

1997-03-14 04:00  Kurt Garloff  <garloff@kg1.ping.de>

	* sysdeps/unix/sysv/linux/fcntlbits.h (O_FSYNC): Make alias for O_SYNC.
	(FASYNC): Move to __USE_BSD section.  Create new macro O_ASYNC.

1997-03-14 02:50  Ulrich Drepper  <drepper@cygnus.com>

	* nis/nss_nis/nis-hosts.c (_nss_nis_gethostbyname2_r): New
	functions.  Compare result for correct address type.
	(_nss_nis_gethostbyname_r): Use _nss_nis_gethostbyname2_r.
	Reported by Mirko Streckenbach <mirko@marian.hil.de>.

1997-02-17 01:40  Zlatko Calusic  <zcalusic@srce.hr>

	* time/strptime.c (recursive): Return rp to caller.
	(strptime_internal): First check for long names, then abbreviated
	(month & weekday).

1997-03-10 19:44  Andreas Schwab  <schwab@issan.informatik.uni-dortmund.de>

	* Makeconfig: Remove useless definitions of ASFLAGS-%.
	* config.make.in (ASFLAGS-.so): Remove.
	* configure.in: Don't substitute ASFLAGS_SO.
	* sysdeps/sparc/configure.in: Remove file.
	* sysdeps/sparc/Makefile (ASFLAGS-.so): Define.

1997-03-11 17:00  Andreas Schwab  <schwab@issan.informatik.uni-dortmund.de>

	* time/strptime.c (strptime_internal) [case 'Y']: Always subtract
	1900 from year, regardless of century.

1997-03-12 05:43  Ulrich Drepper  <drepper@cygnus.com>

	* stdlib/strtod.c (_tens_in_limb) [BITS_PER_MP_LIMB > 32]: Make
	all numbers unsigned to make buggy gccs happy.
	Patch by Bryan W. Headley <bheadley@interaccess.com>.

	* sysdeps/unix/sysv/linux/netinet/ip.h: Add backward-compatibility
	definitions.  Patch by a sun <asun@zoology.washington.edu>.
	Pretty print header.

	* Makerules (build-shlib): Also create symlink if library is versioned.
	based on a patch by H.J. Lu <hjl@gnu.ai.mit.edu>.
	Remove special rule to libc.so symlink.

1997-03-11 20:16  Andreas Jaeger  <aj@arthur.pfalz.de>

	* manual/math.texi (Domain and Range Errors): Change descriptions
	according to recent changes for ISO C 9X.

1997-03-11 22:39  Ulrich Drepper  <drepper@cygnus.com>

	* sysdeps/libm-ieee754/k_standard.c (__kernel_standard): Correct
	return values for acos, asin, and atan2.
	Reported by Andreas Jaeger <aj@arthur.pfalz.de>.

1997-03-10 18:16 Thorsten Kukuk  <kukuk@vt.uni-paderborn.de>

	* ypclnt.c (__yp_bind): Fix possible buffer overflow.

1997-03-10 18:06  Bernd Schmidt  <crux@Pool.Informatik.RWTH-Aachen.DE>

	* dirent/alphasort.c (alphasort): Interpret arguments as pointers
	to pointers to directory entries so that alphasort really can be
	used as argument for scandir.

1997-03-09 23:33  Andreas Jaeger  <aj@arthur.pfalz.de>

	* string/strdup.c: Declare memcpy if !(_LIBC || STDC_HEADERS)
	instead of strcpy.

1997-03-10 03:34  Ulrich Drepper  <drepper@cygnus.com>

	* catgets/catgets.c (catopen): Always add NLSPATH to search path for
	catalogs, not only if the envvar NLSPATH is not available.
	Reported by Andries.Brouwer@cwi.nl.

1997-03-10 02:46  Ulrich Drepper  <drepper@cygnus.com>

	* Makeconfig (localtime-file): Don't define using installation
	directory.
	(inst_localtime-file): New variable.
	* time/Makefile (installed-localtime-file): Use inst_localtime-file.
	Reported by Edward Seidl <seidl@janed.com>.

1997-03-10 02:31  H.J. Lu  <hjl@gnu.ai.mit.edu>

	* time/Makefile: Add source files to dependencies for test data.

1997-03-09 22:53  Thorsten Kukuk  <kukuk@weber.uni-paderborn.de>

	* nis/nss_nis/nis-ethers.c: Don't ignore return value of yp_all.
	* nis/nss_nis/nis-proto.c: Likewise.
	* nis/nss_nis/nis-rpc.c: Likewise.
	* nis/nss_nis/nis-service.c: Likewise.

1997-03-08 14:37  Miguel de Icaza  <miguel@nuclecu.unam.mx>

	* sysdeps/sparc/dl-machine.h (elf_machine_rela): Upgrade to
	versioning;  Added missing R_SPARC_WDISP30 handling.
	(RTLD_START): Implement it.

	* sysdeps/unix/sysv/linux/sparc/brk.c: Fix.

	* sysdeps/unix/sysv/linux/sparc/start.c: Startup code for
	Linux/SPARC.

1997-03-02 18:06  Miguel de Icaza  <miguel@nuclecu.unam.mx>

	* sysdeps/sparc/dl-machine.h (RTLD_START): Make arg as expected by
	the dynamic linker instead of having a new conditional define.
	Thanks to Richard Henderson for pointing this out.
	* elf/rtld.c: Remove usage of ELF_ADJUST_ARG.

1997-03-20 20:44  Thomas Bushnell, n/BSG  <thomas@gnu.ai.mit.edu>

	* sysdeps/mach/hurd/euidaccess.c: Define as __euidaccess and make
	euidaccess weak alias.

1997-03-07 10:30  Thomas Bushnell, n/BSG  <thomas@gnu.ai.mit.edu>

	* stdio-common/printf_fphex.c (MIN): New macro.

	* sysdeps/generic/netinet/in.h: Include <sys/types.h>.

	* sysdeps/generic/sys/mman.h (msync): Mention third arg.

	* sysdeps/generic/netinet/in.h: Add definitions for IPv6 basic
	API.  (See change by Philip Blundell on Feb 16, 1997.)

1997-03-05 10:40  Thomas Bushnell, n/BSG  <thomas@gnu.ai.mit.edu>

	* hurd/hurd.h (vpprintf): Include <stdarg.h>.  New declaration.

	* hurd/set-host.c (_hurd_set_host_config): Cast second arg to
	__file_name_split.

	* mach/mach_error.c (mach_error_string_int): Give full prototype.
	* mach/errstring.c (mach_error_string_int): Likewise.
	* mach/error_compat.c (__mach_error_map_compat): Likewise.
	* hurd/vpprintf.c (pwrite, vpprintf): Likewise.
	* stdio/vasprintf.c (vasprintf): Likewise.

	* mach/mach/mach_traps.h: Include <mach/kern_return.h>.

	* mach/spin-solid.c: Include <mach/mach_traps.h>.
	* mach/spin-solid.c (__spin_lock_solid): Provide arg to
	swtch_pri.

	* mach/mach_init.c: Include <mach/mig_support.h>.

	* mach/mach_error.h (mach_error_string, mach_error,
	mach_error_type): Always provide prototypes.

	* mach/mach/error.h (mach_error_fn_t): Comment out declaration; it
	appears to be entirely unused dead code.

	* stdio/stdio.h (freopen): Fix spelling error.

1997-03-02 13:38  Miles Bader  <miles@gnu.ai.mit.edu>

	* string/argz.h (__need_error_t): New macro, before including <errno.h>
	[!__const] (__const): New macro.
	[!__error_t_defined] (error_t): New typedef.

	* sysdeps/generic/socketbits.h: Add PF_FILE as synonym for PF_LOCAL
	* sysdeps/unix/sysv/linux/socketbits.h: Likewise.
Diffstat (limited to 'sysdeps/unix/sysv/linux')
-rw-r--r--sysdeps/unix/sysv/linux/Dist1
-rw-r--r--sysdeps/unix/sysv/linux/alpha/Dist1
-rw-r--r--sysdeps/unix/sysv/linux/alpha/fcntlbits.h10
-rw-r--r--sysdeps/unix/sysv/linux/alpha/kernel_stat.h19
-rw-r--r--sysdeps/unix/sysv/linux/alpha/statbuf.h36
-rw-r--r--sysdeps/unix/sysv/linux/fcntlbits.h10
-rw-r--r--sysdeps/unix/sysv/linux/fxstat.c92
-rw-r--r--sysdeps/unix/sysv/linux/init-first.h21
-rw-r--r--sysdeps/unix/sysv/linux/kernel_stat.h31
-rw-r--r--sysdeps/unix/sysv/linux/lxstat.c92
-rw-r--r--sysdeps/unix/sysv/linux/net/if_ppp.h158
-rw-r--r--sysdeps/unix/sysv/linux/net/ppp_defs.h3
-rw-r--r--sysdeps/unix/sysv/linux/netinet/ip.h168
-rw-r--r--sysdeps/unix/sysv/linux/sparc/brk.c2
-rw-r--r--sysdeps/unix/sysv/linux/statbuf.h25
-rw-r--r--sysdeps/unix/sysv/linux/xstat.c92
16 files changed, 650 insertions, 111 deletions
diff --git a/sysdeps/unix/sysv/linux/Dist b/sysdeps/unix/sysv/linux/Dist
index 9c41e50b4c..7b94300c6a 100644
--- a/sysdeps/unix/sysv/linux/Dist
+++ b/sysdeps/unix/sysv/linux/Dist
@@ -1,6 +1,7 @@
 cmsg_nxthdr.c
 init-first.h
 kernel_sigaction.h
+kernel_stat.h
 llseek.c
 siglist.h
 sysctl.c
diff --git a/sysdeps/unix/sysv/linux/alpha/Dist b/sysdeps/unix/sysv/linux/alpha/Dist
index 344ffa55fb..80fca49a9b 100644
--- a/sysdeps/unix/sysv/linux/alpha/Dist
+++ b/sysdeps/unix/sysv/linux/alpha/Dist
@@ -4,6 +4,7 @@ ioperm.c
 init-first.h
 clone.S
 kernel_sigaction.h
+kernel_stat.h
 sys/io.h
 sys/acct.h
 sys/kernel_termios.h
diff --git a/sysdeps/unix/sysv/linux/alpha/fcntlbits.h b/sysdeps/unix/sysv/linux/alpha/fcntlbits.h
index e8697d9898..faf198393f 100644
--- a/sysdeps/unix/sysv/linux/alpha/fcntlbits.h
+++ b/sysdeps/unix/sysv/linux/alpha/fcntlbits.h
@@ -23,6 +23,12 @@
 #include <sys/types.h>
 
 
+/* In GNU, read and write are bits (unlike BSD).  */
+#ifdef __USE_GNU
+#define	O_READ		O_RDONLY /* Open for reading.  */
+#define O_WRITE		O_WRONLY /* Open for writing.  */
+#define O_NORW		0	/* Open without R/W access.  */
+#endif
 /* open/fcntl - O_SYNC is only implemented on blocks devices and on files
    located on an ext2 file system */
 #define O_ACCMODE	  0003
@@ -38,7 +44,8 @@
 #define O_APPEND	 00010
 #define O_NDELAY	O_NONBLOCK
 #define O_SYNC		040000
-#define FASYNC		020000	/* fcntl, for BSD compatibility */
+#define O_FSYNC		O_SYNC
+#define O_ASYNC		020000	/* fcntl, for BSD compatibility */
 
 #define F_DUPFD		0	/* dup */
 #define F_GETFD		1	/* get f_flags */
@@ -86,6 +93,7 @@ struct flock
 #ifdef	__USE_BSD
 #define	FAPPEND		O_APPEND
 #define	FFSYNC		O_FSYNC
+#define	FASYNC		O_ASYNC
 #define	FNONBLOCK	O_NONBLOCK
 #define	FNDELAY		O_NDELAY
 #endif /* Use BSD.  */
diff --git a/sysdeps/unix/sysv/linux/alpha/kernel_stat.h b/sysdeps/unix/sysv/linux/alpha/kernel_stat.h
new file mode 100644
index 0000000000..7109677269
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/alpha/kernel_stat.h
@@ -0,0 +1,19 @@
+/* Definition of `struct stat' used in the kernel..  */
+struct kernel_stat
+  {
+    unsigned int st_dev;
+    unsigned int st_ino;
+    unsigned int st_mode;
+    unsigned int st_nlink;
+    unsigned int st_uid;
+    unsigned int st_gid;
+    unsigned int st_rdev;
+    long int st_size;
+    unsigned long int st_atime;
+    unsigned long int st_mtime;
+    unsigned long int st_ctime;
+    unsigned int st_blksize;
+    int st_blocks;
+    unsigned int st_flags;
+    unsigned int st_gen;
+  };
diff --git a/sysdeps/unix/sysv/linux/alpha/statbuf.h b/sysdeps/unix/sysv/linux/alpha/statbuf.h
index 92c9df7404..207fa0ca1c 100644
--- a/sysdeps/unix/sysv/linux/alpha/statbuf.h
+++ b/sysdeps/unix/sysv/linux/alpha/statbuf.h
@@ -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
@@ -19,30 +19,30 @@
 #ifndef	_STATBUF_H
 #define	_STATBUF_H	1
 
-/* The Alpha has no additional syscall versions.  */
-
 /* Versions of the `struct stat' data structure.  */
-#define _STAT_VER		0
+#define _STAT_VER_LINUX_OLD	0
+#define _STAT_VER_LINUX		1
+#define _STAT_VER		_STAT_VER_LINUX
 
 /* Versions of the `xmknod' interface.  */
 #define _MKNOD_VER_LINUX	0
 
 struct stat
   {
-    unsigned int st_dev;		/* Device.  */
-    unsigned int st_ino;		/* File serial number.	*/
-    unsigned int st_mode;		/* File mode.  */
-    unsigned int st_nlink;		/* Link count.  */
-    unsigned int st_uid;		/* User ID of the file's owner.	*/
-    unsigned int st_gid;		/* Group ID of the file's group.*/
-    unsigned int st_rdev;		/* Device number, if device.  */
-    long int st_size;			/* Size of file, in bytes.  */
-    unsigned long int st_atime;		/* Time of last access.  */
-    unsigned long int st_mtime;		/* Time of last modification.  */
-    unsigned long int st_ctime;		/* Time of last status change.  */
-    unsigned int st_blksize;		/* Optimal block size for I/O.  */
-#define	_STATBUF_ST_BLKSIZE		/* Tell code we have this member.  */
-    int st_blocks;			/* Nr. of 512-byte blocks allocated.  */
+    __dev_t st_dev;		/* Device.  */
+    __ino_t st_ino;		/* File serial number.	*/
+    __mode_t st_mode;		/* File mode.  */
+    __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.*/
+    __dev_t st_rdev;		/* Device number, if device.  */
+    __off_t st_size;		/* Size of file, in bytes.  */
+    __time_t st_atime;		/* Time of last access.  */
+    __time_t st_mtime;		/* Time of last modification.  */
+    __time_t st_ctime;		/* Time of last status change.  */
+    unsigned int st_blksize;	/* Optimal block size for I/O.  */
+#define	_STATBUF_ST_BLKSIZE	/* Tell code we have this member.  */
+    int st_blocks;		/* Nr. of 512-byte blocks allocated.  */
     unsigned int st_flags;
     unsigned int st_gen;
   };
diff --git a/sysdeps/unix/sysv/linux/fcntlbits.h b/sysdeps/unix/sysv/linux/fcntlbits.h
index d7e889fc5e..fdc67ce4eb 100644
--- a/sysdeps/unix/sysv/linux/fcntlbits.h
+++ b/sysdeps/unix/sysv/linux/fcntlbits.h
@@ -23,6 +23,12 @@
 #include <sys/types.h>
 
 
+/* In GNU, read and write are bits (unlike BSD).  */
+#ifdef __USE_GNU
+#define	O_READ		O_RDONLY /* Open for reading.  */
+#define O_WRITE		O_WRONLY /* Open for writing.  */
+#define O_NORW		0	/* Open without R/W access.  */
+#endif
 /* open/fcntl - O_SYNC is only implemented on blocks devices and on files
    located on an ext2 file system */
 #define O_ACCMODE	  0003
@@ -37,7 +43,8 @@
 #define O_NONBLOCK	 04000
 #define O_NDELAY	O_NONBLOCK
 #define O_SYNC		010000
-#define FASYNC		020000	/* fcntl, for BSD compatibility */
+#define O_FSYNC		O_SYNC
+#define O_ASYNC		020000
 
 #define F_DUPFD		0	/* dup */
 #define F_GETFD		1	/* get f_flags */
@@ -85,6 +92,7 @@ struct flock
 #ifdef	__USE_BSD
 #define	FAPPEND		O_APPEND
 #define	FFSYNC		O_FSYNC
+#define	FASYNC		O_ASYNC
 #define	FNONBLOCK	O_NONBLOCK
 #define	FNDELAY		O_NDELAY
 #endif /* Use BSD.  */
diff --git a/sysdeps/unix/sysv/linux/fxstat.c b/sysdeps/unix/sysv/linux/fxstat.c
new file mode 100644
index 0000000000..103218711b
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/fxstat.c
@@ -0,0 +1,92 @@
+/* fxstat using old-style Unix fstat 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"
+
+extern int __syscall_fstat (int, struct kernel_stat *);
+
+/* Get information about the file descriptor FD in BUF.  */
+int
+__fxstat (int vers, int fd, struct stat *buf)
+{
+  struct kernel_stat kbuf;
+  int result;
+
+  switch (vers)
+    {
+    case _STAT_VER_LINUX_OLD:
+      /* Nothing to do.  The struct is in the form the kernel expects
+	 it to be.  */
+      result = __syscall_fstat (fd, (struct kernel_stat *) buf);
+      break;
+
+    case _STAT_VER_LINUX:
+      /* Do the system call.  */
+      result = __syscall_fstat (fd, &kbuf);
+
+      /* Convert to current kernel version of `struct stat'.  */
+      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;
+
+    default:
+      __set_errno (EINVAL);
+      result = -1;
+      break;
+    }
+
+  return result;
+}
+weak_alias (__fxstat, _fxstat)
diff --git a/sysdeps/unix/sysv/linux/init-first.h b/sysdeps/unix/sysv/linux/init-first.h
index dd4f85af9d..a9df8da52d 100644
--- a/sysdeps/unix/sysv/linux/init-first.h
+++ b/sysdeps/unix/sysv/linux/init-first.h
@@ -1,3 +1,22 @@
+/* Prepare arguments for library initialization function.
+   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.  */
+
 /* The job of this fragment it to find argc and friends for INIT.
    This is done in one of two ways: either in the stack context
    of program start, or having dlopen pass them in.  */
@@ -7,7 +26,7 @@ void NAME (void *arg)							      \
 {									      \
   int argc;								      \
   char **argv, **envp;							      \
-  /* The next variable is only here to work around a bug in gcc <= 2.7.2.1.   \
+  /* The next variable is only here to work around a bug in gcc <= 2.7.2.2.   \
      If the address would be taken inside the expression the optimizer	      \
      would try to be too smart and throws it away.  Grrr.  */		      \
   int *dummy_addr = &_dl_starting_up;					      \
diff --git a/sysdeps/unix/sysv/linux/kernel_stat.h b/sysdeps/unix/sysv/linux/kernel_stat.h
new file mode 100644
index 0000000000..bd7ddcc9bc
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/kernel_stat.h
@@ -0,0 +1,31 @@
+/* Definition of `struct stat' used in the kernel..  */
+struct kernel_stat
+  {
+    unsigned short int st_dev;
+    unsigned short int __pad1;
+#define _HAVE___PAD1
+    unsigned long int st_ino;
+    unsigned short int st_mode;
+    unsigned short int st_nlink;
+    unsigned short int st_uid;
+    unsigned short int st_gid;
+    unsigned short int st_rdev;
+    unsigned short int __pad2;
+#define _HAVE___PAD2
+    unsigned long int st_size;
+    unsigned long int st_blksize;
+    unsigned long int st_blocks;
+    unsigned long int st_atime;
+    unsigned long int __unused1;
+#define _HAVE___UNUSED1
+    unsigned long int st_mtime;
+    unsigned long int __unused2;
+#define _HAVE___UNUSED2
+    unsigned long int st_ctime;
+    unsigned long int __unused3;
+#define _HAVE___UNUSED3
+    unsigned long int __unused4;
+#define _HAVE___UNUSED4
+    unsigned long int __unused5;
+#define _HAVE___UNUSED5
+  };
diff --git a/sysdeps/unix/sysv/linux/lxstat.c b/sysdeps/unix/sysv/linux/lxstat.c
new file mode 100644
index 0000000000..713490cf66
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/lxstat.c
@@ -0,0 +1,92 @@
+/* lxstat using old-style Unix fstat 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"
+
+extern int __syscall_lstat (const char *, struct kernel_stat *);
+
+/* Get information about the file NAME in BUF.  */
+int
+__lxstat (int vers, const char *name, struct stat *buf)
+{
+  struct kernel_stat kbuf;
+  int result;
+
+  switch (vers)
+    {
+    case _STAT_VER_LINUX_OLD:
+      /* Nothing to do.  The struct is in the form the kernel expects
+	 it to be.  */
+      result = __syscall_lstat (name, (struct kernel_stat *) buf);
+      break;
+
+    case _STAT_VER_LINUX:
+      /* Do the system call.  */
+      result = __syscall_lstat (name, &kbuf);
+
+      /* Convert to current kernel version of `struct stat'.  */
+      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;
+
+    default:
+      __set_errno (EINVAL);
+      result = -1;
+      break;
+    }
+
+  return result;
+}
+weak_alias (__lxstat, _lxstat)
diff --git a/sysdeps/unix/sysv/linux/net/if_ppp.h b/sysdeps/unix/sysv/linux/net/if_ppp.h
index 27652546ae..567dccebe3 100644
--- a/sysdeps/unix/sysv/linux/net/if_ppp.h
+++ b/sysdeps/unix/sysv/linux/net/if_ppp.h
@@ -1 +1,157 @@
-#include <linux/if_ppp.h>
+/*	From: if_ppp.h,v 1.3 1995/06/12 11:36:50 paulus Exp */
+
+/*
+ * if_ppp.h - Point-to-Point Protocol definitions.
+ *
+ * Copyright (c) 1989 Carnegie Mellon University.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms are permitted
+ * provided that the above copyright notice and this paragraph are
+ * duplicated in all such forms and that any documentation,
+ * advertising materials, and other materials related to such
+ * distribution and use acknowledge that the software was developed
+ * by Carnegie Mellon University.  The name of the
+ * University may not be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
+ * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+ *
+ */
+
+/*
+ *  ==FILEVERSION 960926==
+ *
+ *  NOTE TO MAINTAINERS:
+ *     If you modify this file at all, please set the above date.
+ *     if_ppp.h is shipped with a PPP distribution as well as with the kernel;
+ *     if everyone increases the FILEVERSION number above, then scripts
+ *     can do the right thing when deciding whether to install a new if_ppp.h
+ *     file.  Don't change the format of that line otherwise, so the
+ *     installation script can recognize it.
+ */
+
+
+#ifndef __NET_IF_PPP_H
+#define __NET_IF_PPP_H 1
+
+#include <sys/types.h>
+#include <sys/cdefs.h>
+
+#include <net/if.h>
+#include <sys/ioctl.h>
+#include <net/ppp_defs.h>
+
+__BEGIN_DECLS
+
+/*
+ * Packet sizes
+ */
+
+#define	PPP_MTU		1500	/* Default MTU (size of Info field) */
+#define PPP_MAXMRU	65000	/* Largest MRU we allow */
+#define PPP_VERSION	"2.3.0"
+#define PPP_MAGIC	0x5002	/* Magic value for the ppp structure */
+#define PROTO_IPX	0x002b	/* protocol numbers */
+#define PROTO_DNA_RT    0x0027  /* DNA Routing */
+
+
+/*
+ * Bit definitions for flags.
+ */
+
+#define SC_COMP_PROT	0x00000001	/* protocol compression (output) */
+#define SC_COMP_AC	0x00000002	/* header compression (output) */
+#define	SC_COMP_TCP	0x00000004	/* TCP (VJ) compression (output) */
+#define SC_NO_TCP_CCID	0x00000008	/* disable VJ connection-id comp. */
+#define SC_REJ_COMP_AC	0x00000010	/* reject adrs/ctrl comp. on input */
+#define SC_REJ_COMP_TCP	0x00000020	/* reject TCP (VJ) comp. on input */
+#define SC_CCP_OPEN	0x00000040	/* Look at CCP packets */
+#define SC_CCP_UP	0x00000080	/* May send/recv compressed packets */
+#define SC_ENABLE_IP	0x00000100	/* IP packets may be exchanged */
+#define SC_COMP_RUN	0x00001000	/* compressor has been inited */
+#define SC_DECOMP_RUN	0x00002000	/* decompressor has been inited */
+#define SC_DEBUG	0x00010000	/* enable debug messages */
+#define SC_LOG_INPKT	0x00020000	/* log contents of good pkts recvd */
+#define SC_LOG_OUTPKT	0x00040000	/* log contents of pkts sent */
+#define SC_LOG_RAWIN	0x00080000	/* log all chars received */
+#define SC_LOG_FLUSH	0x00100000	/* log all chars flushed */
+#define	SC_MASK		0x0fE0ffff	/* bits that user can change */
+
+/* state bits */
+#define	SC_ESCAPED	0x80000000	/* saw a PPP_ESCAPE */
+#define	SC_FLUSH	0x40000000	/* flush input until next PPP_FLAG */
+#define SC_VJ_RESET	0x20000000	/* Need to reset the VJ decompressor */
+#define SC_XMIT_BUSY	0x10000000	/* ppp_write_wakeup is active */
+#define SC_RCV_ODDP	0x08000000	/* have rcvd char with odd parity */
+#define SC_RCV_EVNP	0x04000000	/* have rcvd char with even parity */
+#define SC_RCV_B7_1	0x02000000	/* have rcvd char with bit 7 = 1 */
+#define SC_RCV_B7_0	0x01000000	/* have rcvd char with bit 7 = 0 */
+#define SC_DC_FERROR	0x00800000	/* fatal decomp error detected */
+#define SC_DC_ERROR	0x00400000	/* non-fatal decomp error detected */
+
+/*
+ * Ioctl definitions.
+ */
+
+struct npioctl {
+    int		protocol;	/* PPP protocol, e.g. PPP_IP */
+    enum NPmode	mode;
+};
+
+/* Structure describing a CCP configuration option, for PPPIOCSCOMPRESS */
+struct ppp_option_data {
+	u_int8_t  *ptr;
+	u_int32_t length;
+	int	  transmit;
+};
+
+struct ifpppstatsreq {
+  struct ifreq	   b;
+  struct ppp_stats stats;			/* statistic information */
+};
+
+struct ifpppcstatsreq {
+  struct ifreq		b;
+  struct ppp_comp_stats stats;
+};
+
+#define ifr__name       b.ifr_ifrn.ifrn_name
+#define stats_ptr       b.ifr_ifru.ifru_data
+
+/*
+ * Ioctl definitions.
+ */
+
+#define	PPPIOCGFLAGS	_IOR('t', 90, int)	/* get configuration flags */
+#define	PPPIOCSFLAGS	_IOW('t', 89, int)	/* set configuration flags */
+#define	PPPIOCGASYNCMAP	_IOR('t', 88, int)	/* get async map */
+#define	PPPIOCSASYNCMAP	_IOW('t', 87, int)	/* set async map */
+#define	PPPIOCGUNIT	_IOR('t', 86, int)	/* get ppp unit number */
+#define	PPPIOCGRASYNCMAP _IOR('t', 85, int)	/* get receive async map */
+#define	PPPIOCSRASYNCMAP _IOW('t', 84, int)	/* set receive async map */
+#define	PPPIOCGMRU	_IOR('t', 83, int)	/* get max receive unit */
+#define	PPPIOCSMRU	_IOW('t', 82, int)	/* set max receive unit */
+#define	PPPIOCSMAXCID	_IOW('t', 81, int)	/* set VJ max slot ID */
+#define PPPIOCGXASYNCMAP _IOR('t', 80, ext_accm) /* get extended ACCM */
+#define PPPIOCSXASYNCMAP _IOW('t', 79, ext_accm) /* set extended ACCM */
+#define PPPIOCXFERUNIT	_IO('t', 78)		/* transfer PPP unit */
+#define PPPIOCSCOMPRESS	_IOW('t', 77, struct ppp_option_data)
+#define PPPIOCGNPMODE	_IOWR('t', 76, struct npioctl) /* get NP mode */
+#define PPPIOCSNPMODE	_IOW('t', 75, struct npioctl)  /* set NP mode */
+#define PPPIOCGDEBUG	_IOR('t', 65, int)	/* Read debug level */
+#define PPPIOCSDEBUG	_IOW('t', 64, int)	/* Set debug level */
+#define PPPIOCGIDLE	_IOR('t', 63, struct ppp_idle) /* get idle time */
+
+#define SIOCGPPPSTATS   (SIOCDEVPRIVATE + 0)
+#define SIOCGPPPVER     (SIOCDEVPRIVATE + 1)  /* NEVER change this!! */
+#define SIOCGPPPCSTATS  (SIOCDEVPRIVATE + 2)
+
+#if !defined(ifr_mtu)
+#define ifr_mtu	ifr_ifru.ifru_metric
+#endif
+
+__END_DECLS
+
+#endif /* net/if_ppp.h */
diff --git a/sysdeps/unix/sysv/linux/net/ppp_defs.h b/sysdeps/unix/sysv/linux/net/ppp_defs.h
index dfd40e1825..5d613e0d0f 100644
--- a/sysdeps/unix/sysv/linux/net/ppp_defs.h
+++ b/sysdeps/unix/sysv/linux/net/ppp_defs.h
@@ -1,8 +1,7 @@
 #ifndef _NET_PPP_DEFS_H
 #define _NET_PPP_DEFS_H 1
 
-#include <sys/types.h>
-typedef u_int32_t __u32;
+#include <asm/types.h>
 #include <linux/ppp_defs.h>
 
 #endif /* net/ppp_defs.h */
diff --git a/sysdeps/unix/sysv/linux/netinet/ip.h b/sysdeps/unix/sysv/linux/netinet/ip.h
index c779db4e87..89c2b1d296 100644
--- a/sysdeps/unix/sysv/linux/netinet/ip.h
+++ b/sysdeps/unix/sysv/linux/netinet/ip.h
@@ -26,62 +26,65 @@
 
 __BEGIN_DECLS
 
-struct timestamp {
-	u_int8_t	len;
-	u_int8_t	ptr;
+struct timestamp
+  {
+    u_int8_t len;
+    u_int8_t ptr;
 #if __BYTE_ORDER == __LITTLE_ENDIAN
-	u_int8_t	flags:4,
-		overflow:4;
+    u_int8_t flags:4;
+    u_int8_t overflow:4;
 #elif __BYTE_ORDER == __BIG_ENDIAN
-	u_int8_t	overflow:4,
-		flags:4;
+    u_int8_t overflow:4;
+    u_int8_t flags:4;
 #else
 #error	"Please fix <bytesex.h>"
-#endif						
-	u_int32_t	data[9];
-};
-
-struct ip_options {
-  u_int32_t	faddr;		/* Saved first hop address */
-  u_int8_t	optlen;
-  u_int8_t srr;
-  u_int8_t rr;
-  u_int8_t ts;
-  u_int8_t is_setbyuser:1,	/* Set by setsockopt?			*/
-                is_data:1,	/* Options in __data, rather than skb	*/
-                is_strictroute:1, /* Strict source route		*/
-                srr_is_hit:1,	/* Packet destination addr was our one	*/
-                is_changed:1,	/* IP checksum more not valid		*/	
-                rr_needaddr:1,	/* Need to record addr of outgoing dev	*/
-                ts_needtime:1,	/* Need to record timestamp		*/
-                ts_needaddr:1;	/* Need to record addr of outgoing dev  */
-  u_int8_t router_alert;
-  u_int8_t __pad1;
-  u_int8_t __pad2;
-  u_int8_t __data[0];
-};
-
-struct iphdr {
+#endif
+    u_int32_t data[9];
+  };
+
+struct ip_options
+  {
+    u_int32_t faddr;		/* Saved first hop address */
+    u_int8_t optlen;
+    u_int8_t srr;
+    u_int8_t rr;
+    u_int8_t ts;
+    u_int8_t is_setbyuser:1;	/* Set by setsockopt?			*/
+    u_int8_t is_data:1;		/* Options in __data, rather than skb	*/
+    u_int8_t is_strictroute:1; /* Strict source route		*/
+    u_int8_t srr_is_hit:1;	/* Packet destination addr was our one	*/
+    u_int8_t is_changed:1;	/* IP checksum more not valid		*/
+    u_int8_t rr_needaddr:1;	/* Need to record addr of outgoing dev	*/
+    u_int8_t ts_needtime:1;	/* Need to record timestamp		*/
+    u_int8_t ts_needaddr:1;	/* Need to record addr of outgoing dev  */
+    u_int8_t router_alert;
+    u_int8_t __pad1;
+    u_int8_t __pad2;
+    u_int8_t __data[0];
+  };
+
+struct iphdr
+  {
 #if __BYTE_ORDER == __LITTLE_ENDIAN
-	u_int8_t	ihl:4,
-		version:4;
+    u_int8_t ihl:4;
+    u_int8_t version:4;
 #elif __BYTE_ORDER == __BIG_ENDIAN
-	u_int8_t	version:4,
-  		ihl:4;
+    u_int8_t	version:4;
+    u_int8_t ihl:4;
 #else
 #error	"Please fix <bytesex.h>"
 #endif
-	u_int8_t	tos;
-	u_int16_t	tot_len;
-	u_int16_t	id;
-	u_int16_t	frag_off;
-	u_int8_t	ttl;
-	u_int8_t	protocol;
-	u_int16_t	check;
-	u_int32_t	saddr;
-	u_int32_t	daddr;
-	/*The options start here. */
-};
+    u_int8_t tos;
+    u_int16_t tot_len;
+    u_int16_t id;
+    u_int16_t frag_off;
+    u_int8_t ttl;
+    u_int8_t protocol;
+    u_int16_t check;
+    u_int32_t saddr;
+    u_int32_t daddr;
+    /*The options start here. */
+  };
 
 #ifdef __USE_BSD
 /*
@@ -127,46 +130,48 @@ struct iphdr {
 /*
  * Structure of an internet header, naked of options.
  */
-struct ip {
+struct ip
+  {
 #if __BYTE_ORDER == __LITTLE_ENDIAN
-	u_int8_t  ip_hl:4,		/* header length */
-		  ip_v:4;		/* version */
+    u_int8_t ip_hl:4;			/* header length */
+    u_int8_t ip_v:4;			/* version */
 #endif
 #if __BYTE_ORDER == __BIG_ENDIAN
-	u_int8_t  ip_v:4,		/* version */
-		  ip_hl:4;		/* header length */
+    u_int8_t ip_v:4;			/* version */
+    u_int8_t ip_hl:4;			/* header length */
 #endif
-	u_int8_t  ip_tos;		/* type of service */
-	u_short ip_len;		/* total length */
-	u_short ip_id;		/* identification */
-	u_short ip_off;		/* fragment offset field */
+    u_int8_t ip_tos;			/* type of service */
+    u_short ip_len;			/* total length */
+    u_short ip_id;			/* identification */
+    u_short ip_off;			/* fragment offset field */
 #define	IP_RF 0x8000			/* reserved fragment flag */
 #define	IP_DF 0x4000			/* dont fragment flag */
 #define	IP_MF 0x2000			/* more fragments flag */
 #define	IP_OFFMASK 0x1fff		/* mask for fragmenting bits */
-	u_int8_t  ip_ttl;		/* time to live */
-	u_int8_t  ip_p;			/* protocol */
-	u_short ip_sum;		/* checksum */
-	struct	  in_addr ip_src, ip_dst; /* source and dest address */
-};
+    u_int8_t ip_ttl;			/* time to live */
+    u_int8_t ip_p;			/* protocol */
+    u_short ip_sum;			/* checksum */
+    struct in_addr ip_src, ip_dst;	/* source and dest address */
+  };
 
 /*
  * Time stamp option structure.
  */
-struct	ip_timestamp {
-	u_int8_t ipt_code;		/* IPOPT_TS */
-	u_int8_t ipt_len;		/* size of structure (variable) */
-	u_int8_t ipt_ptr;		/* index of current entry */
+struct ip_timestamp
+  {
+    u_int8_t ipt_code;			/* IPOPT_TS */
+    u_int8_t ipt_len;			/* size of structure (variable) */
+    u_int8_t ipt_ptr;			/* index of current entry */
 #if __BYTE_ORDER == __LITTLE_ENDIAN
-	u_int8_t ipt_flg:4,		/* flags, see below */
-		 ipt_oflw:4;		/* overflow counter */
+    u_int8_t ipt_flg:4,			/* flags, see below */
+    u_int8_t ipt_oflw:4;		/* overflow counter */
 #endif
 #if __BYTE_ORDER == __BIG_ENDIAN
-	u_int8_t ipt_oflw:4,		/* overflow counter */
-		 ipt_flg:4;		/* flags, see below */
+    u_int8_t ipt_oflw:4,		/* overflow counter */
+    u_int8_t ipt_flg:4;			/* flags, see below */
 #endif
-	u_int32_t data[9];
-};
+    u_int32_t data[9];
+  };
 #endif /* __USE_BSD */
 
 #define	IPVERSION	4               /* IP version number */
@@ -175,6 +180,8 @@ struct	ip_timestamp {
 /*
  * Definitions for IP type of service (ip_tos)
  */
+#define	IPTOS_TOS_MASK		0x1E
+#define	IPTOS_TOS(tos)		((tos) & IPTOS_TOS_MASK)
 #define	IPTOS_LOWDELAY		0x10
 #define	IPTOS_THROUGHPUT	0x08
 #define	IPTOS_RELIABILITY	0x04
@@ -184,6 +191,8 @@ struct	ip_timestamp {
 /*
  * Definitions for IP precedence (also in ip_tos) (hopefully unused)
  */
+#define	IPTOS_PREC_MASK			0xe0
+#define	IPTOS_PREC(tos)                ((tos) & IPTOS_PREC_MASK)
 #define	IPTOS_PREC_NETCONTROL		0xe0
 #define	IPTOS_PREC_INTERNETCONTROL	0xc0
 #define	IPTOS_PREC_CRITIC_ECP		0xa0
@@ -196,24 +205,35 @@ struct	ip_timestamp {
 /*
  * Definitions for options.
  */
-#define	IPOPT_COPIED(o)		((o)&0x80)
-#define	IPOPT_CLASS(o)		((o)&0x60)
-#define	IPOPT_NUMBER(o)		((o)&0x1f)
+#define	IPOPT_COPY		0x80
+#define	IPOPT_CLASS_MASK	0x60
+#define	IPOPT_NUMBER_MASK	0x1f
+
+#define	IPOPT_COPIED(o)		((o) & IPOPT_COPY)
+#define	IPOPT_CLASS(o)		((o) & IPOPT_CLASS_MASK)
+#define	IPOPT_NUMBER(o)		((o) & IPOPT_NUMBER_MASK)
 
 #define	IPOPT_CONTROL		0x00
 #define	IPOPT_RESERVED1		0x20
 #define	IPOPT_DEBMEAS		0x40
+#define	IPOPT_MEASUREMENT       IPOPT_DEBMEAS
 #define	IPOPT_RESERVED2		0x60
 
 #define	IPOPT_EOL		0		/* end of option list */
+#define	IPOPT_END		IPOPT_EOL
 #define	IPOPT_NOP		1		/* no operation */
+#define	IPOPT_NOOP		IP_NOP
 
 #define	IPOPT_RR		7		/* record packet route */
 #define	IPOPT_TS		68		/* timestamp */
+#define	IPOPT_TIMESTAMP		IPOPT_TS
 #define	IPOPT_SECURITY		130		/* provide s,c,h,tcc */
+#define	IPOPT_SEC		IPOPT_SECURITY
 #define	IPOPT_LSRR		131		/* loose source route */
 #define	IPOPT_SATID		136		/* satnet id */
+#define	IPOPT_SID		IPOPT_SATID
 #define	IPOPT_SSRR		137		/* strict source route */
+#define	IPOPT_RA		148		/* router alert */
 
 /*
  * Offsets to fields in options other than EOL and NOP.
diff --git a/sysdeps/unix/sysv/linux/sparc/brk.c b/sysdeps/unix/sysv/linux/sparc/brk.c
index 13bcb0459b..8f079bf444 100644
--- a/sysdeps/unix/sysv/linux/sparc/brk.c
+++ b/sysdeps/unix/sysv/linux/sparc/brk.c
@@ -40,7 +40,7 @@ __brk (void *addr)
        "t 0x10\n\t"
        "mov %%o0, %0\n\t"
        : "=r" (newbrk)
-       : "0" (SYS_brk), "r" (addr)
+       : "0" (__NR_brk), "r" (addr)
        : "g1", "o0");
 
   __curbrk = newbrk;
diff --git a/sysdeps/unix/sysv/linux/statbuf.h b/sysdeps/unix/sysv/linux/statbuf.h
index 39bbdc9ece..15ffe637bc 100644
--- a/sysdeps/unix/sysv/linux/statbuf.h
+++ b/sysdeps/unix/sysv/linux/statbuf.h
@@ -20,8 +20,9 @@
 #define	_STATBUF_H	1
 
 /* Versions of the `struct stat' data structure.  */
-#define _STAT_VER_LINUX		1
+#define _STAT_VER_LINUX_OLD	1
 #define _STAT_VER_SVR4		2
+#define _STAT_VER_LINUX		3
 #define _STAT_VER		_STAT_VER_LINUX	/* The one defined below.  */
 
 /* Versions of the `xmknod' interface.  */
@@ -32,25 +33,25 @@
 
 struct stat
   {
-    unsigned short int st_dev;		/* Device.  */
+    __dev_t st_dev;			/* Device.  */
     unsigned short int __pad1;
-    unsigned long int st_ino;		/* File serial number.	*/
-    unsigned short int st_mode;		/* File mode.  */
-    unsigned short int st_nlink;	/* Link count.  */
-    unsigned short int st_uid;		/* User ID of the file's owner.	*/
-    unsigned short int st_gid;		/* Group ID of the file's group.*/
-    unsigned short int st_rdev;		/* Device number, if device.  */
+    __ino_t st_ino;			/* File serial number.	*/
+    __mode_t st_mode;			/* File mode.  */
+    __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.*/
+    __dev_t st_rdev;			/* Device number, if device.  */
     unsigned short int __pad2;
-    long int st_size;			/* Size of file, in bytes.  */
+    __off_t st_size;			/* Size of file, in bytes.  */
     unsigned long int st_blksize;	/* Optimal block size for I/O.  */
 #define	_STATBUF_ST_BLKSIZE		/* Tell code we have this member.  */
 
     unsigned long int st_blocks;	/* Number of 512-byte blocks allocated.  */
-    long int st_atime;			/* Time of last access.  */
+    __time_t st_atime;			/* Time of last access.  */
     unsigned long int __unused1;
-    long int st_mtime;			/* Time of last modification.  */
+    __time_t st_mtime;			/* Time of last modification.  */
     unsigned long int __unused2;
-    long int st_ctime;			/* Time of last status change.  */
+    __time_t st_ctime;			/* Time of last status change.  */
     unsigned long int __unused3;
     unsigned long int __unused4;
     unsigned long int __unused5;
diff --git a/sysdeps/unix/sysv/linux/xstat.c b/sysdeps/unix/sysv/linux/xstat.c
new file mode 100644
index 0000000000..be49b9d1de
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/xstat.c
@@ -0,0 +1,92 @@
+/* xstat using old-style Unix fstat 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"
+
+extern int __syscall_stat (const char *, struct kernel_stat *);
+
+/* Get information about the file NAME in BUF.  */
+int
+__xstat (int vers, const char *name, struct stat *buf)
+{
+  struct kernel_stat kbuf;
+  int result;
+
+  switch (vers)
+    {
+    case _STAT_VER_LINUX_OLD:
+      /* Nothing to do.  The struct is in the form the kernel expects
+	 it to be.  */
+      result = __syscall_stat (name, (struct kernel_stat *) buf);
+      break;
+
+    case _STAT_VER_LINUX:
+      /* Do the system call.  */
+      result = __syscall_stat (name, &kbuf);
+
+      /* Convert to current kernel version of `struct stat'.  */
+      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;
+
+    default:
+      __set_errno (EINVAL);
+      result = -1;
+      break;
+    }
+
+  return result;
+}
+weak_alias (__xstat, _xstat)