about summary refs log tree commit diff
path: root/sysdeps
diff options
context:
space:
mode:
Diffstat (limited to 'sysdeps')
-rw-r--r--sysdeps/alpha/_mcount.S2
-rw-r--r--sysdeps/alpha/bb_init_func.S9
-rw-r--r--sysdeps/alpha/bsd-_setjmp.S4
-rw-r--r--sysdeps/alpha/bsd-setjmp.S2
-rw-r--r--sysdeps/alpha/copysign.S2
-rw-r--r--sysdeps/alpha/divrem.h6
-rw-r--r--sysdeps/alpha/fabs.S2
-rw-r--r--sysdeps/alpha/ffs.S2
-rw-r--r--sysdeps/alpha/htonl.S2
-rw-r--r--sysdeps/alpha/htons.S2
-rw-r--r--sysdeps/alpha/memchr.S2
-rw-r--r--sysdeps/alpha/setjmp.S2
-rw-r--r--sysdeps/alpha/strlen.S2
-rw-r--r--sysdeps/gnu/utmpbits.h2
-rw-r--r--sysdeps/posix/tempname.c2
-rw-r--r--sysdeps/unix/alpha/sysdep.h4
-rw-r--r--sysdeps/unix/bsd/osf/alpha/brk.S2
-rw-r--r--sysdeps/unix/make-syscalls.sh3
-rw-r--r--sysdeps/unix/sysdep.h4
-rw-r--r--sysdeps/unix/sysv/linux/Makefile4
-rw-r--r--sysdeps/unix/sysv/linux/alpha/brk.S20
-rw-r--r--sysdeps/unix/sysv/linux/alpha/ieee_get_fp_control.S2
-rw-r--r--sysdeps/unix/sysv/linux/alpha/ieee_set_fp_control.S2
-rw-r--r--sysdeps/unix/sysv/linux/alpha/llseek.S2
-rw-r--r--sysdeps/unix/sysv/linux/alpha/pipe.S2
-rw-r--r--sysdeps/unix/sysv/linux/alpha/sigsuspend.S2
-rw-r--r--sysdeps/unix/sysv/linux/alpha/speed.c103
-rw-r--r--sysdeps/unix/sysv/linux/speed.c2
-rw-r--r--sysdeps/unix/sysv/linux/sys/io.h39
-rw-r--r--sysdeps/unix/sysv/linux/sys/kdaemon.h9
-rw-r--r--sysdeps/unix/sysv/linux/sys/klog.h10
-rw-r--r--sysdeps/unix/sysv/linux/sys/module.h36
-rw-r--r--sysdeps/unix/sysv/linux/sys/msq_buf.h22
-rw-r--r--sysdeps/unix/sysv/linux/sys/param.h2
-rw-r--r--sysdeps/unix/sysv/linux/sys/sem_buf.h21
-rw-r--r--sysdeps/unix/sysv/linux/sys/shm_buf.h37
-rw-r--r--sysdeps/unix/sysv/linux/syscalls.list10
37 files changed, 228 insertions, 153 deletions
diff --git a/sysdeps/alpha/_mcount.S b/sysdeps/alpha/_mcount.S
index 7944544e18..1730760316 100644
--- a/sysdeps/alpha/_mcount.S
+++ b/sysdeps/alpha/_mcount.S
@@ -106,4 +106,4 @@ LEAF(_mcount, 0xb0)
 	addq	sp, 0xb0, sp
 	ret	zero,($at),1
 
-	.end _mcount
+	END(_mcount)
diff --git a/sysdeps/alpha/bb_init_func.S b/sysdeps/alpha/bb_init_func.S
index cd860b8303..dfa8c1d07b 100644
--- a/sysdeps/alpha/bb_init_func.S
+++ b/sysdeps/alpha/bb_init_func.S
@@ -41,10 +41,11 @@ ENTRY(__bb_init_func)
 	beq	t0, init		/* not initialized yet -> */
 	ret
 	
-	.end __bb_init_func
+END(__bb_init_func)
 
-
-LEAF(init, 0x38)
+.ent init
+init:
+	.frame	sp, 0x38, ra, 0
 	subq	sp, 0x38, sp
 	.prologue 0
 
@@ -84,4 +85,4 @@ leave:	ldq	pv, 0x30(sp)
 	addq	sp, 0x38, sp
 	ret
 
-	.end init
+.end init
diff --git a/sysdeps/alpha/bsd-_setjmp.S b/sysdeps/alpha/bsd-_setjmp.S
index 16709dfc09..da60442c23 100644
--- a/sysdeps/alpha/bsd-_setjmp.S
+++ b/sysdeps/alpha/bsd-_setjmp.S
@@ -23,8 +23,8 @@ Cambridge, MA 02139, USA.  */
 
 #include <sysdep.h>
 
-ENTRY(setjmp)
+ENTRY(_setjmp)
 	lda	$27, __sigsetjmp	/* Load address to jump to.  */
 	bis	$31, $31, $17		/* Pass a second argument of zero.  */
 	jmp	$31, ($27), __sigsetjmp /* Call __sigsetjmp.  */
-	.end setjmp
+	END(_setjmp)
diff --git a/sysdeps/alpha/bsd-setjmp.S b/sysdeps/alpha/bsd-setjmp.S
index 113bc47c88..fc73815a84 100644
--- a/sysdeps/alpha/bsd-setjmp.S
+++ b/sysdeps/alpha/bsd-setjmp.S
@@ -27,4 +27,4 @@ ENTRY(setjmp)
 	lda	$27, __sigsetjmp	/* Load address to jump to.  */
 	bis	$31, 1, $17		/* Pass a second argument of one.  */
 	jmp	$31, ($27), __sigsetjmp /* Call __sigsetjmp.  */
-	.end setjmp
+	END(setjmp)
diff --git a/sysdeps/alpha/copysign.S b/sysdeps/alpha/copysign.S
index 9e9dff3ed0..95eb608666 100644
--- a/sysdeps/alpha/copysign.S
+++ b/sysdeps/alpha/copysign.S
@@ -24,6 +24,6 @@ ENTRY(__copysign)
 	cpys	$f17,$f16,$f0
 	ret
 
-	.end __copysign
+	END(__copysign)
 
 weak_alias(__copysign, copysign)
diff --git a/sysdeps/alpha/divrem.h b/sysdeps/alpha/divrem.h
index ee7f64ef1e..f296179e99 100644
--- a/sysdeps/alpha/divrem.h
+++ b/sysdeps/alpha/divrem.h
@@ -32,12 +32,12 @@ sequence, these expect their arguments in registers t10 and t11, and
 return the result in t12 (aka pv). Registers AT and v0 may be
 clobbered (assembly temporary), anything else must be saved.  */
 
+#include <sysdep.h>
+
 #ifdef __linux__
-# include <alpha/regdef.h>
 # include <asm/gentrap.h>
 # include <asm/pal.h>
 #else
-# include <regdef.h>
 # include <machine/pal.h>
 #endif
 
@@ -185,4 +185,4 @@ divbyzero:
 	ldq	arg1,0x00(sp)
 	br	done
 
-	.end FUNC_NAME
+	END(FUNC_NAME)
diff --git a/sysdeps/alpha/fabs.S b/sysdeps/alpha/fabs.S
index 88e64b4718..dff8390b5a 100644
--- a/sysdeps/alpha/fabs.S
+++ b/sysdeps/alpha/fabs.S
@@ -24,4 +24,4 @@ ENTRY(fabs)
 	cpys	$f31,$f16,$f0
 	ret
 
-	.end fabs
+	END(fabs)
diff --git a/sysdeps/alpha/ffs.S b/sysdeps/alpha/ffs.S
index 7cf6281682..e4dd87c9f1 100644
--- a/sysdeps/alpha/ffs.S
+++ b/sysdeps/alpha/ffs.S
@@ -63,4 +63,4 @@ ENTRY(ffs)
 
 done:   ret
 
-        .end    ffs
+        END(ffs)
diff --git a/sysdeps/alpha/htonl.S b/sysdeps/alpha/htonl.S
index 8c1c700212..9777e461cc 100644
--- a/sysdeps/alpha/htonl.S
+++ b/sysdeps/alpha/htonl.S
@@ -31,7 +31,7 @@ ENTRY(__htonl)
 	or	t2, v0, v0	# v0 = ddccbbaa
 	ret
 
-	.end	__htonl
+	END(__htonl)
 
 strong_alias_asm(__htonl, __ntohl)
 weak_alias(__htonl, htonl)
diff --git a/sysdeps/alpha/htons.S b/sysdeps/alpha/htons.S
index cb22b21661..7717636782 100644
--- a/sysdeps/alpha/htons.S
+++ b/sysdeps/alpha/htons.S
@@ -25,7 +25,7 @@ ENTRY(__htons)
 	bis	v0, t1, v0	# v0 = bbaa
 	ret
 
-	.end	__htons
+	END(__htons)
 
 strong_alias_asm(__htons, __ntohs)
 weak_alias(__htons, htons)
diff --git a/sysdeps/alpha/memchr.S b/sysdeps/alpha/memchr.S
index 2f78697418..2d21247174 100644
--- a/sysdeps/alpha/memchr.S
+++ b/sysdeps/alpha/memchr.S
@@ -157,4 +157,4 @@ not_found:
 	mov	zero, v0
 	ret
 
-        .end    memchr
+        END(memchr)
diff --git a/sysdeps/alpha/setjmp.S b/sysdeps/alpha/setjmp.S
index b165d2c2c8..da71a3292a 100644
--- a/sysdeps/alpha/setjmp.S
+++ b/sysdeps/alpha/setjmp.S
@@ -30,4 +30,4 @@ ENTRY (__sigsetjmp)
 	bis	$15, $15, $19		/* Pass FP as 4th arg.  */
 	jmp	$31, ($27), __sigsetjmp_aux /* Call __sigsetjmp_aux.  */
 
-	.end __sigsetjmp
+	END(__sigsetjmp)
diff --git a/sysdeps/alpha/strlen.S b/sysdeps/alpha/strlen.S
index c64126164a..15c78cde64 100644
--- a/sysdeps/alpha/strlen.S
+++ b/sysdeps/alpha/strlen.S
@@ -67,4 +67,4 @@ found:  blbs    t1, done        # make aligned case fast
 done:   subq    v0, a0, v0
         ret
 
-        .end    strlen
+        END(strlen)
diff --git a/sysdeps/gnu/utmpbits.h b/sysdeps/gnu/utmpbits.h
index e8c41f8814..2244ecbf75 100644
--- a/sysdeps/gnu/utmpbits.h
+++ b/sysdeps/gnu/utmpbits.h
@@ -69,8 +69,8 @@ struct utmp
   char ut_user[UT_NAMESIZE];	/* Username (not NUL terminated).  */
   char ut_host[UT_HOSTSIZE];	/* Hostname for remote login.  */
   int ut_exit;			/* Process termination/exit status.  */
-  struct timeval ut_tv;		/* Time entry was made.  */
   long ut_session;		/* Session ID, used for windowing.  */
+  struct timeval ut_tv;		/* Time entry was made.  */
   int32_t ut_addr;		/* Internet address of remote host.  */
   char pad[32];			/* Reserved for future use.  */
 };
diff --git a/sysdeps/posix/tempname.c b/sysdeps/posix/tempname.c
index fdddae2d0c..5881febf81 100644
--- a/sysdeps/posix/tempname.c
+++ b/sysdeps/posix/tempname.c
@@ -218,7 +218,7 @@ __stdio_gen_tempname (const char *dir, const char *pfx, int dir_search,
 		  errno = save;
 		  return NULL;
 		}
-	      (*streamptr)->__cookie = (PTR) (long int) fd;
+	      (*streamptr)->__cookie = (__ptr_t) (long int) fd;
 	      (*streamptr)->__mode.__write = 1;
 	      (*streamptr)->__mode.__read = 1;
 	      (*streamptr)->__mode.__binary = 1;
diff --git a/sysdeps/unix/alpha/sysdep.h b/sysdeps/unix/alpha/sysdep.h
index 8a52f201e1..6fed4a6adf 100644
--- a/sysdeps/unix/alpha/sysdep.h
+++ b/sysdeps/unix/alpha/sysdep.h
@@ -97,7 +97,9 @@ name/**/:					\
 3:
 #endif
 
-#define ret	ret	zero,(ra),1
+#undef END
+#define END(sym)	.end sym
+
 #define r0	v0
 #define r1	a4
 
diff --git a/sysdeps/unix/bsd/osf/alpha/brk.S b/sysdeps/unix/bsd/osf/alpha/brk.S
index 6e4bd2cc71..105e40100b 100644
--- a/sysdeps/unix/bsd/osf/alpha/brk.S
+++ b/sysdeps/unix/bsd/osf/alpha/brk.S
@@ -41,7 +41,7 @@ ENTRY(__brk)
 
 	/* Update __curbrk and exit cleanly.  */
 /*	ldgp gp, 0(t12) */
-	stl a0, __curbrk
+	stq a0, __curbrk
 
 	mov zero, v0
 	ret
diff --git a/sysdeps/unix/make-syscalls.sh b/sysdeps/unix/make-syscalls.sh
index ff4b082b11..5251e84cb9 100644
--- a/sysdeps/unix/make-syscalls.sh
+++ b/sysdeps/unix/make-syscalls.sh
@@ -61,7 +61,8 @@ EOF
 \$(foreach o,\$(object-suffixes),\$(objpfx)$file\$o): \$(objpfx)s-proto.d
 	(echo '#include <sysdep.h>'; \\
 	 echo 'PSEUDO ($strong, $syscall, $nargs)'; \\
-	 echo '	ret'; \\"
+	 echo '	ret'; \\
+	 echo 'END($strong)'; \\"
 
   # Append any weak aliases defined for this syscall function.
   for name in $weak; do
diff --git a/sysdeps/unix/sysdep.h b/sysdeps/unix/sysdep.h
index 456970638c..0dde0b04a6 100644
--- a/sysdeps/unix/sysdep.h
+++ b/sysdeps/unix/sysdep.h
@@ -54,3 +54,7 @@ Cambridge, MA 02139, USA.  */
 #else
 #define SYS_ify(syscall_name) SYS_/**/syscall_name
 #endif
+
+/* Terminate a function named SYM.  This is used on some platforms to
+   generate correct debugging information.  */
+#define END(sym)
diff --git a/sysdeps/unix/sysv/linux/Makefile b/sysdeps/unix/sysv/linux/Makefile
index 406c338025..412227a320 100644
--- a/sysdeps/unix/sysv/linux/Makefile
+++ b/sysdeps/unix/sysv/linux/Makefile
@@ -17,7 +17,9 @@ endif
 ifeq ($(subdir), misc)
 sysdep_routines += mount umount xmknod s_ptrace s_sysctl sysctl llseek \
 setfsgid setfsuid sysinfo uselib s_reboot
-headers += sys/mount.h sys/sysinfo.h sys/acct.h sys/sysctl.h
+
+headers += sys/mount.h sys/sysinfo.h sys/acct.h sys/sysctl.h sys/module.h \
+	sys/io.h sys/klog.h sys/kdaemon.h
 
 install-others += $(includedir)/sys/syscall.h
 
diff --git a/sysdeps/unix/sysv/linux/alpha/brk.S b/sysdeps/unix/sysv/linux/alpha/brk.S
index 4582539bc1..1c4a4f9217 100644
--- a/sysdeps/unix/sysv/linux/alpha/brk.S
+++ b/sysdeps/unix/sysv/linux/alpha/brk.S
@@ -23,17 +23,7 @@ break value (instead of the new, requested one).  */
 #include <sysdep.h>
 #include <errnos.h>
 
-#ifndef       HAVE_GNU_LD
-#define _end           end
-#endif
-
-	.extern _end,8
-
-	.data
-
-	.globl __curbrk
-__curbrk:
-	.quad _end
+.comm __curbrk, 8
 
 	.text
 LEAF(__brk, 0)
@@ -42,11 +32,15 @@ LEAF(__brk, 0)
 
 	ldi	v0, __NR_brk
 	call_pal PAL_callsys
+
+	/* Correctly handle the brk(0) query case.  */
+	cmoveq	a0, v0, a0
+
 	subq	a0, v0, t0
 	bne	t0, error
 
 	/* Update __curbrk and return cleanly.  */
-	stl	a0, __curbrk
+	stq	a0, __curbrk
 	mov	zero, v0
 	ret
 
@@ -54,6 +48,6 @@ LEAF(__brk, 0)
 error:	ldi	v0, ENOMEM
 	jmp	zero, syscall_error
 
-	.end __brk
+	END(__brk)
 
 weak_alias (__brk, brk)
diff --git a/sysdeps/unix/sysv/linux/alpha/ieee_get_fp_control.S b/sysdeps/unix/sysv/linux/alpha/ieee_get_fp_control.S
index c3486acc1a..52c945aec2 100644
--- a/sysdeps/unix/sysv/linux/alpha/ieee_get_fp_control.S
+++ b/sysdeps/unix/sysv/linux/alpha/ieee_get_fp_control.S
@@ -41,6 +41,6 @@ error:	lda	sp, 8(sp)
 1:	ldgp	gp, 0(gp)
 	jmp	zero, syscall_error
 
-	.end __ieee_get_fp_control
+	END(__ieee_get_fp_control)
 
 weak_alias (__ieee_get_fp_control, ieee_get_fp_control)
diff --git a/sysdeps/unix/sysv/linux/alpha/ieee_set_fp_control.S b/sysdeps/unix/sysv/linux/alpha/ieee_set_fp_control.S
index 507b5d5cab..d72585daf1 100644
--- a/sysdeps/unix/sysv/linux/alpha/ieee_set_fp_control.S
+++ b/sysdeps/unix/sysv/linux/alpha/ieee_set_fp_control.S
@@ -39,6 +39,6 @@ error:	br	gp, 1f
 1:	ldgp	gp, 0(gp)
 	jmp	zero, syscall_error
 
-	.end __ieee_set_fp_control
+	END(__ieee_set_fp_control)
 
 weak_alias (__ieee_set_fp_control, ieee_set_fp_control)
diff --git a/sysdeps/unix/sysv/linux/alpha/llseek.S b/sysdeps/unix/sysv/linux/alpha/llseek.S
index 7f2a49172a..bd8c6595c9 100644
--- a/sysdeps/unix/sysv/linux/alpha/llseek.S
+++ b/sysdeps/unix/sysv/linux/alpha/llseek.S
@@ -46,4 +46,4 @@ error:	br	gp, 1f
 1:	ldgp	gp, 0(gp)
 	jmp	zero, syscall_error
 
-	.end llseek
+	END(llseek)
diff --git a/sysdeps/unix/sysv/linux/alpha/pipe.S b/sysdeps/unix/sysv/linux/alpha/pipe.S
index 40958466a4..b23803cecd 100644
--- a/sysdeps/unix/sysv/linux/alpha/pipe.S
+++ b/sysdeps/unix/sysv/linux/alpha/pipe.S
@@ -37,6 +37,6 @@ error:	br	gp, 1f
 1:	ldgp	gp, 0(gp)
 	jmp	zero, syscall_error
 
-	.end __pipe
+	END(__pipe)
 
 weak_alias (__pipe, pipe)
diff --git a/sysdeps/unix/sysv/linux/alpha/sigsuspend.S b/sysdeps/unix/sysv/linux/alpha/sigsuspend.S
index 00c02de72b..26a1869783 100644
--- a/sysdeps/unix/sysv/linux/alpha/sigsuspend.S
+++ b/sysdeps/unix/sysv/linux/alpha/sigsuspend.S
@@ -36,4 +36,4 @@ error:	br	gp, 1f
 1:	ldgp	gp, 0(gp)
 	jmp	zero, syscall_error
 
-	.end sigsuspend
+	END(sigsuspend)
diff --git a/sysdeps/unix/sysv/linux/alpha/speed.c b/sysdeps/unix/sysv/linux/alpha/speed.c
deleted file mode 100644
index 40bf6c50bb..0000000000
--- a/sysdeps/unix/sysv/linux/alpha/speed.c
+++ /dev/null
@@ -1,103 +0,0 @@
-/* `struct termios' speed frobnication functions.  Linux version.
-Copyright (C) 1991, 1992, 1993, 1995 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., 675 Mass Ave,
-Cambridge, MA 02139, USA.  */
-
-#include <stddef.h>
-#include <errno.h>
-#include <termios.h>
-
-static const speed_t speeds[] =
-  {
-    0,
-    50,
-    75,
-    110,
-    134,
-    150,
-    200,
-    300,
-    600,
-    1200,
-    1800,
-    2400,
-    4800,
-    9600,
-    19200,
-    38400,
-    57600,
-    115200,
-    230400,
-    460800,
-  };
-
-
-/* Return the output baud rate stored in *TERMIOS_P.  */
-speed_t
-cfgetospeed (termios_p)
-     const struct termios *termios_p;
-{
-  speed_t retval = termios_p->c_cflag & (CBAUD | CBAUDEX);
-
-  if (retval & CBAUDEX)
-    {
-      retval &= ~CBAUDEX;
-      retval |= CBAUD + 1;
-    }
-
-  return retval;
-}
-
-/* Return the input baud rate stored in *TERMIOS_P.
-   For Linux there is no difference between input and output speed.  */
-strong_alias (cfgetospeed, cfgetispeed);
-
-/* Set the output baud rate stored in *TERMIOS_P to SPEED.  */
-int
-cfsetospeed  (termios_p, speed) 
-     struct termios *termios_p;
-     speed_t speed;
-{
-  register unsigned int i;
-
-  if (termios_p == NULL)
-    {
-      errno = EINVAL;
-      return -1;
-    }
-
-  /* This allows either B1200 or 1200 to work.	XXX
-     Do we really want to try to support this, given that
-     fetching the speed must return one or the other?  */
-
-  for (i = 0; i < sizeof (speeds) / sizeof (speeds[0]); ++i)
-    if (i == speed || speeds[i] == speed)
-      {
-	termios_p->c_cflag &= ~(CBAUD | CBAUDEX);
-	termios_p->c_cflag |= (i & CBAUD);
-	if (i & ~CBAUD)
-	  termios_p->c_cflag |= CBAUDEX;
-	return 0;
-      }
-
-  errno = EINVAL;
-  return -1;
-}
-
-/* Set the input baud rate stored in *TERMIOS_P to SPEED.
-   For Linux there is no difference between input and output speed.  */
-strong_alias (cfsetospeed, cfsetispeed);
diff --git a/sysdeps/unix/sysv/linux/speed.c b/sysdeps/unix/sysv/linux/speed.c
index d229f766f9..0ad48a23d8 100644
--- a/sysdeps/unix/sysv/linux/speed.c
+++ b/sysdeps/unix/sysv/linux/speed.c
@@ -39,7 +39,9 @@ static const speed_t speeds[] =
     9600,
     19200,
     38400,
+#ifndef __alpha__
     38400,		/* Mention this twice here is a trick.  */
+#endif
     57600,
     115200,
     230400,
diff --git a/sysdeps/unix/sysv/linux/sys/io.h b/sysdeps/unix/sysv/linux/sys/io.h
new file mode 100644
index 0000000000..d44850f025
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/sys/io.h
@@ -0,0 +1,39 @@
+/* Copyright (C) 1996 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., 675 Mass Ave,
+Cambridge, MA 02139, USA.  */
+
+#ifndef _SYS_IO_H
+#define _SYS_IO_H
+
+#include <asm/io.h>
+
+/* If TURN_ON is TRUE, request for permission to do direct i/o on the
+   port numbers in the range [FROM,FROM+NUM-1].  Otherwise, turn I/O
+   permission off for that range.  This call requires root privileges.
+
+   Portability note: not all Linux platforms support this call.  Most
+   platforms based on the PC I/O architecture probably will, however.
+   E.g., Linux/Alpha for Alpha PCs supports this.  */
+extern int ioperm __P((unsigned long __from, unsigned long __num,
+		       int __turn_on));
+
+/* Set the I/O privilege level to LEVEL.  If LEVEL>3, permission to
+   access any I/O port is granted.  This call requires root
+   privileges. */
+extern int iopl __P((int __level));
+
+#endif /* _SYS_IO_H */
diff --git a/sysdeps/unix/sysv/linux/sys/kdaemon.h b/sysdeps/unix/sysv/linux/sys/kdaemon.h
new file mode 100644
index 0000000000..fce169fe6b
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/sys/kdaemon.h
@@ -0,0 +1,9 @@
+/* Interfaces to control the various kernel daemons.  */
+
+#ifndef _SYS_KDAEMON_H
+#define _SYS_KDAEMON_H
+
+/* Start, flush, or tune the kernel's buffer flushing daemon.  */
+extern int bdflush (int func, long data);
+
+#endif /* _SYS_KDAEMON_H */
diff --git a/sysdeps/unix/sysv/linux/sys/klog.h b/sysdeps/unix/sysv/linux/sys/klog.h
new file mode 100644
index 0000000000..b8a39d6492
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/sys/klog.h
@@ -0,0 +1,10 @@
+#ifndef _SYS_KLOG_H
+#define _SYS_KLOG_H
+
+/* Control the kernel's logging facility.  This corresponds exactly to
+   the kernel's syslog system call, but that name is easily confused
+   with the user-level syslog facility, which is something completely
+   different.  */
+extern int klogctl __P((int type, char *bufp, int len));
+
+#endif /* _SYS_KLOG_H */
diff --git a/sysdeps/unix/sysv/linux/sys/module.h b/sysdeps/unix/sysv/linux/sys/module.h
new file mode 100644
index 0000000000..5c4dbcea37
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/sys/module.h
@@ -0,0 +1,36 @@
+#ifndef _SYS_MODULE_H
+#define _SYS_MODULE_H
+
+#include <features.h>
+
+#include <linux/module.h>
+
+/* Return number of kernel symbols if TABLE == NULL, otherwise, return
+   kernel symbols in TABLE.  TABLE must be large enough to hold all
+   kernel symbols.  */
+extern int get_kernel_syms __P((struct kernel_sym * table));
+
+/* Create a new module of name MODULE_NAME and of size SIZE bytes.
+   The return address is the starting address of the new module or -1L
+   if the module cannot be created (the return value needs to be cast
+   to (long) to detect the error condition).  */
+extern unsigned long create_module __P((const char * module_name,
+					size_t size));
+
+/* Initialize the module called MODULE_NAME with the CONTENTSSIZE
+   bytes starting at address CONTENTS.  CONTENTS normally contains the
+   text and data segment of the module (the bss is implicity zeroed).
+   After copying the contents, the function pointed to by
+   ROUTINES.init is executed.  When the module is no longer needed,
+   ROUTINES.cleanup is executed.  SYMTAB is NULL if the module does
+   not want to export symbols by itself, or a pointer to a symbol
+   table if the module wants to register its own symbols.  */
+extern int init_module __P((const char * module_name,
+			    const void * contents, size_t contentssize,
+			    struct mod_routines * routines,
+			    struct symbol_table * symtab));
+
+/* Delete the module named MODULE_NAME from the kernel.  */
+extern int delete_module __P((const char *module_name));
+
+#endif /* _SYS_MODULE_H */
diff --git a/sysdeps/unix/sysv/linux/sys/msq_buf.h b/sysdeps/unix/sysv/linux/sys/msq_buf.h
index 92a52d515d..6e4435dc23 100644
--- a/sysdeps/unix/sysv/linux/sys/msq_buf.h
+++ b/sysdeps/unix/sysv/linux/sys/msq_buf.h
@@ -49,6 +49,28 @@ struct msqid_ds
   __pid_t msg_lrpid;		/* pid of last msgrcv() */
 };
 
+#ifdef __USE_MISC
+
+#define msg_cbytes	__msg_cbytes
+
+/* ipcs ctl commands */
+#define MSG_STAT 11
+#define MSG_INFO 12
+
+/* buffer for msgctl calls IPC_INFO, MSG_INFO */
+struct msginfo {
+    int msgpool;
+    int msgmap; 
+    int msgmax; 
+    int msgmnb; 
+    int msgmni; 
+    int msgssz; 
+    int msgtql; 
+    ushort  msgseg; 
+};
+
+#endif /* __USE_MISC */
+
 __END_DECLS
 
 #endif /* sys/msq_buf.h */
diff --git a/sysdeps/unix/sysv/linux/sys/param.h b/sysdeps/unix/sysv/linux/sys/param.h
index 4950d58d38..e4a8406e44 100644
--- a/sysdeps/unix/sysv/linux/sys/param.h
+++ b/sysdeps/unix/sysv/linux/sys/param.h
@@ -29,7 +29,7 @@ Boston, MA 02111-1307, USA.  */
 #ifndef	NGROUPS
 #define	NGROUPS		NGROUPS_MAX
 #endif
-#define	MAXSYMLINKS	SYMLOOP_MAX
+#define	MAXSYMLINKS	5
 #define	CANBSIZ		MAX_CANON
 #define	NCARGS		ARG_MAX
 #define MAXPATHLEN      PATH_MAX
diff --git a/sysdeps/unix/sysv/linux/sys/sem_buf.h b/sysdeps/unix/sysv/linux/sys/sem_buf.h
index d93002ad6e..bfac9141bf 100644
--- a/sysdeps/unix/sysv/linux/sys/sem_buf.h
+++ b/sysdeps/unix/sysv/linux/sys/sem_buf.h
@@ -60,6 +60,27 @@ union semun
   struct seminfo *__buf;		/* buffer for IPC_INFO */
 };
 
+#ifdef __USE_MISC
+
+/* ipcs ctl cmds */
+#define SEM_STAT 18
+#define SEM_INFO 19
+
+struct  seminfo {
+    int semmap;
+    int semmni;
+    int semmns;
+    int semmnu;
+    int semmsl;
+    int semopm;
+    int semume;
+    int semusz;
+    int semvmx;
+    int semaem;
+};
+
+#endif /* __USE_MISC */
+
 __END_DECLS
 
 #endif /* sys/sem_buf.h */
diff --git a/sysdeps/unix/sysv/linux/sys/shm_buf.h b/sysdeps/unix/sysv/linux/sys/shm_buf.h
index fa1e8235d8..048aa64dc2 100644
--- a/sysdeps/unix/sysv/linux/sys/shm_buf.h
+++ b/sysdeps/unix/sysv/linux/sys/shm_buf.h
@@ -38,11 +38,11 @@ __BEGIN_DECLS
 /* Data structure describing a set of semaphores.  */
 struct shmid_ds
 {
-  struct ipc_perm sem_perm;		/* operation permisson struct */
+  struct ipc_perm shm_perm;		/* operation permisson struct */
   int shm_segsz;			/* size of segment in bytes */
-  __time_t sem_atime;			/* time of last shmat() */
-  __time_t sem_dtime;			/* time of last shmdt() */
-  __time_t sem_ctime;			/* time of last change by shmctl() */
+  __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() */
   __pid_t shm_cpid;			/* pid of creator */
   __pid_t shm_lpid;			/* pid of last shmop */
   unsigned short int shm_nattch;	/* number of current attaches */
@@ -51,6 +51,35 @@ struct shmid_ds
   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 /* sys/shm_buf.h */
diff --git a/sysdeps/unix/sysv/linux/syscalls.list b/sysdeps/unix/sysv/linux/syscalls.list
index f401bc8c60..db27320c93 100644
--- a/sysdeps/unix/sysv/linux/syscalls.list
+++ b/sysdeps/unix/sysv/linux/syscalls.list
@@ -1,15 +1,20 @@
 # File name	Caller	Syscall name	# args	Strong name	Weak names
 
 adjtimex	adjtime	adjtimex	1	__adjtimex
+bdflush		-	bdflush		2	bdflush
+create_module	-	create_module	3	create_module
+delete_module	-	delete_module	3	delete_module
 fdatasync	-	fdatasync	1	fdatasync
 flock		-	flock		2	__flock		flock
 fork		-	fork		0	__fork		fork
+get_kernel_syms	-	get_kernel_syms	1	get_kernel_syms
 getegid		-	getegid		0	__getegid	getegid
 geteuid		-	geteuid		0	__geteuid	geteuid
-getpgid		-	getpgid		1	getpgid
+getpgid		-	getpgid		1	__getpgid	getpgid
 getpgrp		-	getpgrp		0	getpgrp
 getppid		-	getppid		0	__getppid	getppid
 getsid		-	getsid		1	getsid
+init_module	-	init_module	5	init_module
 ioperm		-	ioperm		3	ioperm
 iopl		-	iopl		1	iopl
 ipc		msgget	ipc		5	__ipc
@@ -37,11 +42,12 @@ sched_primin	-	sched_get_priority_min	1	__sched_get_priority_min	sched_get_prior
 sched_rr_gi	-	sched_rr_get_interval	2	__sched_rr_get_interval	sched_rr_get_interval
 setfsgid	-	setfsgid	1	setfsgid
 setfsuid	-	setfsuid	1	setfsuid
-setpgid		-	setpgid		2	setpgid
+setpgid		-	setpgid		2	__setpgid	setpgid
 sigpending	-	sigpending	1	sigpending
 sigprocmask	-	sigprocmask	3	__sigprocmask	sigprocmask
 s_sysctl	sysctl	_sysctl		1	__syscall__sysctl
 sysinfo		-	sysinfo		1	sysinfo
+ksyslog_ctl	-	syslog		3	ksyslog_ctl
 umount		-	umount		1	__umount	umount
 uselib		-	uselib		1	uselib
 wait4		-	wait4		4	__wait4		wait4