about summary refs log tree commit diff
path: root/sysdeps/unix/sysv/linux/mips/bits
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>1997-07-12 23:35:19 +0000
committerUlrich Drepper <drepper@redhat.com>1997-07-12 23:35:19 +0000
commitf21acc89c06c14160eab88246e9dbe0b17eb5f89 (patch)
tree096a11e16faed78c69e77fd79b7c8bb4dc0bd051 /sysdeps/unix/sysv/linux/mips/bits
parent2d7da676f38bc00f40d2b604036c0295c156529e (diff)
downloadglibc-f21acc89c06c14160eab88246e9dbe0b17eb5f89.tar.gz
glibc-f21acc89c06c14160eab88246e9dbe0b17eb5f89.tar.xz
glibc-f21acc89c06c14160eab88246e9dbe0b17eb5f89.zip
1997-07-13 01:18  Ulrich Drepper  <drepper@cygnus.com>

	* setjmp/setjmp.h: Define _setjmp and _longjmp also if __USE_XOPEN.

	* sysdeps/unix/sysv/linux/bits/ipc.h: Fix comment.
	* sysdeps/unix/sysv/linux/bits/msq.h: Likewise.
	* sysdeps/unix/sysv/linux/bits/sem.h: Likewise.
	* sysdeps/unix/sysv/linux/bits/shm.h: Likewise.

	* time/Makefile (routines): Add getdate.
	* time/time.h: Add prototype for getdate and getdate_r.
	* time/getdate.c: New file.
	Provided by Mark Kettenis <kettenis@phys.uva.nl>.

1997-06-30 14:49  H.J. Lu  <hjl@gnu.ai.mit.edu>

	From Ralf Baechle <ralf@informatik.uni-koblenz.de> on
	Sat Jun 21 18:11:21 1997:

	* sysdeps/unix/sysv/linux/syscalls.list (swapon): Add __swapon alias.
	(swapoff): New.

	* elf/Makefile: Add linker script support.
	(headers): Add bits/dlfcn.h.

	* elf/dl-load.c (MAP_BASE_ADDR): New.

	* elf/dlfcn.h: Include <bits/dlfcn.h>.

	* elf/elf.h: Add MIPS support.

	* sysdeps/generic/Dist: Add entry.h.
	* sysdeps/generic/entry.h: New, define the entry symbol.

	* elf/rtld.c (_start): Include <entry.h>.  Change to ENTRY_POINT.
	* sysdeps/generic/dl-sysdep.c (_start): Likewise.
	* mips/elf/start.S (_start): Likewise.

	* sysdeps/mips/bsd-_setjmp.S: Fix PIC.
	* sysdeps/mips/bsd-setjmp.S: Likewise.
	* sysdeps/mips/setjmp.S: Likewise.
	* mips/elf/start.S: Likewise.
	* sysdeps/unix/mips/brk.S: Likewise.
	* sysdeps/unix/mips/sysdep.S: Likewise.
	* sysdeps/unix/mips/sysdep.h: Likewise.
	* sysdeps/unix/mips/wait.S: Likewise.

	* sysdeps/mips/dl-machine.h: Update for Linux/MIPS.
	* sysdeps/mips/fpu_control.h: Likewise.

	* sysdeps/generic/bits/dlfcn.h: New file.

	* sysdeps/mips/rtld-ldscript.in: New for Linux/MIPS.
	* sysdeps/mips/rtld-parms: Likewise.
	* sysdeps/mips/bits/dlfcn.h: Likewise.
	* sysdeps/mips/mips64/rtld-parms: Likewise.
	* sysdeps/mips/mipsel/rtld-parms: Likewise.
	* sysdeps/unix/sysv/linux/mips/Dist: Likewise.
	* sysdeps/unix/sysv/linux/mips/Makefile: Likewise.
	* sysdeps/unix/sysv/linux/mips/clone.S: Likewise.
	* sysdeps/unix/sysv/linux/mips/entry.h: Likewise.
	* sysdeps/unix/sysv/linux/mips/fpregdef.h: Likewise.
	* sysdeps/unix/sysv/linux/mips/fxstat.c: Likewise.
	* sysdeps/unix/sysv/linux/mips/kernel_sigaction.h: Likewise.
	* sysdeps/unix/sysv/linux/mips/kernel_stat.h: Likewise.
	* sysdeps/unix/sysv/linux/mips/kernel_termios.h: Likewise.
	* sysdeps/unix/sysv/linux/mips/lxstat.c: Likewise.
	* sysdeps/unix/sysv/linux/mips/regdef.h: Likewise.
	* sysdeps/unix/sysv/linux/mips/sgidefs.h: Likewise.
	* sysdeps/unix/sysv/linux/mips/syscalls.list: Likewise.
	* sysdeps/unix/sysv/linux/mips/ustat.c: Likewise.
	* sysdeps/unix/sysv/linux/mips/xmknod.c: Likewise.
	* sysdeps/unix/sysv/linux/mips/xstat.c: Likewise.
	* sysdeps/unix/sysv/linux/mips/bits/endian.h: Likewise.
	* sysdeps/unix/sysv/linux/mips/bits/fcntl.h: Likewise.
	* sysdeps/unix/sysv/linux/mips/bits/ioctl-types.h:
	* sysdeps/unix/sysv/linux/mips/bits/ipc.h: Likewise.
	* sysdeps/unix/sysv/linux/mips/bits/shm.h: Likewise.
	* sysdeps/unix/sysv/linux/mips/bits/sigaction.h: Likewise.
	* sysdeps/unix/sysv/linux/mips/bits/signum.h: Likewise.
	* sysdeps/unix/sysv/linux/mips/bits/socket.h: Likewise.
	* sysdeps/unix/sysv/linux/mips/bits/stat.h: Likewise.
	* sysdeps/unix/sysv/linux/mips/bits/statfs.h: Likewise.
	* sysdeps/unix/sysv/linux/mips/bits/termios.h: Likewise.
	* sysdeps/unix/sysv/linux/mips/bits/time.h: Likewise.
	* sysdeps/unix/sysv/linux/mips/sys/acct.h: Likewise.
	* sysdeps/unix/sysv/linux/mips/sys/asm.h: Likewise.
	* sysdeps/unix/sysv/linux/mips/sys/cachectl.h: Likewise.
	* sysdeps/unix/sysv/linux/mips/sys/fpregdef.h: Likewise.
	* sysdeps/unix/sysv/linux/mips/sys/procfs.h: Likewise.
	* sysdeps/unix/sysv/linux/mips/sys/regdef.h: Likewise.
	* sysdeps/unix/sysv/linux/mips/sys/syscall.h: Likewise.
	* sysdeps/unix/sysv/linux/mips/sys/sysmips.h: Likewise.

1997-04-09 19:05  H.J. Lu (hjl@gnu.ai.mit.edu)

	* isomac.c (xstrndup): New, use it instead of strndup ().

1997-07-02 08:55  H.J. Lu  <hjl@gnu.ai.mit.edu>

	* sysdeps/i386/dl-machine.h (elf_machine_rel): Print
	the program name for different sizes.

1997-07-10 15:47  Fila Kolodny  <fila@ibi.com>

	* nis/ypclnt.c: Change references to MAXHOSTNAMELEN to NIS_MAXNAMELEN.
	Add include of rpcsvc/nis.h.
	* inet/getnameinfo.c: Delete references to MAXHOSTNAMELEN.
	* sysdeps/posix/getaddrinfo.c: Likewise.
	Change size of variable buffer to be big enough to hold an IPv6
	address in printable format.

1997-07-12 18:47  Ulrich Drepper  <drepper@cygnus.com>

	* assert/assert.h [!NDEBUG] (assert, assert_perror): Don't use ||
	and && in tests to allow use in C++ code which overloads these
	operators.  Reported by Istvan Marko <istvan@cmdmail.amd.com>.

	* configure.in: Move mips64* recognition before mips*.
	Patch by Zack Weinberg <zack@rabi.phys.columbia.edu>.

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

	* Makerules (lib%.so, $(common-objpfx)libc.so): Don't use
	automatic variables in dependency lists.
	(build-shlib): Always filter out the version script file.
	* extra-lib.mk ($(objpfx)$(lib).so): Depend on version script.

1997-07-12 17:56  Ulrich Drepper  <drepper@cygnus.com>

	* login/login.c (tty_name): Test return value of ttyname_r for !=
	0, not < 0.
	* misc/ttyslot.c (ttyslot): Test return value of ttyname_r for ==
	0, not >= 0.
	* sysdeps/unix/getlogin.c (getlogin): Test return value of
	ttyname_r for != 0.
	* sysdeps/unix/getlogin_r.c (getlogin_r): Likewise.

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

	* login/utmp_file.c (getutline_r_file): Fix type: compare with
	*result.

1997-07-11 00:21  Mark Kettenis  <kettenis@phys.uva.nl>

	* login/Makefile (headers): Add utmpx.h and bits/utmpx.h.

1997-07-09 19:21  Mark Kettenis  <kettenis@phys.uva.nl>

	* login/programs/utmpd.c, login/programs/database.c,
	login/programs/request.c: Prepare messages for
	internationalization.

	* login/programs/utmpd.c:
	(main): Change handling of errors in opening the database.
	* login/programs/database.c:
	(open_database, synchronize_dtatabase, initialize_database):
	Properly handle errors.
	(get_mtime): Use fstat instead of stat.  All callers changed.

	* login/getutent_r.c: Make setutxent a weak alias for __setutxent.
	* login/getutent.c: Rename getutent to __getutent and make
	getutent a weak alias.
	Make getutxent a weak alias for	__getutent.
	* login/utmpx.h: New file.
	* sysdeps/gnu/bits/utmp.h: Cleanup.  Added comments.
	* sysdeps/gnu/bits/utmpx.h: New file.

	* stdio-common/strops.c: Partialy undo last change.  Will need
	more investigation.
Diffstat (limited to 'sysdeps/unix/sysv/linux/mips/bits')
-rw-r--r--sysdeps/unix/sysv/linux/mips/bits/endian.h12
-rw-r--r--sysdeps/unix/sysv/linux/mips/bits/fcntl.h100
-rw-r--r--sysdeps/unix/sysv/linux/mips/bits/ioctl-types.h71
-rw-r--r--sysdeps/unix/sysv/linux/mips/bits/ipc.h85
-rw-r--r--sysdeps/unix/sysv/linux/mips/bits/shm.h92
-rw-r--r--sysdeps/unix/sysv/linux/mips/bits/sigaction.h62
-rw-r--r--sysdeps/unix/sysv/linux/mips/bits/signum.h30
-rw-r--r--sysdeps/unix/sysv/linux/mips/bits/socket.h178
-rw-r--r--sysdeps/unix/sysv/linux/mips/bits/stat.h97
-rw-r--r--sysdeps/unix/sysv/linux/mips/bits/statfs.h44
-rw-r--r--sysdeps/unix/sysv/linux/mips/bits/termios.h260
-rw-r--r--sysdeps/unix/sysv/linux/mips/bits/time.h54
12 files changed, 1085 insertions, 0 deletions
diff --git a/sysdeps/unix/sysv/linux/mips/bits/endian.h b/sysdeps/unix/sysv/linux/mips/bits/endian.h
new file mode 100644
index 0000000000..9f60758f36
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/mips/bits/endian.h
@@ -0,0 +1,12 @@
+/* The MIPS architecture has selectable endianness.
+   Linux/MIPS exists in two both little and big endian flavours and we
+   want to be able to share the installed headerfiles between both,
+   so we define __BYTE_ORDER based on GCC's predefines.  */
+
+#ifdef __MIPSEB__
+#define __BYTE_ORDER __BIG_ENDIAN
+#else
+#ifdef __MIPSEL__
+#define __BYTE_ORDER __LITTLE_ENDIAN
+#endif
+#endif
diff --git a/sysdeps/unix/sysv/linux/mips/bits/fcntl.h b/sysdeps/unix/sysv/linux/mips/bits/fcntl.h
new file mode 100644
index 0000000000..2586140fdc
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/mips/bits/fcntl.h
@@ -0,0 +1,100 @@
+/* O_*, F_*, FD_* bit values for Linux.
+   Copyright (C) 1995, 1996, 1997 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   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 _FCNTL_H
+#error "Never use <bits/fcntl.h> directly; include <fcntl.h> instead."
+#endif
+
+#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.  */
+#endif
+/* open/fcntl - O_SYNC is only implemented on blocks devices and on files
+   located on an ext2 file system */
+#define O_ACCMODE	0x0003
+#define O_RDONLY	0x0000
+#define O_WRONLY	0x0001
+#define O_RDWR		0x0002
+#define O_APPEND	0x0008
+#define O_SYNC		0x0010
+#define O_NONBLOCK	0x0080
+#define O_CREAT         0x0100	/* not fcntl */
+#define O_TRUNC		0x0200	/* not fcntl */
+#define O_EXCL		0x0400	/* not fcntl */
+#define O_NOCTTY	0x0800	/* not fcntl */
+#define O_FSYNC		O_SYNC
+#define O_ASYNC		020000
+
+#define O_NDELAY	O_NONBLOCK
+
+#define F_DUPFD		0	/* dup */
+#define F_GETFD		1	/* get f_flags */
+#define F_SETFD		2	/* set f_flags */
+#define F_GETFL		3	/* more flags (cloexec) */
+#define F_SETFL		4
+#define F_GETLK		14
+#define F_SETLK		6
+#define F_SETLKW	7
+
+#define F_SETOWN	24	/*  for sockets. */
+#define F_GETOWN	23	/*  for sockets. */
+
+/* for F_[GET|SET]FL */
+#define FD_CLOEXEC	1	/* actually anything with low bit set goes */
+
+/* for posix fcntl() and lockf() */
+#define F_RDLCK		0
+#define F_WRLCK		1
+#define F_UNLCK		2
+
+/* for old implementation of bsd flock () */
+#define F_EXLCK		4	/* or 3 */
+#define F_SHLCK		8	/* or 4 */
+
+/* operations for bsd flock(), also used by the kernel implementation */
+#define LOCK_SH		1	/* shared lock */
+#define LOCK_EX		2	/* exclusive lock */
+#define LOCK_NB		4	/* or'd with one of the above to prevent		XXXXXXXXXXXXXXXXXX
+				   blocking */
+#define LOCK_UN		8	/* remove lock */
+
+typedef struct flock {
+	short l_type;
+	short l_whence;
+	__off_t l_start;
+	__off_t l_len;
+	long  l_sysid;			/* XXX */
+	__pid_t l_pid;
+	long  pad[4];			/* XXX */
+} flock_t;
+
+
+/* Define some more compatibility macros to be backward compatible with
+   BSD systems which did not managed to hide these kernel macros.  */
+#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/mips/bits/ioctl-types.h b/sysdeps/unix/sysv/linux/mips/bits/ioctl-types.h
new file mode 100644
index 0000000000..486022e6d9
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/mips/bits/ioctl-types.h
@@ -0,0 +1,71 @@
+/* Structure types for pre-termios terminal ioctls.  Linux/MIPS version.
+   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.  */
+
+/*
+ * Never include this file directly; use <sys/ioctl.h> instead.
+ */
+
+#ifndef _BITS_IOCTL_TYPES_H
+#define _BITS_IOCTL_TYPES_H 1
+
+/* Get definition of constants for use with `ioctl'.  */
+#include <asm/ioctls.h>
+
+struct winsize
+  {
+    unsigned short ws_row;
+    unsigned short ws_col;
+    unsigned short ws_xpixel;
+    unsigned short ws_ypixel;
+  };
+
+#define NCC	8
+struct termio
+  {
+    unsigned short c_iflag;		/* input mode flags */
+    unsigned short c_oflag;		/* output mode flags */
+    unsigned short c_cflag;		/* control mode flags */
+    unsigned short c_lflag;		/* local mode flags */
+    char c_line;			/* line discipline */
+    /* Yes, this is really NCCS.  */
+    unsigned char c_cc[32 /* NCCS */]; /* control characters */
+  };
+
+/* modem lines */
+#define TIOCM_LE	0x001		/* line enable */
+#define TIOCM_DTR	0x002		/* data terminal ready */
+#define TIOCM_RTS	0x004		/* request to send */
+#define TIOCM_ST	0x010		/* secondary transmit */
+#define TIOCM_SR	0x020		/* secondary receive */
+#define TIOCM_CTS	0x040		/* clear to send */
+#define TIOCM_CAR	0x100		/* carrier detect */
+#define TIOCM_CD	TIOCM_CAR
+#define TIOCM_RNG	0x200		/* ring */
+#define TIOCM_RI	TIOCM_RNG
+#define TIOCM_DSR	0x400		/* data set ready */
+
+/* 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
+
+#endif /* bits/ioctl-types.h */
diff --git a/sysdeps/unix/sysv/linux/mips/bits/ipc.h b/sysdeps/unix/sysv/linux/mips/bits/ipc.h
new file mode 100644
index 0000000000..c5a3cd0049
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/mips/bits/ipc.h
@@ -0,0 +1,85 @@
+/* Copyright (C) 1995, 1996, 1997 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Ulrich Drepper <drepper@gnu.ai.mit.edu>, August 1995.
+
+   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_IPC_BUF_H
+
+#define _SYS_IPC_BUF_H	1
+#include <features.h>
+
+#include <sys/types.h>
+
+/* Mode bits for `msgget', `semget', and `shmget'.  */
+#define IPC_CREAT	01000		/* Create key if key does not exist. */
+#define IPC_EXCL	02000		/* Fail if key exists.  */
+#define IPC_NOWAIT	04000		/* Return error on wait.  */
+
+/* Control commands for `msgctl', `semctl', and `shmctl'.  */
+#define IPC_RMID	0		/* Remove identifier.  */
+#define IPC_SET		1		/* Set `ipc_perm' options.  */
+#define IPC_STAT	2		/* Get `ipc_perm' options.  */
+#define IPC_INFO	3		/* See ipcs.  */
+
+
+__BEGIN_DECLS
+
+/* Special key values.  */
+#define IPC_PRIVATE	((__key_t) 0)	/* Private key.  */
+
+
+/* Data structure used to pass permission information to IPC operations.  */
+struct ipc_perm
+  {
+    __key_t __key;			/* Key.  */
+    long uid;				/* Owner's user ID.  */
+    long gid;				/* Owner's group ID.  */
+    long cuid;				/* Creator's user ID.  */
+    long cgid;				/* Creator's group ID.  */
+    unsigned long mode;			/* Read/write permission.  */
+    unsigned short int __seq;		/* Sequence number.  */
+  };
+
+
+/* Kludge to work around Linux' restriction of only up to five
+   arguments to a system call.  */
+struct ipc_kludge
+  {
+    void *msgp;
+    long int msgtyp;
+  };
+
+/* The actual system call: all functions are multiplexed by this.  */
+extern int __ipc __P ((int __call, int __first, int __second, int __third,
+		       void *__ptr));
+
+/* The codes for the functions to use the multiplexer `__ipc'.  */
+#define IPCOP_semop	 1
+#define IPCOP_semget	 2
+#define IPCOP_semctl	 3
+#define IPCOP_msgsnd	11
+#define IPCOP_msgrcv	12
+#define IPCOP_msgget	13
+#define IPCOP_msgctl	14
+#define IPCOP_shmat	21
+#define IPCOP_shmdt	22
+#define IPCOP_shmget	23
+#define IPCOP_shmctl	24
+
+__END_DECLS
+
+#endif /* bits/ipc_buf.h */
diff --git a/sysdeps/unix/sysv/linux/mips/bits/shm.h b/sysdeps/unix/sysv/linux/mips/bits/shm.h
new file mode 100644
index 0000000000..9d4b20bb53
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/mips/bits/shm.h
@@ -0,0 +1,92 @@
+/* Copyright (C) 1995, 1996, 1997 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Ulrich Drepper <drepper@gnu.ai.mit.edu>, August 1995.
+
+   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_SHM_BUF_H
+
+#define _SYS_SHM_BUF_H	1
+#include <features.h>
+
+#include <sys/types.h>
+
+/* Permission flag for shmget.  */
+#define SHM_R		0400		/* or S_IRUGO from <linux/stat.h> */
+#define SHM_W		0200		/* or S_IWUGO from <linux/stat.h> */
+
+/* Flags for `shmat'.  */
+#define SHM_RDONLY	010000		/* attach read-only else read-write */
+#define SHM_RND		020000		/* round attach address to SHMLBA */
+#define SHM_REMAP	040000		/* take-over region on attach */
+
+/* Commands for `shmctl'.  */
+#define SHM_LOCK	11		/* lock segment (root only) */
+#define SHM_UNLOCK	12		/* unlock segment (root only) */
+
+
+__BEGIN_DECLS
+
+/* Data structure describing a set of semaphores.  */
+struct shmid_ds
+{
+  struct ipc_perm shm_perm;		/* operation permission struct */
+  int shm_segsz;			/* size of segment in bytes */
+  __time_t shm_atime;			/* time of last shmat() */
+  __time_t shm_dtime;			/* time of last shmdt() */
+  __time_t shm_ctime;			/* time of last change by shmctl() */
+  long shm_cpid;			/* pid of creator */
+  long shm_lpid;			/* pid of last shmop */
+  unsigned short int shm_nattch;	/* number of current attaches */
+  unsigned short int __shm_npages;	/* size of segment (pages) */
+  unsigned long int *__shm_pages;	/* array of ptrs to frames -> SHMMAX */
+  struct vm_area_struct *__attaches;	/* descriptors for attaches */
+};
+
+#ifdef __USE_MISC
+
+/* ipcs ctl commands */
+#define SHM_STAT 	13
+#define SHM_INFO 	14
+
+/* shm_mode upper byte flags */
+#define	SHM_DEST	01000	/* segment will be destroyed on last detach */
+#define SHM_LOCKED      02000   /* segment will not be swapped */
+
+struct	shminfo
+{
+  int shmmax;
+  int shmmin;
+  int shmmni;
+  int shmseg;
+  int shmall;
+};
+
+struct shm_info
+{
+  int   used_ids;
+  ulong shm_tot;	/* total allocated shm */
+  ulong shm_rss;	/* total resident shm */
+  ulong shm_swp;	/* total swapped shm */
+  ulong swap_attempts;
+  ulong swap_successes;
+};
+
+#endif /* __USE_MISC */
+
+__END_DECLS
+
+#endif /* bits/shm_buf.h */
diff --git a/sysdeps/unix/sysv/linux/mips/bits/sigaction.h b/sysdeps/unix/sysv/linux/mips/bits/sigaction.h
new file mode 100644
index 0000000000..66c58cc540
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/mips/bits/sigaction.h
@@ -0,0 +1,62 @@
+/* The proper definitions for Linux/MIPS's sigaction.
+   Copyright (C) 1993, 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 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.  */
+
+/* Structure describing the action to be taken when a signal arrives.  */
+struct sigaction
+  {
+    /* Special flags.  */
+    unsigned int sa_flags;
+
+    /* Signal handler.  */
+    __sighandler_t sa_handler;
+
+    /* Additional set of signals to be blocked.  */
+    __sigset_t sa_mask;
+
+    /* The ABI says here are two unused ints following. */
+    /* Restore handler.  */
+    void (*sa_restorer) __P ((void));
+
+#if (_MIPS_ISA == _MIPS_ISA_MIPS1) || (_MIPS_ISA == _MIPS_ISA_MIPS2)
+    int sa_resv[1];
+#endif
+  };
+
+/* Bits in `sa_flags'.  */
+#define	SA_NOCLDSTOP 1		/* Don't send SIGCHLD when children stop.  */
+#ifdef __USE_MISC
+#define SA_STACK     0x08000000	/* Use signal stack by using `sa_restorer'.  */
+#define SA_RESTART   0x10000000	/* Don't restart syscall on signal return.  */
+#define SA_INTERRUPT 0x20000000	/* Historical no-op.  */
+#define SA_NODEFER   0x40000000	/* Don't automatically block the signal when
+				   its handler is being executed.  */
+#define SA_RESETHAND 0x80000000	/* Reset to SIG_DFL on entry to handler.  */
+
+/* Some aliases for the SA_ constants.  */
+#define SA_NOMASK	SA_NODEFER
+#define SA_ONESHOT	SA_RESETHAND
+#endif
+
+/* Values for the HOW argument to `sigprocmask'.  */
+#define SIG_NOP		0	/* 0 is unused to catch errors */
+#define	SIG_BLOCK	1	/* Block signals.  */
+#define	SIG_UNBLOCK	2	/* Unblock signals.  */
+#define	SIG_SETMASK	3	/* Set the set of blocked signals.  */
+#define SIG_SETMASK32	256	/* Goodie from SGI for BSD compatibility:
+				   set only the low 32 bit of the sigset.  */
diff --git a/sysdeps/unix/sysv/linux/mips/bits/signum.h b/sysdeps/unix/sysv/linux/mips/bits/signum.h
new file mode 100644
index 0000000000..5254a2b420
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/mips/bits/signum.h
@@ -0,0 +1,30 @@
+/* Signal number definitions.  Linux version.
+   Copyright (C) 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 distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Library General Public License for more details.
+
+   You should have received a copy of the GNU Library General Public
+   License along with the GNU C Library; see the file COPYING.LIB.  If not,
+   write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
+
+#ifdef	_SIGNAL_H
+
+/* Take these architecture specific stuff from the kernel header files.  */
+#define __need_fake_sigfuns
+#define __need_signums
+#include <asm/signal.h>
+
+#endif	/* <signal.h> included.  */
+
+#define __need__nsig
+#include <asm/signal.h>
diff --git a/sysdeps/unix/sysv/linux/mips/bits/socket.h b/sysdeps/unix/sysv/linux/mips/bits/socket.h
new file mode 100644
index 0000000000..15f420fc9c
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/mips/bits/socket.h
@@ -0,0 +1,178 @@
+/* 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 _SYS_SOCKET_H
+#error "Never include <bits/socket.h> directly; use <sys/socket.h> instead."
+#endif
+
+
+#include <features.h>
+
+#define	__need_size_t
+#define __need_NULL
+#include <stddef.h>
+
+
+__BEGIN_DECLS
+
+/* Supported address families. */
+#define PF_UNSPEC	0
+#define PF_UNIX		1		/* Unix domain sockets 		*/
+#define PF_LOCAL	1		/* POSIX name for AF_UNIX	*/
+#define PF_FILE		PF_LOCAL	/* POSIX name for PF_LOCAL.	*/
+#define PF_INET		2		/* Internet IP Protocol 	*/
+#define PF_AX25		3		/* Amateur Radio AX.25 		*/
+#define PF_IPX		4		/* Novell IPX 			*/
+#define PF_APPLETALK	5		/* Appletalk DDP 		*/
+#define PF_NETROM	6		/* Amateur Radio NET/ROM 	*/
+#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_ROSE		11		/* Amateur Radio X.25 PLP	*/
+#define PF_DECNET	12		/* Reserved for DECnet project	*/
+#define PF_NETBEUI	13		/* Reserved for 802.2LLC project*/
+#define PF_MAX		32		/* For now.. */
+
+/* Protocol families, same as address families. */
+#define AF_UNSPEC	PF_UNSPEC
+#define AF_UNIX		PF_UNIX
+#define AF_LOCAL	PF_LOCAL
+#define AF_FILE		PF_FILE
+#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_ROSE		PF_ROSE
+#define AF_DECNET	PF_DECNET
+#define AF_NETBEUI	PF_NETBEUI
+
+#define AF_MAX		PF_MAX
+
+/* Raw IP packet level.  */
+#define SOL_RAW		255
+
+/* Maximum queue length specifiable by listen.  */
+#define SOMAXCONN	128
+
+/* Get the definition of the macro to define the common sockaddr members.  */
+#include <bits/sockaddr.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.  */
+  };
+
+/* Structure used for storage of ancillary data object information.  */
+struct cmsghdr
+  {
+    int cmsg_len;		/* Length of data in cmsg_data plus length
+				   of cmsghdr structure.  */
+    /* XXX Should be type `size_t' according to POSIX.1g.  */
+    int cmsg_level;		/* Originating protocol.  */
+    int cmsg_type;		/* Protocol specific type.  */
+#if !defined __STRICT_ANSI__ && defined __GNUC__ && __GNUC__ >= 2
+    unsigned char __cmsg_data[0]; /* Ancillary data.  */
+#endif
+  };
+
+/* Ancillary data object manipulation macros.  */
+#if !defined __STRICT_ANSI__ && defined __GNUC__ && __GNUC__ >= 2
+# define CMSG_DATA(cmsg) ((cmsg)->__cmsg_data)
+#else
+# define CMSG_DATA(cmsg) ((unsigned char *) ((struct cmsghdr *) (cmsg) + 1))
+#endif
+#define CMSG_NXTHDR(mhdr, cmsg) __cmsg_nxthdr (mhdr, cmsg)
+#define CMSG_FIRSTHDR(mhdr) \
+  ((size_t) (mhdr)->msg_controllen >= sizeof (struct cmsghdr)			      \
+   ? (struct cmsghdr *) (mhdr)->msg_control : (struct cmsghdr *) NULL)
+
+
+#ifndef _EXTERN_INLINE
+# define _EXTERN_INLINE extern __inline
+#endif
+extern struct cmsghdr *__cmsg_nxthdr __P ((struct msghdr *__mhdr,
+					   struct cmsghdr *__cmsg));
+_EXTERN_INLINE struct cmsghdr *
+__cmsg_nxthdr (struct msghdr *__mhdr, struct cmsghdr *__cmsg)
+{
+  unsigned char *__p;
+
+  if ((size_t) __cmsg->cmsg_len < sizeof (struct cmsghdr))
+    /* The kernel header does this so there may be a reason.  */
+    return NULL;
+
+  __p = (((unsigned char *) __cmsg)
+	 + ((__cmsg->cmsg_len + sizeof (long int) - 1) & ~sizeof (long int)));
+  if (__p >= (unsigned char *) __mhdr->msg_control + __mhdr->msg_controllen)
+    /* No more entries.  */
+    return NULL;
+  return (struct cmsghdr *) __p;
+}
+
+
+/* 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
diff --git a/sysdeps/unix/sysv/linux/mips/bits/stat.h b/sysdeps/unix/sysv/linux/mips/bits/stat.h
new file mode 100644
index 0000000000..a797b34c38
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/mips/bits/stat.h
@@ -0,0 +1,97 @@
+/* Copyright (C) 1992, 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.  */
+
+/*
+ * Never include this file directly; use <sys/stat.h> instead.
+ */
+
+#ifndef _BITS_STAT_H
+#define _BITS_STAT_H	1
+
+/* Versions of the `struct stat' data structure.  */
+#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.  */
+#define _MKNOD_VER_LINUX	1
+#define _MKNOD_VER_SVR4		2
+#define _MKNOD_VER		_MKNOD_VER_LINUX /* The bits defined below.  */
+
+/* Structure describing file characteristics.  */
+struct stat
+  {
+    unsigned long int st_dev;
+    long int st_pad1[3];
+    __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.*/
+    unsigned long int st_rdev;	/* Device number, if device.  */
+    long int st_pad2[2];
+    __off_t st_size;		/* Size of file, in bytes.  */
+    /* SVR4 added this extra long to allow for expansion of off_t.  */
+    long int st_pad3;
+    /*
+     * Actually this should be timestruc_t st_atime, st_mtime and
+     * st_ctime but we don't have it under Linux.
+     */
+    __time_t st_atime;		/* Time of last access.  */
+    long int __reserved0;
+    __time_t st_mtime;		/* Time of last modification.  */
+    long int __reserved1;
+    __time_t st_ctime;		/* Time of last status change.  */
+    long int __reserved2;
+    long int st_blksize;	/* Optimal block size for I/O.  */
+#define	_STATBUF_ST_BLKSIZE	/* Tell code we have this member.  */
+    long int st_blocks;		/* Number of 512-byte blocks allocated.  */
+    char st_fstype[16];		/* Filesystem type name */
+    long int st_pad4[8];
+    /* Linux specific fields */
+    unsigned int st_flags;
+    unsigned int st_gen;
+  };
+
+
+/* Encoding of the file mode.  */
+
+#define	__S_IFMT	0170000	/* These bits determine file type.  */
+
+/* File types.  */
+#define	__S_IFDIR	0040000	/* Directory.  */
+#define	__S_IFCHR	0020000	/* Character device.  */
+#define	__S_IFBLK	0060000	/* Block device.  */
+#define	__S_IFREG	0100000	/* Regular file.  */
+#define	__S_IFIFO	0010000	/* FIFO.  */
+
+/* These don't actually exist on System V, but having them doesn't hurt.  */
+#define	__S_IFLNK	0120000	/* Symbolic link.  */
+#define	__S_IFSOCK	0140000	/* Socket.  */
+
+/* Protection bits.  */
+
+#define	__S_ISUID	04000	/* Set user ID on execution.  */
+#define	__S_ISGID	02000	/* Set group ID on execution.  */
+#define	__S_ISVTX	01000	/* Save swapped text after use (sticky).  */
+#define	__S_IREAD	0400	/* Read by owner.  */
+#define	__S_IWRITE	0200	/* Write by owner.  */
+#define	__S_IEXEC	0100	/* Execute by owner.  */
+
+#endif	/* bits/stat.h */
diff --git a/sysdeps/unix/sysv/linux/mips/bits/statfs.h b/sysdeps/unix/sysv/linux/mips/bits/statfs.h
new file mode 100644
index 0000000000..3b2306147c
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/mips/bits/statfs.h
@@ -0,0 +1,44 @@
+/* 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.  */
+
+/*
+ * Never include this file directly; use <sys/statfs.h> instead.
+ */
+
+#ifndef _BITS_STATFS_H
+#define _BITS_STATFS_H
+
+struct statfs
+  {
+    long int f_type;
+#define f_fstyp f_type
+    long int f_bsize;
+    long int f_frsize;	/* Fragment size - unsupported */
+    long int f_blocks;
+    long int f_bfree;
+    long int f_files;
+    long int f_ffree;
+
+	/* Linux specials */
+    long int f_bavail;
+    __fsid_t f_fsid;
+    long int f_namelen;
+    long int f_spare[6];
+  };
+
+#endif	/* bits/statfs.h */
diff --git a/sysdeps/unix/sysv/linux/mips/bits/termios.h b/sysdeps/unix/sysv/linux/mips/bits/termios.h
new file mode 100644
index 0000000000..c8a24694d9
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/mips/bits/termios.h
@@ -0,0 +1,260 @@
+/* termios type and macro definitions.  Linux/MIPS 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.  */
+
+/*
+ * Never include this file directly; use <termios.h> instead.
+ */
+
+
+#ifndef _BITS_TERMIOS_H
+#define _BITS_TERMIOS_H 1
+
+typedef unsigned char	cc_t;
+typedef unsigned int	speed_t;
+typedef unsigned int	tcflag_t;
+
+
+#if defined __USE_BSD
+
+struct sgttyb
+  {
+    char sg_ispeed;
+    char sg_ospeed;
+    char sg_erase;
+    char sg_kill;
+    int	sg_flags;	/* SGI special - int, not short */
+  };
+
+struct tchars
+  {
+    char t_intrc;
+    char t_quitc;
+    char t_startc;
+    char t_stopc;
+    char t_eofc;
+    char t_brkc;
+  };
+
+struct ltchars
+  {
+    char t_suspc;		/* stop process signal */
+    char t_dsuspc;		/* delayed stop process signal */
+    char t_rprntc;		/* reprint line */
+    char t_flushc;		/* flush output (toggles) */
+    char t_werasc;		/* word erase */
+    char t_lnextc;		/* literal next character */
+  };
+
+#endif /* defined(__BSD) */
+
+#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		/* Interrupt character [ISIG].  */
+#define VQUIT		 1		/* Quit character [ISIG].  */
+#define VERASE		 2		/* Erase character [ICANON].  */
+#define VKILL		 3		/* Kill-line character [ICANON].  */
+#define VMIN		 4		/* Minimum number of bytes read at once [!ICANON].  */
+#define VTIME		 5		/* Time-out value (tenths of a second) [!ICANON].  */
+#if defined (__USE_BSD)
+#define VEOL2		 6		/* Second EOL character [ICANON].  */
+/* The next two are guesses ... */
+#define VSWTC		 7		/* ??? */
+#endif
+#define VSWTCH		VSWTC
+#define VSTART		 8		/* Start (X-ON) character [IXON, IXOFF].  */
+#define VSTOP		 9		/* Stop (X-OFF) character [IXON, IXOFF].  */
+#define VSUSP		10		/* Suspend character [ISIG].  */
+#if 0
+/*
+ * VDSUSP is not supported
+ */
+#if defined (__USE_BSD)
+#define VDSUSP		11		/* Delayed suspend character [ISIG].  */
+#endif
+#endif
+#if defined (__USE_BSD)
+#define VREPRINT	12		/* Reprint-line character [ICANON].  */
+#endif
+#if defined (__USE_BSD)
+#define VDISCARD	13		/* Discard character [IEXTEN].  */
+#define VWERASE		14		/* Word-erase character [ICANON].  */
+#define VLNEXT		15		/* Literal-next character [IEXTEN].  */
+#endif
+#define VEOF		16		/* End-of-file character [ICANON].  */
+#define VEOL		17		/* End-of-line character [ICANON].  */
+
+/* c_iflag bits */
+#define IGNBRK	0000001		/* Ignore break condition.  */
+#define BRKINT	0000002		/* Signal interrupt on break.  */
+#define IGNPAR	0000004		/* Ignore characters with parity errors.  */
+#define PARMRK	0000010		/* Mark parity and framing errors.  */
+#define INPCK	0000020		/* Enable input parity check.  */
+#define ISTRIP	0000040		/* Strip 8th bit off characters.  */
+#define INLCR	0000100		/* Map NL to CR on input.  */
+#define IGNCR	0000200		/* Ignore CR.  */
+#define ICRNL	0000400		/* Map CR to NL on input.  */
+#if defined (__USE_BSD)
+#define IUCLC	0001000		/* Map upper case to lower case on input.  */
+#endif
+#define IXON	0002000		/* Enable start/stop output control.  */
+#if defined (__USE_BSD)
+#define IXANY	0004000		/* Any character will restart after stop.  */
+#endif
+#define IXOFF	0010000		/* Enable start/stop input control.  */
+#if defined (__USE_BSD)
+#define IMAXBEL	0020000		/* Ring bell when input queue is full.  */
+#endif
+
+/* c_oflag bits */
+#define OPOST	0000001		/* Perform output processing.  */
+#if defined (__USE_BSD)
+#define OLCUC	0000002		/* Map lower case to upper case on output.  */
+#define ONLCR	0000004		/* Map NL to CR-NL on output.  */
+#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
+/*
+#define PAGEOUT ???
+#define WRAP    ???
+ */
+#endif
+
+/* 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		/* Number of bits per byte (mask).  */
+#define   CS5	0000000		/* 5 bits per byte.  */
+#define   CS6	0000020		/* 6 bits per byte.  */
+#define   CS7	0000040		/* 7 bits per byte.  */
+#define   CS8	0000060		/* 8 bits per byte.  */
+#define CSTOPB	0000100		/* Two stop bits instead of one.  */
+#define CREAD	0000200		/* Enable receiver.  */
+#define PARENB	0000400		/* Parity enable.  */
+#define PARODD	0001000		/* Odd parity instead of even.  */
+#define HUPCL	0002000		/* Hang up on last close.  */
+#define CLOCAL	0004000		/* Ignore modem status lines.  */
+#if defined (__USE_BSD)
+#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 */
+#endif
+
+/* c_lflag bits */
+#define ISIG	0000001		/* Enable signals.  */
+#define ICANON	0000002		/* Do erase and kill processing.  */
+#define XCASE	0000004
+#define ECHO	0000010		/* Enable echo.  */
+#define ECHOE	0000020		/* Visual erase for ERASE.  */
+#define ECHOK	0000040		/* Echo NL after KILL.  */
+#define ECHONL	0000100		/* Echo NL even if ECHO is off.  */
+#define NOFLSH	0000200		/* Disable flush after interrupt.  */
+#define IEXTEN	0000400		/* Enable DISCARD and LNEXT.  */
+#if defined (__USE_BSD)
+#define ECHOCTL	0001000		/* Echo control characters as ^X.  */
+#define ECHOPRT	0002000		/* Hardcopy visual erase.  */
+#define ECHOKE	0004000		/* Visual erase for KILL.  */
+#endif
+#define FLUSHO	0020000
+#if defined (__USE_BSD)
+#define PENDIN	0040000		/* Retype pending input (state).  */
+#endif
+#define TOSTOP	0100000		/* Send SIGTTOU for background output.  */
+#define ITOSTOP	TOSTOP
+
+/* ioctl (fd, TIOCSERGETLSR, &result) where result may be as below */
+#define TIOCSER_TEMT    0x01	/* Transmitter physically empty */
+
+/* tcflow() and TCXONC use these */
+#define	TCOOFF		0	/* Suspend output.  */
+#define	TCOON		1	/* Restart suspended output.  */
+#define	TCIOFF		2	/* Send a STOP character.  */
+#define	TCION		3	/* Send a START character.  */
+
+/* tcflush() and TCFLSH use these */
+#define	TCIFLUSH	0	/* Discard data received but not yet read.  */
+#define	TCOFLUSH	1	/* Discard data written but not yet sent.  */
+#define	TCIOFLUSH	2	/* Discard all pending data.  */
+
+/* tcsetattr uses these */
+#define	TCSANOW		0x540e	/* Same as TCSETS; change immediately.  */
+#define	TCSADRAIN	0x540f	/* Same as TCSETSW; change when pending output is written.  */
+#define	TCSAFLUSH	0x5410	/* Same as TCSETSF; flush pending input before changing.  */
+
+#define _IOT_termios /* Hurd ioctl type field.  */ \
+  _IOT (_IOTS (cflag_t), 4, _IOTS (cc_t), NCCS, _IOTS (speed_t), 2)
+
+#endif /* bits/termios.h */
diff --git a/sysdeps/unix/sysv/linux/mips/bits/time.h b/sysdeps/unix/sysv/linux/mips/bits/time.h
new file mode 100644
index 0000000000..5fcef0fb8c
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/mips/bits/time.h
@@ -0,0 +1,54 @@
+/* System-dependent timing definitions.  Linux/MIPS 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.  */
+
+/*
+ * Never include this file directly; use <time.h> instead.
+ */
+
+#ifdef __need_timeval
+# undef __need_timeval
+# ifndef _STRUCT_TIMEVAL
+#  define _STRUCT_TIMEVAL	1
+/* A time value that is accurate to the nearest
+   microsecond but also has a range of years.  */
+struct timeval
+  {
+    long tv_sec;			/* Seconds.  */
+    long tv_usec;		/* Microseconds.  */
+  };
+# endif	/* struct timeval */
+#endif	/* need timeval */
+
+
+#ifndef _BITS_TIME_H
+#define _BITS_TIME_H	1
+
+/* ISO/IEC 9899:1990 7.12.1: <time.h>
+   The macro `CLOCKS_PER_SEC' is the number per second of the value
+   returned by the `clock' function. */
+/* CAE XSH, Issue 4, Version 2: <time.h>
+   The value of CLOCKS_PER_SEC is required to be 1 million on all
+   XSI-conformant systems. */
+# define CLOCKS_PER_SEC  1000000
+
+/* Even though CLOCKS_PER_SEC has such a strange value CLK_TCK
+   presents the real value for clock ticks per second for the system.  */
+# define CLK_TCK 100		/* XXX not correct for all systems.  */
+
+#endif  /* bits/time.h */