aboutsummaryrefslogtreecommitdiff
path: root/sysdeps/unix/sysv
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>1997-01-06 22:07:28 +0000
committerUlrich Drepper <drepper@redhat.com>1997-01-06 22:07:28 +0000
commitdf4ef2ab9c0899b2670067cd97e58f7eb2913e00 (patch)
tree4cb343b5ba9ccdc9c0b96144412567b6a4eda0ee /sysdeps/unix/sysv
parent6f9e7002f38ae778b3ff2f586a3e5766382228e9 (diff)
downloadglibc-df4ef2ab9c0899b2670067cd97e58f7eb2913e00.tar
glibc-df4ef2ab9c0899b2670067cd97e58f7eb2913e00.tar.gz
glibc-df4ef2ab9c0899b2670067cd97e58f7eb2913e00.tar.bz2
glibc-df4ef2ab9c0899b2670067cd97e58f7eb2913e00.zip
update from main archive 960105cvs/libc-970107cvs/libc-970106
Diffstat (limited to 'sysdeps/unix/sysv')
-rw-r--r--sysdeps/unix/sysv/getdents.c36
-rw-r--r--sysdeps/unix/sysv/i386/sigreturn.S28
-rw-r--r--sysdeps/unix/sysv/linux/Dist1
-rw-r--r--sysdeps/unix/sysv/linux/Makefile2
-rw-r--r--sysdeps/unix/sysv/linux/alpha/Dist2
-rw-r--r--sysdeps/unix/sysv/linux/alpha/gnu/types.h89
-rw-r--r--sysdeps/unix/sysv/linux/alpha/ioctl-types.h123
-rw-r--r--sysdeps/unix/sysv/linux/alpha/kernel_termios.h18
-rw-r--r--sysdeps/unix/sysv/linux/alpha/sys/acct.h66
-rw-r--r--sysdeps/unix/sysv/linux/alpha/termbits.h188
-rw-r--r--sysdeps/unix/sysv/linux/alpha/ustat.c32
-rw-r--r--sysdeps/unix/sysv/linux/alpha/xmknod.c46
-rw-r--r--sysdeps/unix/sysv/linux/direntry.h17
-rw-r--r--sysdeps/unix/sysv/linux/getdents.c105
-rw-r--r--sysdeps/unix/sysv/linux/gnu/types.h78
-rw-r--r--sysdeps/unix/sysv/linux/ioctl-types.h49
-rw-r--r--sysdeps/unix/sysv/linux/kernel_termios.h13
-rw-r--r--sysdeps/unix/sysv/linux/net/if.h147
-rw-r--r--sysdeps/unix/sysv/linux/netinet/in.h147
-rw-r--r--sysdeps/unix/sysv/linux/siglist.h84
-rw-r--r--sysdeps/unix/sysv/linux/sigset.h89
-rw-r--r--sysdeps/unix/sysv/linux/sigsuspend.c10
-rw-r--r--sysdeps/unix/sysv/linux/socketbits.h138
-rw-r--r--sysdeps/unix/sysv/linux/statfsbuf.h37
-rw-r--r--sysdeps/unix/sysv/linux/sys/acct.h35
-rw-r--r--sysdeps/unix/sysv/linux/sys/ptrace.h4
-rw-r--r--sysdeps/unix/sysv/linux/sys/syscall.h (renamed from sysdeps/unix/sysv/linux/syscall.h)0
-rw-r--r--sysdeps/unix/sysv/linux/sys/sysmacros.h11
-rw-r--r--sysdeps/unix/sysv/linux/syscalls.list4
-rw-r--r--sysdeps/unix/sysv/linux/tcgetattr.c56
-rw-r--r--sysdeps/unix/sysv/linux/tcsetattr.c73
-rw-r--r--sysdeps/unix/sysv/linux/termbits.h161
-rw-r--r--sysdeps/unix/sysv/linux/ustat.c32
-rw-r--r--sysdeps/unix/sysv/linux/ustatbits.h29
-rw-r--r--sysdeps/unix/sysv/linux/xmknod.c48
-rw-r--r--sysdeps/unix/sysv/sco3.2.4/sys/syscall.h (renamed from sysdeps/unix/sysv/sco3.2.4/syscall.h)0
36 files changed, 1818 insertions, 180 deletions
diff --git a/sysdeps/unix/sysv/getdents.c b/sysdeps/unix/sysv/getdents.c
index bb6c812647..109f29a2b1 100644
--- a/sysdeps/unix/sysv/getdents.c
+++ b/sysdeps/unix/sysv/getdents.c
@@ -1,22 +1,21 @@
-/* Copyright (C) 1993, 1995 Free Software Foundation, Inc.
-This file is part of the GNU C Library.
+/* Copyright (C) 1993, 1995, 1997 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
-The GNU C Library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Library General Public License as
-published by the Free Software Foundation; either version 2 of the
-License, or (at your option) any later version.
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public License as
+ published by the Free Software Foundation; either version 2 of the
+ License, or (at your option) any later version.
-The GNU C Library is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-Library General Public License for more details.
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
-You should have received a copy of the GNU Library General Public
-License along with the GNU C Library; see the file COPYING.LIB. If
-not, write to the Free Software Foundation, Inc., 675 Mass Ave,
-Cambridge, MA 02139, USA. */
+ You should have received a copy of the GNU Library General Public
+ License along with the GNU C Library; see the file COPYING.LIB. If not,
+ write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA. */
-#include <ansidecl.h>
#include <stddef.h>
#include <errno.h>
#include <sys/types.h>
@@ -25,8 +24,11 @@ Cambridge, MA 02139, USA. */
extern int __getdents __P ((int fd, char *buf, size_t nbytes));
int
-DEFUN(__getdirentries, (fd, buf, nbytes, basep),
- int fd AND char *buf AND size_t nbytes AND off_t *basep)
+__getdirentries (fd, buf, nbytes, basep)
+ int fd;
+ char *buf;
+ size_t nbytes;
+ off_t *basep;
{
if (basep)
*basep = __lseek (fd, (off_t) 0, SEEK_CUR);
diff --git a/sysdeps/unix/sysv/i386/sigreturn.S b/sysdeps/unix/sysv/i386/sigreturn.S
index be1c6b89bf..8477bbd075 100644
--- a/sysdeps/unix/sysv/i386/sigreturn.S
+++ b/sysdeps/unix/sysv/i386/sigreturn.S
@@ -1,20 +1,20 @@
-/* Copyright (C) 1994, 1995 Free Software Foundation, Inc.
-This file is part of the GNU C Library.
+/* Copyright (C) 1994, 1995, 1997 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
-The GNU C Library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Library General Public License as
-published by the Free Software Foundation; either version 2 of the
-License, or (at your option) any later version.
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public License as
+ published by the Free Software Foundation; either version 2 of the
+ License, or (at your option) any later version.
-The GNU C Library is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-Library General Public License for more details.
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
-You should have received a copy of the GNU Library General Public
-License along with the GNU C Library; see the file COPYING.LIB. If
-not, write to the Free Software Foundation, Inc., 675 Mass Ave,
-Cambridge, MA 02139, USA. */
+ You should have received a copy of the GNU Library General Public
+ License along with the GNU C Library; see the file COPYING.LIB. If not,
+ write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA. */
#include <sysdep.h>
diff --git a/sysdeps/unix/sysv/linux/Dist b/sysdeps/unix/sysv/linux/Dist
index 425fb589f7..766d96a110 100644
--- a/sysdeps/unix/sysv/linux/Dist
+++ b/sysdeps/unix/sysv/linux/Dist
@@ -1,4 +1,5 @@
init-first.h
+kernel_termios.h
llseek.c
siglist.h
sysctl.c
diff --git a/sysdeps/unix/sysv/linux/Makefile b/sysdeps/unix/sysv/linux/Makefile
index c03d966a61..97fb5f14a5 100644
--- a/sysdeps/unix/sysv/linux/Makefile
+++ b/sysdeps/unix/sysv/linux/Makefile
@@ -13,7 +13,7 @@ sysdep_headers += sys/mount.h sys/acct.h sys/sysctl.h sys/mtio.h \
sys/debugreg.h sys/kd.h sys/soundcard.h sys/vt.h
# Generate the list of SYS_* macros for the system calls (__NR_* macros).
-$(objpfx)syscall-%.h $(objpfx)syscall-%.d: ../sysdeps/unix/sysv/linux/syscall.h
+$(objpfx)syscall-%.h $(objpfx)syscall-%.d: ../sysdeps/unix/sysv/linux/sys/syscall.h
rm -f $(@:.h=.d)
echo > $(@:.d=.h).new \
'/* Generated at libc build time from kernel syscall list. */'
diff --git a/sysdeps/unix/sysv/linux/alpha/Dist b/sysdeps/unix/sysv/linux/alpha/Dist
index d898d041a2..a15f181ff6 100644
--- a/sysdeps/unix/sysv/linux/alpha/Dist
+++ b/sysdeps/unix/sysv/linux/alpha/Dist
@@ -4,3 +4,5 @@ ioperm.c
init-first.h
clone.S
sys/io.h
+kernel_termios.h
+sys/acct.h
diff --git a/sysdeps/unix/sysv/linux/alpha/gnu/types.h b/sysdeps/unix/sysv/linux/alpha/gnu/types.h
new file mode 100644
index 0000000000..5c1e407423
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/alpha/gnu/types.h
@@ -0,0 +1,89 @@
+/* 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. */
+
+#ifndef _GNU_TYPES_H
+#define _GNU_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 __quad_t *__qaddr_t;
+
+typedef __u_long __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_int __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 long int __ssize_t; /* Type of a byte count, or error. */
+
+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? */
+
+typedef long int __clock_t;
+
+/* One element in the file descriptor mask array. */
+typedef unsigned 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) (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;
+
+#endif /* gnu/types.h */
diff --git a/sysdeps/unix/sysv/linux/alpha/ioctl-types.h b/sysdeps/unix/sysv/linux/alpha/ioctl-types.h
new file mode 100644
index 0000000000..c51310f4cd
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/alpha/ioctl-types.h
@@ -0,0 +1,123 @@
+/* Structure types for pre-termios terminal ioctls. Linux version.
+ 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
+ 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 _IOCTL_TYPES_H
+#define _IOCTL_TYPES_H 1
+
+/* Get definition of constants for use with `ioctl'. */
+#include <asm/ioctl.h>
+
+
+#define FIOCLEX _IO('f', 1)
+#define FIONCLEX _IO('f', 2)
+#define FIOASYNC _IOW('f', 125, int)
+#define FIONBIO _IOW('f', 126, int)
+#define FIONREAD _IOR('f', 127, int)
+#define TIOCINQ FIONREAD
+
+#define TIOCGETP _IOR('t', 8, struct sgttyb)
+#define TIOCSETP _IOW('t', 9, struct sgttyb)
+#define TIOCSETN _IOW('t', 10, struct sgttyb) /* TIOCSETP wo flush */
+
+#define TIOCSETC _IOW('t', 17, struct tchars)
+#define TIOCGETC _IOR('t', 18, struct tchars)
+#define TCGETS _IOR('t', 19, struct termios)
+#define TCSETS _IOW('t', 20, struct termios)
+#define TCSETSW _IOW('t', 21, struct termios)
+#define TCSETSF _IOW('t', 22, struct termios)
+
+#define TCGETA _IOR('t', 23, struct termio)
+#define TCSETA _IOW('t', 24, struct termio)
+#define TCSETAW _IOW('t', 25, struct termio)
+#define TCSETAF _IOW('t', 28, struct termio)
+
+#define TCSBRK _IO('t', 29)
+#define TCXONC _IO('t', 30)
+#define TCFLSH _IO('t', 31)
+
+#define TIOCSWINSZ _IOW('t', 103, struct winsize)
+#define TIOCGWINSZ _IOR('t', 104, struct winsize)
+#define TIOCSTART _IO('t', 110) /* start output, like ^Q */
+#define TIOCSTOP _IO('t', 111) /* stop output, like ^S */
+#define TIOCOUTQ _IOR('t', 115, int) /* output queue size */
+
+#define TIOCGLTC _IOR('t', 116, struct ltchars)
+#define TIOCSLTC _IOW('t', 117, struct ltchars)
+#define TIOCSPGRP _IOW('t', 118, int)
+#define TIOCGPGRP _IOR('t', 119, int)
+
+#define TIOCEXCL 0x540C
+#define TIOCNXCL 0x540D
+#define TIOCSCTTY 0x540E
+
+#define TIOCSTI 0x5412
+#define TIOCMGET 0x5415
+#define TIOCMBIS 0x5416
+#define TIOCMBIC 0x5417
+#define TIOCMSET 0x5418
+# define TIOCM_LE 0x001
+# define TIOCM_DTR 0x002
+# define TIOCM_RTS 0x004
+# define TIOCM_ST 0x008
+# define TIOCM_SR 0x010
+# define TIOCM_CTS 0x020
+# define TIOCM_CAR 0x040
+# define TIOCM_RNG 0x080
+# define TIOCM_DSR 0x100
+# define TIOCM_CD TIOCM_CAR
+# define TIOCM_RI TIOCM_RNG
+
+#define TIOCGSOFTCAR 0x5419
+#define TIOCSSOFTCAR 0x541A
+#define TIOCLINUX 0x541C
+#define TIOCCONS 0x541D
+#define TIOCGSERIAL 0x541E
+#define TIOCSSERIAL 0x541F
+#define TIOCPKT 0x5420
+# define TIOCPKT_DATA 0
+# define TIOCPKT_FLUSHREAD 1
+# define TIOCPKT_FLUSHWRITE 2
+# define TIOCPKT_STOP 4
+# define TIOCPKT_START 8
+# define TIOCPKT_NOSTOP 16
+# define TIOCPKT_DOSTOP 32
+
+
+#define TIOCNOTTY 0x5422
+#define TIOCSETD 0x5423
+#define TIOCGETD 0x5424
+#define TCSBRKP 0x5425 /* Needed for POSIX tcsendbreak() */
+#define TIOCTTYGSTRUCT 0x5426 /* For debugging only */
+
+#define TIOCSERCONFIG 0x5453
+#define TIOCSERGWILD 0x5454
+#define TIOCSERSWILD 0x5455
+#define TIOCGLCKTRMIOS 0x5456
+#define TIOCSLCKTRMIOS 0x5457
+#define TIOCSERGSTRUCT 0x5458 /* For debugging only */
+#define TIOCSERGETLSR 0x5459 /* Get line status register */
+ /* ioctl (fd, TIOCSERGETLSR, &result) where result may be as below */
+# define TIOCSER_TEMT 0x01 /* Transmitter physically empty */
+#define TIOCSERGETMULTI 0x545A /* Get multiport config */
+#define TIOCSERSETMULTI 0x545B /* Set multiport config */
+
+#define TIOCMIWAIT 0x545C /* wait for a change on serial input line(s) */
+#define TIOCGICOUNT 0x545D /* read serial port inline interrupt counts */
+
+#endif /* ioctl-types.h */
diff --git a/sysdeps/unix/sysv/linux/alpha/kernel_termios.h b/sysdeps/unix/sysv/linux/alpha/kernel_termios.h
new file mode 100644
index 0000000000..cb030e4de4
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/alpha/kernel_termios.h
@@ -0,0 +1,18 @@
+/* The following corresponds to the values from the Linux 2.1.20 kernel. */
+
+#define KERNEL_NCCS 19
+
+struct kernel_termios
+ {
+ tcflag_t c_iflag; /* input mode flags */
+ tcflag_t c_oflag; /* output mode flags */
+ tcflag_t c_cflag; /* control mode flags */
+ tcflag_t c_lflag; /* local mode flags */
+ cc_t c_cc[KERNEL_NCCS]; /* control characters */
+ cc_t c_line; /* line discipline */
+ speed_t c_ispeed; /* input speed */
+ speed_t c_ospeed; /* output speed */
+ };
+
+#define _HAVE_C_ISPEED 1
+#define _HAVE_C_OSPEED 1
diff --git a/sysdeps/unix/sysv/linux/alpha/sys/acct.h b/sysdeps/unix/sysv/linux/alpha/sys/acct.h
new file mode 100644
index 0000000000..6dda5f4922
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/alpha/sys/acct.h
@@ -0,0 +1,66 @@
+/* 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
+ 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 _SYS_ACCT_H
+
+#define _SYS_ACCT_H 1
+#include <features.h>
+
+#define __need_time_t
+#include <time.h>
+
+
+__BEGIN_DECLS
+
+#define ACCT_COMM 16
+
+struct acct
+ {
+ char ac_comm[ACCT_COMM]; /* Accounting command name. */
+ time_t ac_utime; /* Accounting user time. */
+ time_t ac_stime; /* Accounting system time. */
+ time_t ac_etime; /* Accounting elapsed time. */
+ time_t ac_btime; /* Beginning time. */
+ unsigned int ac_uid; /* Accounting user ID. */
+ unsigned int ac_gid; /* Accounting group ID. */
+ unsigned int ac_tty; /* Controlling tty. */
+ /* Please note that the value of the `ac_tty' field, a device number,
+ is encoded differently in the kernel and for the libc dev_t type. */
+ char ac_flag; /* Accounting flag. */
+ long int ac_minflt; /* Accounting minor pagefaults. */
+ long int ac_majflt; /* Accounting major pagefaults. */
+ long int ac_exitcode; /* Accounting process exitcode. */
+ };
+
+enum
+ {
+ AFORK = 0001, /* Has executed fork, but no exec. */
+ ASU = 0002, /* Used super-user privileges. */
+ ACORE = 0004, /* Dumped core. */
+ AXSIG = 0010 /* Killed by a signal. */
+ };
+
+#define AHZ 100
+
+
+/* Switch process accounting on and off. */
+extern int acct __P ((__const char *__filename));
+
+__END_DECLS
+
+#endif /* sys/acct.h */
diff --git a/sysdeps/unix/sysv/linux/alpha/termbits.h b/sysdeps/unix/sysv/linux/alpha/termbits.h
new file mode 100644
index 0000000000..6cb729f7f8
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/alpha/termbits.h
@@ -0,0 +1,188 @@
+/* termios type and macro definitions. Linux version.
+ Copyright (C) 1993, 1994, 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. */
+
+typedef unsigned char cc_t;
+typedef unsigned int speed_t;
+typedef unsigned int tcflag_t;
+
+#define NCCS 32
+struct termios
+ {
+ tcflag_t c_iflag; /* input mode flags */
+ tcflag_t c_oflag; /* output mode flags */
+ tcflag_t c_cflag; /* control mode flags */
+ tcflag_t c_lflag; /* local mode flags */
+ cc_t c_cc[NCCS]; /* control characters */
+ cc_t c_line; /* line discipline (== c_cc[19]) */
+ speed_t c_ispeed; /* input speed */
+ speed_t c_ospeed; /* output speed */
+ };
+
+/* c_cc characters */
+#define VEOF 0
+#define VEOL 1
+#define VEOL2 2
+#define VERASE 3
+#define VWERASE 4
+#define VKILL 5
+#define VREPRINT 6
+#define VSWTC 7
+#define VINTR 8
+#define VQUIT 9
+#define VSUSP 10
+#define VSTART 12
+#define VSTOP 13
+#define VLNEXT 14
+#define VDISCARD 15
+#define VMIN 16
+#define VTIME 17
+
+/* c_iflag bits */
+#define IGNBRK 0000001
+#define BRKINT 0000002
+#define IGNPAR 0000004
+#define PARMRK 0000010
+#define INPCK 0000020
+#define ISTRIP 0000040
+#define INLCR 0000100
+#define IGNCR 0000200
+#define ICRNL 0000400
+#define IXON 0001000
+#define IXOFF 0002000
+#ifdef __USE_BSD
+ /* POSIX.1 doesn't want these... */
+# define IXANY 0004000
+# define IUCLC 0010000
+# define IMAXBEL 0020000
+#endif
+
+/* c_oflag bits */
+#define OPOST 0000001
+#define ONLCR 0000002
+#define OLCUC 0000004
+
+#define OCRNL 0000010
+#define ONOCR 0000020
+#define ONLRET 0000040
+
+#define OFILL 00000100
+#define OFDEL 00000200
+#define NLDLY 00001400
+#define NL0 00000000
+#define NL1 00000400
+#define NL2 00001000
+#define NL3 00001400
+#define TABDLY 00006000
+#define TAB0 00000000
+#define TAB1 00002000
+#define TAB2 00004000
+#define TAB3 00006000
+#define CRDLY 00030000
+#define CR0 00000000
+#define CR1 00010000
+#define CR2 00020000
+#define CR3 00030000
+#define FFDLY 00040000
+#define FF0 00000000
+#define FF1 00040000
+#define BSDLY 00100000
+#define BS0 00000000
+#define BS1 00100000
+#define VTDLY 00200000
+#define VT0 00000000
+#define VT1 00200000
+#define XTABS 01000000 /* Hmm.. Linux/i386 considers this part of TABDLY.. */
+
+/* c_cflag bit meaning */
+#define CBAUD 0000037
+#define B0 0000000 /* hang up */
+#define B50 0000001
+#define B75 0000002
+#define B110 0000003
+#define B134 0000004
+#define B150 0000005
+#define B200 0000006
+#define B300 0000007
+#define B600 0000010
+#define B1200 0000011
+#define B1800 0000012
+#define B2400 0000013
+#define B4800 0000014
+#define B9600 0000015
+#define B19200 0000016
+#define B38400 0000017
+#define EXTA B19200
+#define EXTB B38400
+#define CBAUDEX 0000000
+#define B57600 00020
+#define B115200 00021
+#define B230400 00022
+#define B460800 00023
+
+#define CSIZE 00001400
+#define CS5 00000000
+#define CS6 00000400
+#define CS7 00001000
+#define CS8 00001400
+
+#define CSTOPB 00002000
+#define CREAD 00004000
+#define PARENB 00010000
+#define PARODD 00020000
+#define HUPCL 00040000
+
+#define CLOCAL 00100000
+#define CRTSCTS 020000000000 /* flow control */
+
+/* c_lflag bits */
+#define ISIG 0x00000080
+#define ICANON 0x00000100
+#define XCASE 0x00004000
+#define ECHO 0x00000008
+#define ECHOE 0x00000002
+#define ECHOK 0x00000004
+#define ECHONL 0x00000010
+#define NOFLSH 0x80000000
+#define TOSTOP 0x00400000
+#define ECHOCTL 0x00000040
+#define ECHOPRT 0x00000020
+#define ECHOKE 0x00000001
+#define FLUSHO 0x00800000
+#define PENDIN 0x20000000
+#define IEXTEN 0x00000400
+
+/* Values for the ACTION argument to `tcflow'. */
+#define TCOOFF 0
+#define TCOON 1
+#define TCIOFF 2
+#define TCION 3
+
+/* Values for the QUEUE_SELECTOR argument to `tcflush'. */
+#define TCIFLUSH 0
+#define TCOFLUSH 1
+#define TCIOFLUSH 2
+
+/* Values for the OPTIONAL_ACTIONS argument to `tcsetattr'. */
+#define TCSANOW 0
+#define TCSADRAIN 1
+#define TCSAFLUSH 2
+
+
+#define _IOT_termios /* Hurd ioctl type field. */ \
+ _IOT (_IOTS (cflag_t), 4, _IOTS (cc_t), NCCS, _IOTS (speed_t), 2)
diff --git a/sysdeps/unix/sysv/linux/alpha/ustat.c b/sysdeps/unix/sysv/linux/alpha/ustat.c
new file mode 100644
index 0000000000..c09b4fd84e
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/alpha/ustat.c
@@ -0,0 +1,32 @@
+/* Copyright (C) 1997 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
+
+ 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/ustat.h>
+#include <sys/sysmacros.h>
+
+int
+ustat (dev_t dev, struct ustat *ubuf)
+{
+ unsigned int k_dev;
+
+ /* We must convert the value to dev_t type used by the kernel. */
+ k_dev = ((major (dev) & 0xff) << 8) | (minor (dev) & 0xff);
+
+ return __syscall_ustat (k_dev, ubuf);
+}
diff --git a/sysdeps/unix/sysv/linux/alpha/xmknod.c b/sysdeps/unix/sysv/linux/alpha/xmknod.c
new file mode 100644
index 0000000000..f4cdd7135a
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/alpha/xmknod.c
@@ -0,0 +1,46 @@
+/* xmknod call using old-style Unix mknod system call.
+ 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
+ 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 <sys/types.h>
+#include <sys/stat.h>
+
+extern int __syscall_mknod (const char *, unsigned int, unsigned int);
+
+/* Create a device file named PATH, with permission and special bits MODE
+ and device number DEV (which can be constructed from major and minor
+ device numbers with the `makedev' macro above). */
+int
+__xmknod (int vers, const char *path, mode_t mode, dev_t *dev)
+{
+ unsigned int k_dev;
+
+ if (vers != _MKNOD_VER)
+ {
+ __set_errno (EINVAL);
+ return -1;
+ }
+
+ /* We must convert the value to dev_t type used by the kernel. */
+ k_dev = ((major (*dev) & 0xff) << 8) | (minor (*dev) & 0xff);
+
+ return __syscall_mknod (path, mode, k_dev);
+}
+
+weak_alias (__xmknod, _xmknod)
diff --git a/sysdeps/unix/sysv/linux/direntry.h b/sysdeps/unix/sysv/linux/direntry.h
index 486ad0a0f2..ccf5080151 100644
--- a/sysdeps/unix/sysv/linux/direntry.h
+++ b/sysdeps/unix/sysv/linux/direntry.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,14 +19,19 @@
#ifndef _DIRENTRY_H
#define _DIRENTRY_H 1
-/* Get `struct dirent' from the Linux kernel header file. */
-#include <asm/posix_types.h>
-#include <linux/dirent.h>
-
-#define d_fileno d_ino /* backwards compatibility */
+struct dirent
+ {
+ long int d_ino;
+ __off_t d_off;
+ unsigned short int d_reclen;
+ unsigned char d_type;
+ char d_name[256]; /* We must not include limits.h! */
+ };
+#define d_fileno d_ino /* Backwards compatibility. */
#undef _DIRENT_HAVE_D_NAMLEN
#define _DIRENT_HAVE_D_RECLEN
#define _DIRENT_HAVE_D_OFF
+#define _DIRENT_HAVE_D_TYPE
#endif /* _DIRENTRY_H */
diff --git a/sysdeps/unix/sysv/linux/getdents.c b/sysdeps/unix/sysv/linux/getdents.c
new file mode 100644
index 0000000000..0504393e67
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/getdents.c
@@ -0,0 +1,105 @@
+/* Copyright (C) 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
+ 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 <dirent.h>
+#include <stddef.h>
+#include <string.h>
+#include <unistd.h>
+#include <sys/types.h>
+
+#include <linux/posix_types.h>
+
+#define offsetof(TYPE, MEMBER) ((size_t) &((TYPE *)0)->MEMBER)
+
+
+extern int __getdents __P ((int fd, char *buf, size_t nbytes));
+
+/* For Linux we need a special version of this file since the
+ definition of `struct dirent' is not the same for the kernel and
+ the libc. There is one additional field which might be introduced
+ in the kernel structure in the future.
+
+ He is the kernel definition of `struct dirent' as of 2.1.20: */
+
+struct kernel_dirent
+ {
+ long int d_ino;
+ __kernel_off_t d_off;
+ unsigned short int d_reclen;
+ char d_name[256];
+ };
+
+
+/* The problem here is that we cannot simply read the next NBYTES
+ bytes. We need to take the additional field into account. We use
+ some heuristic. Assume the directory contains names with at least
+ 3 characters we can compute a maximum number of entries which fit
+ in the buffer. Taking this number allows us to specify a correct
+ number of bytes to read. If we should be wrong, we can reset the
+ file descriptor. */
+int __getdirentries __P ((int fd, char *buf, size_t nbytes, off_t *basep));
+int
+__getdirentries (fd, buf, nbytes, basep)
+ int fd;
+ char *buf;
+ size_t nbytes;
+ off_t *basep;
+{
+ off_t base = __lseek (fd, (off_t) 0, SEEK_CUR);
+ size_t red_nbytes;
+ struct kernel_dirent *kdp;
+ struct dirent *dp;
+ int retval;
+
+ red_nbytes = nbytes - (nbytes / (offsetof (struct dirent, d_name) + 3));
+
+ dp = (struct dirent *) buf;
+ kdp = (struct kernel_dirent *) (buf + (nbytes - red_nbytes));
+
+ retval = __getdents (fd, (char *) kdp, red_nbytes);
+
+ while ((char *) kdp < buf + (nbytes - red_nbytes) + retval)
+ {
+ dp->d_ino = kdp->d_ino;
+ dp->d_off = kdp->d_off;
+ dp->d_reclen = (kdp->d_reclen
+ + (offsetof (struct dirent, d_name)
+ - offsetof (struct kernel_dirent, d_name)));
+ dp->d_type = DT_UNKNOWN;
+ memmove (dp->d_name, kdp->d_name,
+ kdp->d_reclen - offsetof (struct kernel_dirent, d_name));
+
+ dp = (struct dirent *) (((char *) dp) + dp->d_reclen);
+ kdp = (struct kernel_dirent *) (((char *) kdp) + kdp->d_reclen);
+
+ if ((char *) dp >= (char *) kdp)
+ {
+ /* Our heuristic failed. We read too many entries. Reset
+ the stream. */
+ off_t used = ((char *) kdp - (char *) buf) - (nbytes - red_nbytes);
+ base = __lseek (fd, retval - used, SEEK_CUR);
+ }
+ }
+
+ if (basep)
+ *basep = base;
+
+ return (char *) dp - (char *) buf;
+}
+
+weak_alias (__getdirentries, getdirentries)
diff --git a/sysdeps/unix/sysv/linux/gnu/types.h b/sysdeps/unix/sysv/linux/gnu/types.h
index 3212a85d96..872fc4e557 100644
--- a/sysdeps/unix/sysv/linux/gnu/types.h
+++ b/sysdeps/unix/sysv/linux/gnu/types.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991, 92, 94, 95, 96 Free Software Foundation, Inc.
+/* 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
@@ -21,9 +21,6 @@
#include <features.h>
-/* Get actual type definitions for architecture from kernel headers. */
-#include <linux/types.h>
-
/* Convenience types. */
typedef unsigned char __u_char;
typedef unsigned short __u_short;
@@ -32,46 +29,61 @@ typedef unsigned long __u_long;
#ifdef __GNUC__
typedef unsigned long long int __u_quad_t;
typedef long long int __quad_t;
-typedef __quad_t *__qaddr_t;
#else
typedef struct
-{
- long val[2];
-} __quad_t;
+ {
+ long int __val[2];
+ } __quad_t;
typedef struct
-{
- __u_long val[2];
-} __u_quad_t;
+ {
+ __u_long __val[2];
+ } __u_quad_t;
#endif
+typedef __quad_t *__qaddr_t;
-typedef __kernel_dev_t __dev_t; /* Type of device numbers. */
-typedef __kernel_uid_t __uid_t; /* Type of user identifications. */
-typedef __kernel_gid_t __gid_t; /* Type of group identifications. */
-typedef __kernel_ino_t __ino_t; /* Type of file serial numbers. */
-typedef __kernel_mode_t __mode_t; /* Type of file attribute bitmasks. */
-typedef __kernel_nlink_t __nlink_t; /* Type of file link counts. */
-typedef __kernel_off_t __off_t; /* Type of file sizes and offsets. */
-typedef __kernel_loff_t __loff_t; /* Type of file sizes and offsets. */
-typedef __kernel_pid_t __pid_t; /* Type of process identifications. */
-typedef __kernel_ssize_t __ssize_t; /* Type of a byte count, or error. */
-typedef __kernel_fsid_t __fsid_t; /* Type of file system IDs. */
+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 struct
+ {
+ int __val[2];
+ } __fsid_t; /* Type of file system IDs. */
/* Everythin' else. */
-typedef __kernel_daddr_t __daddr_t; /* The type of a disk address. */
-typedef __kernel_caddr_t __caddr_t;
-typedef __kernel_time_t __time_t;
+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? */
-/* fd_set for select. */
-typedef __kernel_fd_set __fd_set;
-typedef __kernel_clock_t __clock_t;
+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) (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;
-/* Linus doesn't want __kernel_fd_mask in <linux/posix_types.h> since
- XPG4 seems to require `unsigned long'. */
-typedef unsigned long __fd_mask;
-#ifdef __USE_SVID
typedef int __key_t;
-#endif
#endif /* gnu/types.h */
diff --git a/sysdeps/unix/sysv/linux/ioctl-types.h b/sysdeps/unix/sysv/linux/ioctl-types.h
index 510428ee7a..91fcc2653b 100644
--- a/sysdeps/unix/sysv/linux/ioctl-types.h
+++ b/sysdeps/unix/sysv/linux/ioctl-types.h
@@ -1,5 +1,5 @@
/* Structure types for pre-termios terminal ioctls. Linux version.
- 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
@@ -20,8 +20,51 @@
#ifndef _IOCTL_TYPES_H
#define _IOCTL_TYPES_H 1
-/* The Linux kernel header defines the types associated with old ioctls. */
+/* Get definition of constants for use with `ioctl'. */
+#include <asm/ioctls.h>
+
+
+struct winsize
+ {
+ unsigned short int ws_row;
+ unsigned short int ws_col;
+ unsigned short int ws_xpixel;
+ unsigned short int ws_ypixel;
+ };
+
+#define NCC 8
+struct termio
+ {
+ unsigned short int c_iflag; /* input mode flags */
+ unsigned short int c_oflag; /* output mode flags */
+ unsigned short int c_cflag; /* control mode flags */
+ unsigned short int c_lflag; /* local mode flags */
+ unsigned char c_line; /* line discipline */
+ unsigned char c_cc[NCC]; /* control characters */
+};
+
+/* modem lines */
+#define TIOCM_LE 0x001
+#define TIOCM_DTR 0x002
+#define TIOCM_RTS 0x004
+#define TIOCM_ST 0x008
+#define TIOCM_SR 0x010
+#define TIOCM_CTS 0x020
+#define TIOCM_CAR 0x040
+#define TIOCM_RNG 0x080
+#define TIOCM_DSR 0x100
+#define TIOCM_CD TIOCM_CAR
+#define TIOCM_RI TIOCM_RNG
+
+/* ioctl (fd, TIOCSERGETLSR, &result) where result may be as below */
+
+/* line disciplines */
+#define N_TTY 0
+#define N_SLIP 1
+#define N_MOUSE 2
+#define N_PPP 3
+#define N_STRIP 4
+#define N_AX25 5
-#include <asm/termios.h>
#endif /* ioctl-types.h */
diff --git a/sysdeps/unix/sysv/linux/kernel_termios.h b/sysdeps/unix/sysv/linux/kernel_termios.h
new file mode 100644
index 0000000000..3b2653b2cd
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/kernel_termios.h
@@ -0,0 +1,13 @@
+/* The following corresponds to the values from the Linux 2.1.20 kernel. */
+
+#define KERNEL_NCCS 19
+
+struct kernel_termios
+ {
+ tcflag_t c_iflag; /* input mode flags */
+ tcflag_t c_oflag; /* output mode flags */
+ tcflag_t c_cflag; /* control mode flags */
+ tcflag_t c_lflag; /* local mode flags */
+ cc_t c_line; /* line discipline */
+ cc_t c_cc[KERNEL_NCCS]; /* control characters */
+ };
diff --git a/sysdeps/unix/sysv/linux/net/if.h b/sysdeps/unix/sysv/linux/net/if.h
index 1aa8e7b90c..bf261175ec 100644
--- a/sysdeps/unix/sysv/linux/net/if.h
+++ b/sysdeps/unix/sysv/linux/net/if.h
@@ -1 +1,146 @@
-#include <linux/if.h>
+/* 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 _NET_IF_H
+
+#define _NET_IF_H 1
+#include <features.h>
+
+#include <sys/types.h>
+#include <sys/socket.h>
+
+/* Standard interface flags. */
+enum
+ {
+ IFF_UP = 0x1, /* Interface is up. */
+ IFF_BROADCAST = 0x2, /* Broadcast address valid. */
+ IFF_DEBUG = 0x4, /* Turn on debugging. */
+ IFF_LOOPBACK = 0x8, /* Is a loopback net. */
+ IFF_POINTOPOINT = 0x10, /* Interface is point-to-point link. */
+ IFF_NOTRAILERS = 0x20, /* Avoid use of trailers. */
+ IFF_RUNNING = 0x40, /* Resources allocated. */
+ IFF_NOARP = 0x80, /* No address resolution protocol. */
+ IFF_PROMISC = 0x100, /* Receive all packets. */
+ /* Not supported */
+ IFF_ALLMULTI = 0x200, /* Receive all multicast packets. */
+
+ IFF_MASTER = 0x400, /* Master of a load balancer. */
+ IFF_SLAVE = 0x800, /* Slave of a load balancer. */
+
+ IFF_MULTICAST = 0x1000 /* Supports multicast. */
+ };
+
+/* The ifaddr structure contains information about one address of an
+ interface. They are maintained by the different address families,
+ are allocated and attached when an address is set, and are linked
+ together so all addresses for an interface can be located. */
+
+struct ifaddr
+ {
+ struct sockaddr ifa_addr; /* Address of interface. */
+ union
+ {
+ struct sockaddr ifu_broadaddr;
+ struct sockaddr ifu_dstaddr;
+ } ifa_ifu;
+ struct iface *ifa_ifp; /* Back-pointer to interface. */
+ struct ifaddr *ifa_next; /* Next address for interface. */
+ };
+
+#define ifa_broadaddr ifa_ifu.ifu_broadaddr /* broadcast address */
+#define ifa_dstaddr ifa_ifu.ifu_dstaddr /* other end of link */
+
+/* Device mapping structure. I'd just gone off and designed a
+ beautiful scheme using only loadable modules with arguments for
+ driver options and along come the PCMCIA people 8)
+
+ Ah well. The get() side of this is good for WDSETUP, and it'll be
+ handy for debugging things. The set side is fine for now and being
+ very small might be worth keeping for clean configuration. */
+
+struct ifmap
+ {
+ unsigned long int mem_start;
+ unsigned long int mem_end;
+ unsigned short int base_addr;
+ unsigned char irq;
+ unsigned char dma;
+ unsigned char port;
+ /* 3 bytes spare */
+ };
+
+/* Interface request structure used for socket ioctl's. All interface
+ ioctl's must have parameter definitions which begin with ifr_name.
+ The remainder may be interface specific. */
+
+struct ifreq
+ {
+#define IFHWADDRLEN 6
+#define IFNAMSIZ 16
+ union
+ {
+ char ifrn_name[IFNAMSIZ]; /* Interface name, e.g. "en0". */
+ } ifr_ifrn;
+
+ union
+ {
+ struct sockaddr ifru_addr;
+ struct sockaddr ifru_dstaddr;
+ struct sockaddr ifru_broadaddr;
+ struct sockaddr ifru_netmask;
+ struct sockaddr ifru_hwaddr;
+ short int ifru_flags;
+ int ifru_metric;
+ int ifru_mtu;
+ struct ifmap ifru_map;
+ char ifru_slave[IFNAMSIZ]; /* Just fits the size */
+ __caddr_t ifru_data;
+ } ifr_ifru;
+ };
+
+#define ifr_name ifr_ifrn.ifrn_name /* interface name */
+#define ifr_hwaddr ifr_ifru.ifru_hwaddr /* MAC address */
+#define ifr_addr ifr_ifru.ifru_addr /* address */
+#define ifr_dstaddr ifr_ifru.ifru_dstaddr /* other end of p-p lnk */
+#define ifr_broadaddr ifr_ifru.ifru_broadaddr /* broadcast address */
+#define ifr_netmask ifr_ifru.ifru_netmask /* interface net mask */
+#define ifr_flags ifr_ifru.ifru_flags /* flags */
+#define ifr_metric ifr_ifru.ifru_metric /* metric */
+#define ifr_mtu ifr_ifru.ifru_mtu /* mtu */
+#define ifr_map ifr_ifru.ifru_map /* device map */
+#define ifr_slave ifr_ifru.ifru_slave /* slave device */
+#define ifr_data ifr_ifru.ifru_data /* for use by interface */
+
+
+/* Structure used in SIOCGIFCONF request. Used to retrieve interface
+ configuration for machine (useful for programs which must know all
+ networks accessible). */
+
+struct ifconf
+ {
+ int ifc_len; /* Size of buffer. */
+ union
+ {
+ __caddr_t ifcu_buf;
+ struct ifreq *ifcu_req;
+ } ifc_ifcu;
+ };
+#define ifc_buf ifc_ifcu.ifcu_buf /* Buffer address. */
+#define ifc_req ifc_ifcu.ifcu_req /* Array of structures. */
+
+#endif /* net/if.h */
diff --git a/sysdeps/unix/sysv/linux/netinet/in.h b/sysdeps/unix/sysv/linux/netinet/in.h
index 91c88835db..3dea878a21 100644
--- a/sysdeps/unix/sysv/linux/netinet/in.h
+++ b/sysdeps/unix/sysv/linux/netinet/in.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991, 92, 93, 94, 95, 96 Free Software Foundation, Inc.
+/* Copyright (C) 1991, 92, 93, 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
@@ -23,14 +23,25 @@
#include <sys/socket.h>
-__BEGIN_DECLS
-#include <linux/in.h>
-__END_DECLS
-/* Standard well-known ports. The use of these constants is
- deprecated. Instead use the contents of the file `/etc/services'
- or similar databases by using the function getservbyname and
- getservbyport. */
+/* Standard well-defined IP protocols. */
+enum
+ {
+ IPPROTO_IP = 0, /* Dummy protocol for TCP. */
+ IPPROTO_ICMP = 1, /* Internet Control Message Protocol. */
+ IPPROTO_IGMP = 2, /* Internet Group Management Protocol. */
+ IPPROTO_IPIP = 4, /* IPIP tunnels (older KA9Q tunnels use 94). */
+ IPPROTO_TCP = 6, /* Transmission Control Protocol. */
+ IPPROTO_EGP = 8, /* Exterior Gateway Protocol. */
+ IPPROTO_PUP = 12, /* PUP protocol. */
+ IPPROTO_UDP = 17, /* User Datagram Protocol. */
+ IPPROTO_IDP = 22, /* XNS IDP protocol. */
+
+ IPPROTO_RAW = 255, /* Raw IP packets. */
+ IPPROTO_MAX
+ };
+
+/* Standard well-known ports. */
enum
{
IPPORT_ECHO = 7, /* Echo service. */
@@ -71,50 +82,120 @@ enum
};
-/* Link numbers. */
-#define IMPLINK_IP 155
-#define IMPLINK_LOWEXPER 156
-#define IMPLINK_HIGHEXPER 158
+/* Internet address. */
+struct in_addr
+ {
+ unsigned int s_addr;
+ };
+
+
+/* Definitions of the bits in an Internet address integer.
+
+ On subnets, host and network parts are found according to
+ the subnet mask, not these masks. */
+
+#define IN_CLASSA(a) ((((unsigned) (a)) & 0x80000000) == 0)
+#define IN_CLASSA_NET 0xff000000
+#define IN_CLASSA_NSHIFT 24
+#define IN_CLASSA_HOST (0xffffffff & ~IN_CLASSA_NET)
+#define IN_CLASSA_MAX 128
+
+#define IN_CLASSB(a) ((((unsigned) (a)) & 0xc0000000) == 0x80000000)
+#define IN_CLASSB_NET 0xffff0000
+#define IN_CLASSB_NSHIFT 16
+#define IN_CLASSB_HOST (0xffffffff & ~IN_CLASSB_NET)
+#define IN_CLASSB_MAX 65536
+
+#define IN_CLASSC(a) ((((unsigned) (a)) & 0xc0000000) == 0xc0000000)
+#define IN_CLASSC_NET 0xffffff00
+#define IN_CLASSC_NSHIFT 8
+#define IN_CLASSC_HOST (0xffffffff & ~IN_CLASSC_NET)
+
+#define IN_CLASSD(a) ((((unsigned) (a)) & 0xf0000000) == 0xe0000000)
+#define IN_MULTICAST(a) IN_CLASSD(a)
+
+#define IN_EXPERIMENTAL(a) ((((unsigned) (a)) & 0xe0000000) == 0xe0000000)
+#define IN_BADCLASS(a) ((((unsigned) (a)) & 0xf0000000) == 0xf0000000)
+
+/* Address to accept any incoming messages. */
+#define INADDR_ANY ((unsigned) 0x00000000)
+/* Address to send to all hosts. */
+#define INADDR_BROADCAST ((unsigned) 0xffffffff)
+/* Address indicating an error return. */
+#define INADDR_NONE 0xffffffff
+
+/* Network number for local host loopback. */
+#define IN_LOOPBACKNET 127
+/* Address to loopback in software to local host. */
+#ifndef INADDR_LOOPBACK
+#define INADDR_LOOPBACK 0x7f000001 /* Internet address 127.0.0.1. */
+#endif
+
/* Get the definition of the macro to define the common sockaddr members. */
#include <sockaddrcom.h>
-/* Structure used to describe IP options for IP_OPTIONS and IP_RETOPTS.
- The `ip_dst' field is used for the first-hop gateway when using a
- source route (this gets put into the header proper). */
+
+/* Structure describing an Internet socket address. */
+struct sockaddr_in
+ {
+ __SOCKADDR_COMMON (sin_);
+ unsigned short int sin_port; /* Port number. */
+ struct in_addr sin_addr; /* Internet address. */
+
+ /* Pad to size of `struct sockaddr'. */
+ unsigned char sin_zero[sizeof(struct sockaddr) -
+ __SOCKADDR_COMMON_SIZE -
+ sizeof(unsigned short int) -
+ sizeof(struct in_addr)];
+ };
+
+
+/* Options for use with `getsockopt' and `setsockopt' at the IP level.
+ The first word in the comment at the right is the data type used;
+ "bool" means a boolean value stored in an `int'. */
+#define IP_TOS 1 /* int; IP type of service and precedence. */
+#define IP_TTL 2 /* int; IP time to live. */
+#define IP_HDRINCL 3 /* int; Header is included with data. */
+#define IP_OPTIONS 4 /* ip_opts; IP per-packet options. */
+#define IP_MULTICAST_IF 32 /* in_addr; set/get IP multicast i/f */
+#define IP_MULTICAST_TTL 33 /* u_char; set/get IP multicast ttl */
+#define IP_MULTICAST_LOOP 34 /* i_char; set/get IP multicast loopback */
+#define IP_ADD_MEMBERSHIP 35 /* ip_mreq; add an IP group membership */
+#define IP_DROP_MEMBERSHIP 36 /* ip_mreq; drop an IP group membership */
+
+/* Structure used to describe IP options for IP_OPTIONS. The `ip_dst'
+ field is used for the first-hop gateway when using a source route
+ (this gets put into the header proper). */
struct ip_opts
{
struct in_addr ip_dst; /* First hop; zero without source route. */
char ip_opts[40]; /* Actually variable in size. */
};
-__BEGIN_DECLS
+/* Structure used for IP_ADD_MEMBERSHIP and IP_DROP_MEMBERSHIP. */
+struct ip_mreq
+ {
+ struct in_addr imr_multiaddr; /* IP multicast address of group */
+ struct in_addr imr_interface; /* local IP address of interface */
+ };
/* Functions to convert between host and network byte order. */
-extern unsigned long int ntohl __P ((unsigned long int __long_word));
-extern unsigned short int ntohs __P ((unsigned short int __short_word));
-extern unsigned long int htonl __P ((unsigned long int __long_word));
-extern unsigned short int htons __P ((unsigned short int __short_word));
-
-/* Bind socket FD to a privileged IP address SIN. */
-extern int bindresvport __P ((int __fd, struct sockaddr_in * __sock_in));
-
-__END_DECLS
+extern unsigned long int ntohl __P ((unsigned long int));
+extern unsigned short int ntohs __P ((unsigned short int));
+extern unsigned long int htonl __P ((unsigned long int));
+extern unsigned short int htons __P ((unsigned short int));
#include <endian.h>
#if __BYTE_ORDER == __BIG_ENDIAN
/* The host byte order is the same as network byte order,
so these functions are all just identity. */
-# undef ntohl
-# define ntohl(x) (x)
-# undef ntohs
-# define ntohs(x) (x)
-# undef htonl
-# define htonl(x) (x)
-# undef htons
-# define htons(x) (x)
+#define ntohl(x) (x)
+#define ntohs(x) (x)
+#define htonl(x) (x)
+#define htons(x) (x)
#endif
#endif /* netinet/in.h */
diff --git a/sysdeps/unix/sysv/linux/siglist.h b/sysdeps/unix/sysv/linux/siglist.h
index 44aa4d9027..c2bf2331d7 100644
--- a/sysdeps/unix/sysv/linux/siglist.h
+++ b/sysdeps/unix/sysv/linux/siglist.h
@@ -1,47 +1,65 @@
+/* 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
+ modify it under the terms of the GNU Library General Public License as
+ published by the Free Software Foundation; either version 2 of the
+ License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public
+ License along with the GNU C Library; see the file COPYING.LIB. If not,
+ write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA. */
+
/* This file is included multiple times. */
/* Standard signals */
- init_sig (SIGHUP, "HUP", "Hangup")
- init_sig (SIGINT, "INT", "Interrupt")
- init_sig (SIGQUIT, "QUIT", "Quit")
- init_sig (SIGILL, "ILL", "Illegal Instruction")
- init_sig (SIGTRAP, "TRAP", "Trace/breakpoint trap")
- init_sig (SIGABRT, "ABRT", "Aborted")
- init_sig (SIGFPE, "FPE", "Floating point exception")
- init_sig (SIGKILL, "KILL", "Killed")
- init_sig (SIGBUS, "BUS", "Bus error")
- init_sig (SIGSEGV, "SEGV", "Segmentation fault")
- init_sig (SIGPIPE, "PIPE", "Broken pipe")
- init_sig (SIGALRM, "ALRM", "Alarm clock")
- init_sig (SIGTERM, "TERM", "Terminated")
- init_sig (SIGURG, "URG", "Urgent I/O condition")
- init_sig (SIGSTOP, "STOP", "Stopped (signal)")
- init_sig (SIGTSTP, "TSTP", "Stopped")
- init_sig (SIGCONT, "CONT", "Continued")
- init_sig (SIGCHLD, "CHLD", "Child exited")
- init_sig (SIGTTIN, "TTIN", "Stopped (tty input)")
- init_sig (SIGTTOU, "TTOU", "Stopped (tty output)")
- init_sig (SIGIO, "IO", "I/O possible")
- init_sig (SIGXCPU, "XCPU", "CPU time limit exceeded")
- init_sig (SIGXFSZ, "XFSZ", "File size limit exceeded")
- init_sig (SIGVTALRM, "VTALRM", "Virtual timer expired")
- init_sig (SIGPROF, "PROF", "Profiling timer expired")
- init_sig (SIGWINCH, "WINCH", "Window changed")
- init_sig (SIGUSR1, "USR1", "User defined signal 1")
- init_sig (SIGUSR2, "USR2", "User defined signal 2")
+ init_sig (SIGHUP, "HUP", N_("Hangup"))
+ init_sig (SIGINT, "INT", N_("Interrupt"))
+ init_sig (SIGQUIT, "QUIT", N_("Quit"))
+ init_sig (SIGILL, "ILL", N_("Illegal Instruction"))
+ init_sig (SIGTRAP, "TRAP", N_("Trace/breakpoint trap"))
+ init_sig (SIGABRT, "ABRT", N_("Aborted"))
+ init_sig (SIGFPE, "FPE", N_("Floating point exception"))
+ init_sig (SIGKILL, "KILL", N_("Killed"))
+ init_sig (SIGBUS, "BUS", N_("Bus error"))
+ init_sig (SIGSEGV, "SEGV", N_("Segmentation fault"))
+ init_sig (SIGPIPE, "PIPE", N_("Broken pipe"))
+ init_sig (SIGALRM, "ALRM", N_("Alarm clock"))
+ init_sig (SIGTERM, "TERM", N_("Terminated"))
+ init_sig (SIGURG, "URG", N_("Urgent I/O condition"))
+ init_sig (SIGSTOP, "STOP", N_("Stopped (signal)"))
+ init_sig (SIGTSTP, "TSTP", N_("Stopped"))
+ init_sig (SIGCONT, "CONT", N_("Continued"))
+ init_sig (SIGCHLD, "CHLD", N_("Child exited"))
+ init_sig (SIGTTIN, "TTIN", N_("Stopped (tty input)"))
+ init_sig (SIGTTOU, "TTOU", N_("Stopped (tty output)"))
+ init_sig (SIGIO, "IO", N_("I/O possible"))
+ init_sig (SIGXCPU, "XCPU", N_("CPU time limit exceeded"))
+ init_sig (SIGXFSZ, "XFSZ", N_("File size limit exceeded"))
+ init_sig (SIGVTALRM, "VTALRM", N_("Virtual timer expired"))
+ init_sig (SIGPROF, "PROF", N_("Profiling timer expired"))
+ init_sig (SIGWINCH, "WINCH", N_("Window changed"))
+ init_sig (SIGUSR1, "USR1", N_("User defined signal 1"))
+ init_sig (SIGUSR2, "USR2", N_("User defined signal 2"))
/* Variations */
#ifdef SIGEMT
- init_sig (SIGEMT, "EMT", "EMT trap")
+ init_sig (SIGEMT, "EMT", N_("EMT trap"))
#endif
#ifdef SIGSYS
- init_sig (SIGSYS, "SYS", "Bad system call")
+ init_sig (SIGSYS, "SYS", N_("Bad system call"))
#endif
#ifdef SIGSTKFLT
- init_sig (SIGSTKFLT, "STKFLT", "Stack fault")
+ init_sig (SIGSTKFLT, "STKFLT", N_("Stack fault"))
#endif
#ifdef SIGINFO
- init_sig (SIGINFO, "INFO", "Information request")
+ init_sig (SIGINFO, "INFO", N_("Information request"))
#elif defined(SIGPWR)
- init_sig (SIGPWR, "PWR", "Power failure")
+ init_sig (SIGPWR, "PWR", N_("Power failure"))
#endif
diff --git a/sysdeps/unix/sysv/linux/sigset.h b/sysdeps/unix/sysv/linux/sigset.h
new file mode 100644
index 0000000000..69648b7e9c
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/sigset.h
@@ -0,0 +1,89 @@
+/* __sig_atomic_t, __sigset_t, and related definitions. Linux version.
+ Copyright (C) 1991, 1992, 1994, 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. */
+
+#ifndef _SIGSET_H_types
+#define _SIGSET_H_types 1
+
+typedef int __sig_atomic_t;
+
+/* A `sigset_t' has a bit for each signal. Having 32 * 4 * 8 bits gives
+ us up to 1024 signals. */
+#define _SIGSET_NWORDS 32
+typedef struct
+{
+ unsigned int __val[_SIGSET_NWORDS];
+} __sigset_t;
+
+#endif
+
+
+/* We only want to define these functions if <signal.h> was actually
+ included; otherwise we were included just to define the types. Since we
+ are namespace-clean, it wouldn't hurt to define extra macros. But
+ trouble can be caused by functions being defined (e.g., any global
+ register vars declared later will cause compilation errors). */
+
+#if !defined (_SIGSET_H_fns) && defined (_SIGNAL_H)
+#define _SIGSET_H_fns 1
+
+#ifndef _EXTERN_INLINE
+#define _EXTERN_INLINE extern __inline
+#endif
+
+/* Return a mask that includes the bit for SIG only. */
+#define __sigmask(sig) (((unsigned int) 1) << (((sig) - 1) \
+ % (8 * sizeof (unsigned int))))
+/* Return the word index for SIG. */
+#define __sigword(sig) (((sig) - 1) / (8 * sizeof (unsigned int)))
+
+#if defined __GNUC__ && __GNUC__ >= 2
+#define __sigemptyset(set) \
+ (__extension__ ({ unsigned int __cnt; \
+ for (__cnt = 0; __cnt < _SIGSET_NWORDS; ++__cnt) \
+ (set)->__val[__cnt] = 0; 0; }))
+#define __sigfillset(set) \
+ (__extension__ ({ unsigned int __cnt; \
+ for (__cnt = 0; __cnt < _SIGSET_NWORDS; ++__cnt) \
+ (set)->__val[__cnt] = ~0; 0; }))
+#endif
+
+/* These functions needn't check for a bogus signal number -- error
+ checking is done in the non __ versions. */
+
+extern int __sigismember (__const __sigset_t *, int);
+extern int __sigaddset (__sigset_t *, int);
+extern int __sigdelset (__sigset_t *, int);
+
+#define __SIGSETFN(NAME, BODY, CONST) \
+ _EXTERN_INLINE int \
+ NAME (CONST __sigset_t *__set, int __sig) \
+ { \
+ unsigned int __mask = __sigmask (__sig); \
+ unsigned int __word = __sigword (__sig); \
+ return BODY; \
+ }
+
+__SIGSETFN (__sigismember, (__set->__val[__word] & __mask) ? 1 : 0, __const)
+__SIGSETFN (__sigaddset, ((__set->__val[__word] |= __mask), 0), )
+__SIGSETFN (__sigdelset, ((__set->__val[__word] &= ~__mask), 0), )
+
+#undef __SIGSETFN
+
+
+#endif /* ! _SIGSET_H_fns. */
diff --git a/sysdeps/unix/sysv/linux/sigsuspend.c b/sysdeps/unix/sysv/linux/sigsuspend.c
index 8b3d2519ce..723f7629ec 100644
--- a/sysdeps/unix/sysv/linux/sigsuspend.c
+++ b/sysdeps/unix/sysv/linux/sigsuspend.c
@@ -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
@@ -20,7 +20,7 @@
#include <stddef.h>
#include <unistd.h>
-extern int __syscall_sigsuspend (int, unsigned long, unsigned long);
+extern int __syscall_sigsuspend (int, unsigned long int, unsigned long int);
/* Change the set of blocked signals to SET,
wait until a signal arrives, and restore the set of blocked signals. */
@@ -28,6 +28,10 @@ int
__sigsuspend (set)
const sigset_t *set;
{
- return __syscall_sigsuspend (0, 0, *set);
+ /* XXX This will have to be changed once the kernel knows about
+ larger sigsets. */
+ unsigned long int word = set->__val[0];
+
+ return __syscall_sigsuspend (0, 0, word);
}
weak_alias (__sigsuspend, sigsuspend)
diff --git a/sysdeps/unix/sysv/linux/socketbits.h b/sysdeps/unix/sysv/linux/socketbits.h
index 1c7cee0dad..3bb92ab733 100644
--- a/sysdeps/unix/sysv/linux/socketbits.h
+++ b/sysdeps/unix/sysv/linux/socketbits.h
@@ -1,2 +1,136 @@
-/* Get Linux specific constants and data types kernel header. */
-#include <linux/socket.h>
+/* System-specific socket constants and types. Linux version.
+ 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. */
+
+#ifndef _SOCKETBITS_H
+
+#define _SOCKETBITS_H 1
+#include <features.h>
+
+#define __need_size_t
+#include <stddef.h>
+
+
+__BEGIN_DECLS
+
+/* Types of sockets. */
+enum __socket_type
+{
+ SOCK_STREAM = 1, /* Sequenced, reliable, connection-based
+ byte streams. */
+ SOCK_DGRAM = 2, /* Connectionless, unreliable datagrams
+ of fixed maximum length. */
+ SOCK_RAW = 3, /* Raw protocol interface. */
+ SOCK_RDM = 4, /* Reliably-delivered messages. */
+ SOCK_SEQPACKET = 5, /* Sequenced, reliable, connection-based,
+ datagrams of fixed maximum length. */
+ SOCK_PACKET = 10 /* Linux specific way of getting packets
+ at the dev level. For writing rarp and
+ other similar things on the user level. */
+};
+
+/* Protocol families. */
+#define PF_UNSPEC 0 /* Unspecified. */
+#define PF_LOCAL 1 /* Local to host (pipes and file-domain). */
+#define PF_UNIX PF_LOCAL /* Old BSD name for PF_LOCAL. */
+#define PF_INET 2 /* IP protocol family. */
+#define PF_AX25 3 /* Amateur Radio AX.25. */
+#define PF_IPX 4 /* Novell Internet Protocol. */
+#define PF_APPLETALK 5 /* Don't use this. */
+#define PF_NETROM 6 /* Amateur radio NetROM. */
+#define PF_BRIDGE 7 /* Multiprotocol bridge. */
+#define PF_AAL5 8 /* Reserved for Werner's ATM. */
+#define PF_X25 9 /* Reserved for X.25 project. */
+#define PF_INET6 10 /* IP version 6. */
+#define PF_MAX 12 /* For now.. */
+
+/* Address families. */
+#define AF_UNSPEC PF_UNSPEC
+#define AF_LOCAL PF_LOCAL
+#define AF_UNIX PF_UNIX
+#define AF_INET PF_INET
+#define AF_AX25 PF_AX25
+#define AF_IPX PF_IPX
+#define AF_APPLETALK PF_APPLETALK
+#define AF_NETROM PF_NETROM
+#define AF_BRIDGE PF_BRIDGE
+#define AF_AAL5 PF_AAL5
+#define AF_X25 PF_X25
+#define AF_INET6 PF_INET6
+#define AF_MAX PF_MAX
+
+
+
+/* Maximum queue length specifiable by listen. */
+#define SOMAXCONN 128
+
+/* Get the definition of the macro to define the common sockaddr members. */
+#include <sockaddrcom.h>
+
+/* Structure describing a generic socket address. */
+struct sockaddr
+ {
+ __SOCKADDR_COMMON (sa_); /* Common data: address family and length. */
+ char sa_data[14]; /* Address data. */
+ };
+
+
+/* Bits in the FLAGS argument to `send', `recv', et al. */
+enum
+ {
+ MSG_OOB = 0x01, /* Process out-of-band data. */
+ MSG_PEEK = 0x02, /* Peek at incoming messages. */
+ MSG_DONTROUTE = 0x04, /* Don't use local routing. */
+ MSG_CTRUNC = 0x08, /* Control data lost before delivery. */
+ MSG_PROXY = 0x10 /* Supply or ask second address. */
+ };
+
+
+/* Structure describing messages sent by
+ `sendmsg' and received by `recvmsg'. */
+struct msghdr
+ {
+ __ptr_t msg_name; /* Address to send to/receive from. */
+ int msg_namelen; /* Length of address data. */
+ /* XXX Should be type `size_t' according to POSIX.1g. */
+
+ struct iovec *msg_iov; /* Vector of data to send/receive into. */
+ int msg_iovlen; /* Number of elements in the vector. */
+ /* XXX Should be type `size_t' according to POSIX.1g. */
+
+ __ptr_t msg_control; /* Ancillary data (eg BSD filedesc passing). */
+ int msg_controllen; /* Ancillary data buffer length. */
+ /* XXX Should be type `size_t' according to POSIX.1g. */
+ int msg_flags; /* Flags on received message. */
+ };
+
+
+/* Get socket manipulation related informations from kernel headers. */
+#include <asm/socket.h>
+
+
+/* Structure used to manipulate the SO_LINGER option. */
+struct linger
+ {
+ int l_onoff; /* Nonzero to linger on close. */
+ int l_linger; /* Time to linger. */
+ };
+
+__END_DECLS
+
+#endif /* socketbits.h */
diff --git a/sysdeps/unix/sysv/linux/statfsbuf.h b/sysdeps/unix/sysv/linux/statfsbuf.h
index 08a10cb495..1d1bbdae0d 100644
--- a/sysdeps/unix/sysv/linux/statfsbuf.h
+++ b/sysdeps/unix/sysv/linux/statfsbuf.h
@@ -1 +1,36 @@
-#include <asm/statfs.h>
+/* 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 _STATFSBUF_H
+#define _STATFSBUF_H
+
+struct statfs
+ {
+ int f_type;
+ int f_bsize;
+ int f_blocks;
+ int f_bfree;
+ int f_bavail;
+ int f_files;
+ int f_ffree;
+ __fsid_t f_fsid;
+ int f_namelen;
+ int f_spare[6];
+ };
+
+#endif /* statfsbuf.h */
diff --git a/sysdeps/unix/sysv/linux/sys/acct.h b/sysdeps/unix/sysv/linux/sys/acct.h
index 4267ef405e..1d723d55b8 100644
--- a/sysdeps/unix/sysv/linux/sys/acct.h
+++ b/sysdeps/unix/sysv/linux/sys/acct.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
@@ -24,11 +24,40 @@
#define __need_time_t
#include <time.h>
-/* Get needed constants. */
-#include <linux/acct.h>
__BEGIN_DECLS
+#define ACCT_COMM 16
+
+struct acct
+ {
+ char ac_comm[ACCT_COMM]; /* Accounting command name. */
+ time_t ac_utime; /* Accounting user time. */
+ time_t ac_stime; /* Accounting system time. */
+ time_t ac_etime; /* Accounting elapsed time. */
+ time_t ac_btime; /* Beginning time. */
+ unsigned short int ac_uid; /* Accounting user ID. */
+ unsigned short int ac_gid; /* Accounting group ID. */
+ unsigned short int ac_tty; /* Controlling tty. */
+ /* Please note that the value of the `ac_tty' field, a device number,
+ is encoded differently in the kernel and for the libc dev_t type. */
+ char ac_flag; /* Accounting flag. */
+ long int ac_minflt; /* Accounting minor pagefaults. */
+ long int ac_majflt; /* Accounting major pagefaults. */
+ long int ac_exitcode; /* Accounting process exitcode. */
+ };
+
+enum
+ {
+ AFORK = 0001, /* Has executed fork, but no exec. */
+ ASU = 0002, /* Used super-user privileges. */
+ ACORE = 0004, /* Dumped core. */
+ AXSIG = 0010 /* Killed by a signal. */
+ };
+
+#define AHZ 100
+
+
/* Switch process accounting on and off. */
extern int acct __P ((__const char *__filename));
diff --git a/sysdeps/unix/sysv/linux/sys/ptrace.h b/sysdeps/unix/sysv/linux/sys/ptrace.h
index ec94def4c5..eda8b8c00f 100644
--- a/sysdeps/unix/sysv/linux/sys/ptrace.h
+++ b/sysdeps/unix/sysv/linux/sys/ptrace.h
@@ -1,5 +1,5 @@
/* `ptrace' debugger support interface. Linux version.
- 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
@@ -22,6 +22,8 @@
#define _SYS_PTRACE_H 1
#include <features.h>
+#include <asm/ptrace.h>
+
__BEGIN_DECLS
/* Type of the REQUEST argument to `ptrace.' */
diff --git a/sysdeps/unix/sysv/linux/syscall.h b/sysdeps/unix/sysv/linux/sys/syscall.h
index cef91f6727..cef91f6727 100644
--- a/sysdeps/unix/sysv/linux/syscall.h
+++ b/sysdeps/unix/sysv/linux/sys/syscall.h
diff --git a/sysdeps/unix/sysv/linux/sys/sysmacros.h b/sysdeps/unix/sysv/linux/sys/sysmacros.h
index caf4566414..b859dc7d64 100644
--- a/sysdeps/unix/sysv/linux/sys/sysmacros.h
+++ b/sysdeps/unix/sysv/linux/sys/sysmacros.h
@@ -1,5 +1,5 @@
/* Definitions of macros to access `dev_t' values.
- 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
@@ -21,12 +21,9 @@
#define _SYS_SYSMACROS_H 1
-/* Get definition from kernel header. */
-#include <linux/kdev_t.h>
-
/* For compatibility we provide alternative names. */
-#define major(dev) MAJOR ((unsigned int) (dev))
-#define minor(dev) MINOR ((unsigned int) (dev))
-#define makedev(major, minor) MKDEV (major, minor)
+#define major(dev) ((dev) >> 32)
+#define minor(dev) ((dev) & 0xffffffff)
+#define makedev(major, minor) (((major) << 32) | (monor))
#endif /* _SYS_SYSMACROS_H */
diff --git a/sysdeps/unix/sysv/linux/syscalls.list b/sysdeps/unix/sysv/linux/syscalls.list
index 38896e7f18..246470a66a 100644
--- a/sysdeps/unix/sysv/linux/syscalls.list
+++ b/sysdeps/unix/sysv/linux/syscalls.list
@@ -31,11 +31,13 @@ pause - pause 0 __libc_pause pause
personality init-first personality 1 __personality personality
pipe - pipe 1 __pipe pipe
query_module EXTRA query_module 5 query_module
+s_getdents EXTRA getdents 3 __getdents
s_getpriority getpriority getpriority 2 __syscall_getpriority
s_ptrace ptrace ptrace 4 __syscall_ptrace
s_reboot EXTRA reboot 3 __syscall_reboot
s_sigsuspend sigsuspend sigsuspend 3 __syscall_sigsuspend
s_sysctl sysctl _sysctl 1 __syscall__sysctl
+s_ustat ustat ustat 2 __syscall_ustat
sched_getp - sched_getparam 2 __sched_getparam sched_getparam
sched_gets - sched_getscheduler 1 __sched_getscheduler sched_getscheduler
sched_primax - sched_get_priority_max 1 __sched_get_priority_max sched_get_priority_max
@@ -51,9 +53,9 @@ setpgid - setpgid 2 __setpgid setpgid
setresuid EXTRA setresuid 3 setresuid
sigpending - sigpending 1 sigpending
sigprocmask - sigprocmask 3 __sigprocmask sigprocmask
+sigreturn EXTRA sigreturn 1 __sigreturn sigreturn
sysinfo EXTRA sysinfo 1 sysinfo
swapon - swapon 2 swapon
umount EXTRA umount 1 __umount umount
uselib EXTRA uselib 1 uselib
-ustat - ustat 2 __ustat ustat
wait4 - wait4 4 __wait4 wait4
diff --git a/sysdeps/unix/sysv/linux/tcgetattr.c b/sysdeps/unix/sysv/linux/tcgetattr.c
index 3f12348478..2e8cb1cf79 100644
--- a/sysdeps/unix/sysv/linux/tcgetattr.c
+++ b/sysdeps/unix/sysv/linux/tcgetattr.c
@@ -1,23 +1,29 @@
-/* Copyright (C) 1992, 1995 Free Software Foundation, Inc.
-This file is part of the GNU C Library.
+/* Copyright (C) 1992, 1995, 1997 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
-The GNU C Library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Library General Public License as
-published by the Free Software Foundation; either version 2 of the
-License, or (at your option) any later version.
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public License as
+ published by the Free Software Foundation; either version 2 of the
+ License, or (at your option) any later version.
-The GNU C Library is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-Library General Public License for more details.
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
-You should have received a copy of the GNU Library General Public
-License along with the GNU C Library; see the file COPYING.LIB. If
-not, write to the Free Software Foundation, Inc., 675 Mass Ave,
-Cambridge, MA 02139, USA. */
+ You should have received a copy of the GNU Library General Public
+ License along with the GNU C Library; see the file COPYING.LIB. If not,
+ write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA. */
#include <termios.h>
#include <sys/ioctl.h>
+#include <sys/types.h>
+
+/* The difference here is that the termios structure used in the
+ kernel is not the same as we use in the libc. Therefore we must
+ translate it here. */
+#include <kernel_termios.h>
/* Put the state of FD into *TERMIOS_P. */
int
@@ -25,7 +31,27 @@ __tcgetattr (fd, termios_p)
int fd;
struct termios *termios_p;
{
- return __ioctl (fd, TCGETS, termios_p);
+ struct kernel_termios k_termios;
+ int retval;
+ size_t cnt;
+
+ retval = __ioctl (fd, TCGETS, &k_termios);
+
+ termios_p->c_iflag = k_termios.c_iflag;
+ termios_p->c_oflag = k_termios.c_oflag;
+ termios_p->c_cflag = k_termios.c_cflag;
+ termios_p->c_lflag = k_termios.c_lflag;
+ termios_p->c_line = k_termios.c_line;
+#ifdef _HAVE_C_ISPEED
+ termios_p->c_ispeed = k_termios.c_ispeed;
+#endif
+#ifdef _HAVE_C_OSPEED
+ termios_p->c_ospeed = k_termios.c_ospeed;
+#endif
+ for (cnt = 0; cnt < KERNEL_NCCS; ++cnt)
+ termios_p->c_cc[cnt] = k_termios.c_cc[cnt];
+
+ return retval;
}
weak_alias (__tcgetattr, tcgetattr)
diff --git a/sysdeps/unix/sysv/linux/tcsetattr.c b/sysdeps/unix/sysv/linux/tcsetattr.c
index ef5009d1c8..7afaf1b986 100644
--- a/sysdeps/unix/sysv/linux/tcsetattr.c
+++ b/sysdeps/unix/sysv/linux/tcsetattr.c
@@ -1 +1,72 @@
-#include <sysdeps/unix/bsd/sun/sunos4/tcsetattr.c>
+/* Copyright (C) 1993, 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 <termios.h>
+#include <sys/ioctl.h>
+#include <sys/types.h>
+
+/* The difference here is that the termios structure used in the
+ kernel is not the same as we use in the libc. Therefore we must
+ translate it here. */
+#include <kernel_termios.h>
+
+
+/* Set the state of FD to *TERMIOS_P. */
+int
+tcsetattr (fd, optional_actions, termios_p)
+ int fd;
+ int optional_actions;
+ const struct termios *termios_p;
+{
+ struct kernel_termios k_termios;
+ unsigned long int cmd;
+ size_t cnt;
+
+ switch (optional_actions)
+ {
+ case TCSANOW:
+ cmd = TCSETS;
+ break;
+ case TCSADRAIN:
+ cmd = TCSETSW;
+ break;
+ case TCSAFLUSH:
+ cmd = TCSETSF;
+ break;
+ default:
+ __set_errno (EINVAL);
+ return -1;
+ }
+
+ k_termios.c_iflag = termios_p->c_iflag;
+ k_termios.c_oflag = termios_p->c_oflag;
+ k_termios.c_cflag = termios_p->c_cflag;
+ k_termios.c_lflag = termios_p->c_lflag;
+ k_termios.c_line = termios_p->c_line;
+#ifdef _HAVE_C_ISPEED
+ k_termios.c_ispeed = termios_p.c_ispeed;
+#endif
+#ifdef _HAVE_C_OSPEED
+ k_termios.c_ospeed = termios_p.c_ospeed;
+#endif
+ for (cnt = 0; cnt < KERNEL_NCCS; ++cnt)
+ k_termios.c_cc[cnt] = termios_p->c_cc[cnt];
+
+ return __ioctl (fd, cmd, &k_termios);
+}
diff --git a/sysdeps/unix/sysv/linux/termbits.h b/sysdeps/unix/sysv/linux/termbits.h
index 536ced356d..f8e59f1d3b 100644
--- a/sysdeps/unix/sysv/linux/termbits.h
+++ b/sysdeps/unix/sysv/linux/termbits.h
@@ -1,5 +1,5 @@
/* termios type and macro definitions. Linux version.
- Copyright (C) 1993, 1994, 1995, 1996 Free Software Foundation, Inc.
+ Copyright (C) 1993, 1994, 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
@@ -17,8 +17,163 @@
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
-/* Use the architecture dependent definitions from the kernel. */
-#include <asm/termbits.h>
+typedef unsigned char cc_t;
+typedef unsigned int speed_t;
+typedef unsigned int tcflag_t;
+
+#define NCCS 32
+struct termios
+ {
+ tcflag_t c_iflag; /* input mode flags */
+ tcflag_t c_oflag; /* output mode flags */
+ tcflag_t c_cflag; /* control mode flags */
+ tcflag_t c_lflag; /* local mode flags */
+ cc_t c_line; /* line discipline */
+ cc_t c_cc[NCCS]; /* control characters */
+ speed_t c_ispeed; /* input speed */
+ speed_t c_ospeed; /* output speed */
+ };
+
+/* c_cc characters */
+#define VINTR 0
+#define VQUIT 1
+#define VERASE 2
+#define VKILL 3
+#define VEOF 4
+#define VTIME 5
+#define VMIN 6
+#define VSWTC 7
+#define VSTART 8
+#define VSTOP 9
+#define VSUSP 10
+#define VEOL 11
+#define VREPRINT 12
+#define VDISCARD 13
+#define VWERASE 14
+#define VLNEXT 15
+#define VEOL2 16
+
+/* c_iflag bits */
+#define IGNBRK 0000001
+#define BRKINT 0000002
+#define IGNPAR 0000004
+#define PARMRK 0000010
+#define INPCK 0000020
+#define ISTRIP 0000040
+#define INLCR 0000100
+#define IGNCR 0000200
+#define ICRNL 0000400
+#define IUCLC 0001000
+#define IXON 0002000
+#define IXANY 0004000
+#define IXOFF 0010000
+#define IMAXBEL 0020000
+
+/* c_oflag bits */
+#define OPOST 0000001
+#define OLCUC 0000002
+#define ONLCR 0000004
+#define OCRNL 0000010
+#define ONOCR 0000020
+#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
+#define VTDLY 0040000
+#define VT0 0000000
+#define VT1 0040000
+#define FFDLY 0100000
+#define FF0 0000000
+#define FF1 0100000
+
+/* c_cflag bit meaning */
+#define CBAUD 0010017
+#define B0 0000000 /* hang up */
+#define B50 0000001
+#define B75 0000002
+#define B110 0000003
+#define B134 0000004
+#define B150 0000005
+#define B200 0000006
+#define B300 0000007
+#define B600 0000010
+#define B1200 0000011
+#define B1800 0000012
+#define B2400 0000013
+#define B4800 0000014
+#define B9600 0000015
+#define B19200 0000016
+#define B38400 0000017
+#define EXTA B19200
+#define EXTB B38400
+#define CSIZE 0000060
+#define CS5 0000000
+#define CS6 0000020
+#define CS7 0000040
+#define CS8 0000060
+#define CSTOPB 0000100
+#define CREAD 0000200
+#define PARENB 0000400
+#define PARODD 0001000
+#define HUPCL 0002000
+#define CLOCAL 0004000
+#define CBAUDEX 0010000
+#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 */
+
+/* c_lflag bits */
+#define ISIG 0000001
+#define ICANON 0000002
+#define XCASE 0000004
+#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
+#define IEXTEN 0100000
+
+/* tcflow() and TCXONC use these */
+#define TCOOFF 0
+#define TCOON 1
+#define TCIOFF 2
+#define TCION 3
+
+/* tcflush() and TCFLSH use these */
+#define TCIFLUSH 0
+#define TCOFLUSH 1
+#define TCIOFLUSH 2
+
+/* tcsetattr uses these */
+#define TCSANOW 0
+#define TCSADRAIN 1
+#define TCSAFLUSH 2
+
#define _IOT_termios /* Hurd ioctl type field. */ \
_IOT (_IOTS (cflag_t), 4, _IOTS (cc_t), NCCS, _IOTS (speed_t), 2)
diff --git a/sysdeps/unix/sysv/linux/ustat.c b/sysdeps/unix/sysv/linux/ustat.c
new file mode 100644
index 0000000000..8cec8eb9b7
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/ustat.c
@@ -0,0 +1,32 @@
+/* Copyright (C) 1997 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
+
+ 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/ustat.h>
+#include <sys/sysmacros.h>
+
+int
+ustat (dev_t dev, struct ustat *ubuf)
+{
+ unsigned short int k_dev;
+
+ /* We must convert the value to dev_t type used by the kernel. */
+ k_dev = ((major (dev) & 0xff) << 8) | (minor (dev) & 0xff);
+
+ return __syscall_ustat (k_dev, ubuf);
+}
diff --git a/sysdeps/unix/sysv/linux/ustatbits.h b/sysdeps/unix/sysv/linux/ustatbits.h
index 96580031c7..526069a7f3 100644
--- a/sysdeps/unix/sysv/linux/ustatbits.h
+++ b/sysdeps/unix/sysv/linux/ustatbits.h
@@ -1,2 +1,27 @@
-/* struct ustat is currently in <linux/types.h>. Good or bad? */
-#include <linux/types.h>
+/* 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>
+
+struct ustat
+ {
+ __daddr_t f_tfree;
+ __ino_t f_tinode;
+ char f_fname[6];
+ char f_fpack[6];
+ };
diff --git a/sysdeps/unix/sysv/linux/xmknod.c b/sysdeps/unix/sysv/linux/xmknod.c
new file mode 100644
index 0000000000..cd73849021
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/xmknod.c
@@ -0,0 +1,48 @@
+/* xmknod call using old-style Unix mknod system call.
+ 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
+ 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 <sys/types.h>
+#include <sys/stat.h>
+#include <sys/sysmacros.h>
+
+extern int __syscall_mknod (const char *, unsigned short int,
+ unsigned short int);
+
+/* Create a device file named PATH, with permission and special bits MODE
+ and device number DEV (which can be constructed from major and minor
+ device numbers with the `makedev' macro above). */
+int
+__xmknod (int vers, const char *path, mode_t mode, dev_t *dev)
+{
+ unsigned short int k_dev;
+
+ if (vers != _MKNOD_VER)
+ {
+ __set_errno (EINVAL);
+ return -1;
+ }
+
+ /* We must convert the value to dev_t type used by the kernel. */
+ k_dev = ((major (*dev) & 0xff) << 8) | (minor (*dev) & 0xff);
+
+ return __syscall_mknod (path, mode, k_dev);
+}
+
+weak_alias (__xmknod, _xmknod)
diff --git a/sysdeps/unix/sysv/sco3.2.4/syscall.h b/sysdeps/unix/sysv/sco3.2.4/sys/syscall.h
index 9c03f89759..9c03f89759 100644
--- a/sysdeps/unix/sysv/sco3.2.4/syscall.h
+++ b/sysdeps/unix/sysv/sco3.2.4/sys/syscall.h