summaryrefslogtreecommitdiff
path: root/sysdeps/unix/sysv/linux
diff options
context:
space:
mode:
Diffstat (limited to 'sysdeps/unix/sysv/linux')
-rw-r--r--sysdeps/unix/sysv/linux/Dist1
-rw-r--r--sysdeps/unix/sysv/linux/Makefile5
-rw-r--r--sysdeps/unix/sysv/linux/alpha/brk.S5
-rw-r--r--sysdeps/unix/sysv/linux/alpha/gnu/types.h7
-rw-r--r--sysdeps/unix/sysv/linux/alpha/ieee_get_fp_control.S10
-rw-r--r--sysdeps/unix/sysv/linux/alpha/ieee_set_fp_control.S8
-rw-r--r--sysdeps/unix/sysv/linux/alpha/ioperm.c8
-rw-r--r--sysdeps/unix/sysv/linux/alpha/setfpucw.c81
-rw-r--r--sysdeps/unix/sysv/linux/alpha/syscall.S4
-rw-r--r--sysdeps/unix/sysv/linux/net/if_arp.h2
-rw-r--r--sysdeps/unix/sysv/linux/net/ppp_defs.h3
-rw-r--r--sysdeps/unix/sysv/linux/netinet/ip_fw.h1
-rw-r--r--sysdeps/unix/sysv/linux/netipx/ipx.h90
-rw-r--r--sysdeps/unix/sysv/linux/ptrace.c29
-rw-r--r--sysdeps/unix/sysv/linux/socketbits.h14
-rw-r--r--sysdeps/unix/sysv/linux/sys/fsuid.h36
-rw-r--r--sysdeps/unix/sysv/linux/sys/mount.h70
-rw-r--r--sysdeps/unix/sysv/linux/sys/ttydefaults.h4
-rw-r--r--sysdeps/unix/sysv/linux/syscalls.list6
19 files changed, 303 insertions, 81 deletions
diff --git a/sysdeps/unix/sysv/linux/Dist b/sysdeps/unix/sysv/linux/Dist
index fc403871f3..1e30ac58fd 100644
--- a/sysdeps/unix/sysv/linux/Dist
+++ b/sysdeps/unix/sysv/linux/Dist
@@ -26,6 +26,7 @@ netipx/ipx.h
nfs/nfs.h
sys/acct.h
sys/debugreg.h
+sys/fsuid.h
sys/io.h
sys/kd.h
sys/kdaemon.h
diff --git a/sysdeps/unix/sysv/linux/Makefile b/sysdeps/unix/sysv/linux/Makefile
index 2827113d68..339862d356 100644
--- a/sysdeps/unix/sysv/linux/Makefile
+++ b/sysdeps/unix/sysv/linux/Makefile
@@ -11,7 +11,7 @@ sysdep_headers += sys/mount.h sys/acct.h sys/sysctl.h sys/mtio.h \
sys/module.h sys/io.h sys/klog.h sys/kdaemon.h \
sys/user.h syscall-list.h sys/sysmacros.h sys/procfs.h \
sys/debugreg.h sys/kd.h sys/soundcard.h sys/vt.h \
- sys/quota.h
+ sys/quota.h sys/fsuid.h
# Generate the list of SYS_* macros for the system calls (__NR_* macros).
$(objpfx)syscall-%.h $(objpfx)syscall-%.d: ../sysdeps/unix/sysv/linux/sys/syscall.h
@@ -55,7 +55,8 @@ endif
ifeq ($(subdir),inet)
sysdep_headers += netinet/in_systm.h netinet/udp.h \
netinet/if_fddi.h netinet/if_tr.h netinet/igmp.h \
- netinet/ip_fw.h netinet/ip_icmp.h sys/socketvar.h
+ netinet/ip_fw.h netinet/ip_icmp.h netipx/ipx.h \
+ sys/socketvar.h
endif
# Don't compile the ctype glue code, since there is no old non-GNU C library.
diff --git a/sysdeps/unix/sysv/linux/alpha/brk.S b/sysdeps/unix/sysv/linux/alpha/brk.S
index 74fef64f64..be0539b475 100644
--- a/sysdeps/unix/sysv/linux/alpha/brk.S
+++ b/sysdeps/unix/sysv/linux/alpha/brk.S
@@ -73,8 +73,9 @@ $ok: stq a0, __curbrk
/* What a horrible way to die. */
$err0: ldi v0, ENOMEM
-$err1: addq sp, 8, sp
- jmp zero, __syscall_error
+$err1: lda pv, __syscall_error
+ addq sp, 8, sp
+ jmp zero, (pv), __syscall_error
END(__brk)
diff --git a/sysdeps/unix/sysv/linux/alpha/gnu/types.h b/sysdeps/unix/sysv/linux/alpha/gnu/types.h
index 5c1e407423..2af77f70cf 100644
--- a/sysdeps/unix/sysv/linux/alpha/gnu/types.h
+++ b/sysdeps/unix/sysv/linux/alpha/gnu/types.h
@@ -66,7 +66,12 @@ 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;
+typedef unsigned long int __fd_mask;
+
+/* Due to incaution, we may have gotten these from a kernel header file. */
+#undef __FD_SETSIZE
+#undef __NFDBITS
+#undef __FDMASK
/* Number of descriptors that can fit in an `fd_set'. */
#define __FD_SETSIZE 1024
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 dbc25bcbf3..193baf7491 100644
--- a/sysdeps/unix/sysv/linux/alpha/ieee_get_fp_control.S
+++ b/sysdeps/unix/sysv/linux/alpha/ieee_get_fp_control.S
@@ -1,4 +1,4 @@
-/* Copyright (C) 1993, 1995, 1996 Free Software Foundation, Inc.
+/* Copyright (C) 1993, 1995, 1996, 1997 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by David Mosberger <davidm@azstarnet.com>, 1995.
@@ -41,18 +41,20 @@ LEAF(__ieee_get_fp_control, 16)
ldi a0, GSI_IEEE_FP_CONTROL
ldi v0, __NR_osf_getsysinfo
call_pal PAL_callsys
- bne a3, error
+ bne a3, $error
ldq v0, 0(sp)
lda sp, 16(sp)
ret
-error: lda sp, 16(sp)
+$error: lda sp, 16(sp)
#ifndef PROF
br gp, 1f
1: ldgp gp, 0(gp)
#endif
- jmp zero, __syscall_error
+ lda pv, __syscall_error
+ lda sp, 16(sp)
+ jmp zero, (pv), __syscall_error
END(__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 d2d2add56c..be8caf632d 100644
--- a/sysdeps/unix/sysv/linux/alpha/ieee_set_fp_control.S
+++ b/sysdeps/unix/sysv/linux/alpha/ieee_set_fp_control.S
@@ -43,15 +43,17 @@ LEAF(__ieee_set_fp_control, 16)
lda sp, 16(sp)
- bne a3, error
+ bne a3, $error
ret
-error:
+$error:
#ifndef PROF
br gp, 1f
1: ldgp gp, 0(gp)
#endif
- jmp zero, __syscall_error
+ lda pv, __syscall_error
+ lda sp, 16(sp)
+ jmp zero, (pv), __syscall_error
END(__ieee_set_fp_control)
diff --git a/sysdeps/unix/sysv/linux/alpha/ioperm.c b/sysdeps/unix/sysv/linux/alpha/ioperm.c
index 63bf17588a..76a744d167 100644
--- a/sysdeps/unix/sysv/linux/alpha/ioperm.c
+++ b/sysdeps/unix/sysv/linux/alpha/ioperm.c
@@ -55,14 +55,13 @@
#define JENSEN_IO_BASE (0xfffffc0300000000UL)
#define JENSEN_SPARSE_MEM (0xfffffc0200000000UL)
-/*
- * With respect to the I/O architecture, APECS and LCA are identical,
- * so the following defines apply to LCA as well.
- */
+/* With respect to the I/O architecture, APECS and LCA are identical,
+ so the following defines apply to LCA as well. */
#define APECS_IO_BASE (0xfffffc01c0000000UL)
#define APECS_SPARSE_MEM (0xfffffc0200000000UL)
#define APECS_DENSE_MEM (0xfffffc0300000000UL)
+/* The same holds for CIA and PYXIS. */
#define CIA_IO_BASE (0xfffffc8580000000UL)
#define CIA_SPARSE_MEM (0xfffffc8000000000UL)
#define CIA_DENSE_MEM (0xfffffc8600000000UL)
@@ -104,6 +103,7 @@ static struct platform {
{"Mustang", IOSYS_APECS, 5, APECS_DENSE_MEM, APECS_SPARSE_MEM},
{"Noname", IOSYS_APECS, 5, APECS_DENSE_MEM, APECS_SPARSE_MEM},
{"Sable", IOSYS_T2, 5, T2_DENSE_MEM, T2_SPARSE_MEM},
+ {"Miata", IOSYS_CIA, 5, CIA_DENSE_MEM, CIA_SPARSE_MEM},
};
diff --git a/sysdeps/unix/sysv/linux/alpha/setfpucw.c b/sysdeps/unix/sysv/linux/alpha/setfpucw.c
index 43e8536b20..9133c81110 100644
--- a/sysdeps/unix/sysv/linux/alpha/setfpucw.c
+++ b/sysdeps/unix/sysv/linux/alpha/setfpucw.c
@@ -1,65 +1,78 @@
-#include <fpu_control.h>
+/* Set FP exception mask and rounding mode.
+ 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. */
+#include <fpu_control.h>
#include <asm/fpu.h>
+
extern void __ieee_set_fp_control (unsigned long);
extern unsigned long __ieee_get_fp_control (void);
-
static inline unsigned long
rdfpcr (void)
{
- unsigned long fpcr;
-
- asm ("trapb; mf_fpcr $f0; trapb; stt $f0,%0" : "m="(fpcr));
- return fpcr;
+ unsigned long fpcr;
+ asm ("excb; mf_fpcr %0" : "=f"(fpcr));
+ return fpcr;
}
static inline void
wrfpcr (unsigned long fpcr)
{
- asm volatile ("ldt $f0,%0; trapb; mt_fpcr $f0; trapb" :: "m"(fpcr));
+ asm volatile ("mt_fpcr %0; excb" : : "f"(fpcr));
}
void
__setfpucw (unsigned short fpu_control)
{
- unsigned long fpcr = 0, fpcw = 0;
+ unsigned long fpcr = 0, fpcw = 0;
- if (!fpu_control)
- fpu_control = _FPU_DEFAULT;
+ if (!fpu_control)
+ fpu_control = _FPU_DEFAULT;
- /* first, set dynamic rounding mode: */
+ /* first, set dynamic rounding mode: */
- fpcr = rdfpcr();
- fpcr &= ~FPCR_DYN_MASK;
- switch (fpu_control & 0xc00) {
- case _FPU_RC_NEAREST: fpcr |= FPCR_DYN_NORMAL; break;
- case _FPU_RC_DOWN: fpcr |= FPCR_DYN_MINUS; break;
- case _FPU_RC_UP: fpcr |= FPCR_DYN_PLUS; break;
- case _FPU_RC_ZERO: fpcr |= FPCR_DYN_CHOPPED; break;
+ fpcr = rdfpcr();
+ fpcr &= ~FPCR_DYN_MASK;
+ switch (fpu_control & 0xc00)
+ {
+ case _FPU_RC_NEAREST: fpcr |= FPCR_DYN_NORMAL; break;
+ case _FPU_RC_DOWN: fpcr |= FPCR_DYN_MINUS; break;
+ case _FPU_RC_UP: fpcr |= FPCR_DYN_PLUS; break;
+ case _FPU_RC_ZERO: fpcr |= FPCR_DYN_CHOPPED; break;
}
- wrfpcr(fpcr);
+ wrfpcr(fpcr);
- /* now tell kernel about traps that we like to hear about: */
+ /* now tell kernel about traps that we like to hear about: */
- fpcw = __ieee_get_fp_control();
- fpcw &= ~IEEE_TRAP_ENABLE_MASK;
+ fpcw = __ieee_get_fp_control();
+ fpcw &= ~IEEE_TRAP_ENABLE_MASK;
- if (!(fpu_control & _FPU_MASK_IM))
- fpcw |= IEEE_TRAP_ENABLE_INV;
- if (!(fpu_control & _FPU_MASK_DM))
- fpcw |= IEEE_TRAP_ENABLE_UNF;
- if (!(fpu_control & _FPU_MASK_ZM))
- fpcw |= IEEE_TRAP_ENABLE_DZE;
- if (!(fpu_control & _FPU_MASK_OM))
- fpcw |= IEEE_TRAP_ENABLE_OVF;
- if (!(fpu_control & _FPU_MASK_PM))
- fpcw |= IEEE_TRAP_ENABLE_INE;
+ if (!(fpu_control & _FPU_MASK_IM)) fpcw |= IEEE_TRAP_ENABLE_INV;
+ if (!(fpu_control & _FPU_MASK_DM)) fpcw |= IEEE_TRAP_ENABLE_UNF;
+ if (!(fpu_control & _FPU_MASK_ZM)) fpcw |= IEEE_TRAP_ENABLE_DZE;
+ if (!(fpu_control & _FPU_MASK_OM)) fpcw |= IEEE_TRAP_ENABLE_OVF;
+ if (!(fpu_control & _FPU_MASK_PM)) fpcw |= IEEE_TRAP_ENABLE_INE;
- __ieee_set_fp_control(fpcw);
+ __fpu_control = fpu_control; /* update global copy */
- __fpu_control = fpu_control; /* update global copy */
+ __ieee_set_fp_control(fpcw);
}
diff --git a/sysdeps/unix/sysv/linux/alpha/syscall.S b/sysdeps/unix/sysv/linux/alpha/syscall.S
index 75e1260aea..d25dd6b51f 100644
--- a/sysdeps/unix/sysv/linux/alpha/syscall.S
+++ b/sysdeps/unix/sysv/linux/alpha/syscall.S
@@ -62,10 +62,10 @@ LEAF(__syscall, 0)
mov a5, a4
call_pal PAL_callsys /* Invoke system call */
- bne a3, error
+ bne a3, $error
ret
-error:
+$error:
#ifndef PROF
br gp, 2f
2: ldgp gp, 0(gp)
diff --git a/sysdeps/unix/sysv/linux/net/if_arp.h b/sysdeps/unix/sysv/linux/net/if_arp.h
index b1cd18360e..d784f0cfc7 100644
--- a/sysdeps/unix/sysv/linux/net/if_arp.h
+++ b/sysdeps/unix/sysv/linux/net/if_arp.h
@@ -90,6 +90,8 @@ struct arphdr
#define ARPHRD_ROSE 270
#define ARPHRD_X25 271 /* CCITT X.25. */
#define ARPHRD_PPP 512
+#define ARPHRD_HDLC 513 /* (Cisco) HDLC. */
+#define ARPHRD_LAPB 516 /* LAPB. */
#define ARPHRD_TUNNEL 768 /* IPIP tunnel. */
#define ARPHRD_TUNNEL6 769 /* IPIP6 tunnel. */
diff --git a/sysdeps/unix/sysv/linux/net/ppp_defs.h b/sysdeps/unix/sysv/linux/net/ppp_defs.h
index 5d613e0d0f..f8924c4f27 100644
--- a/sysdeps/unix/sysv/linux/net/ppp_defs.h
+++ b/sysdeps/unix/sysv/linux/net/ppp_defs.h
@@ -1,6 +1,9 @@
#ifndef _NET_PPP_DEFS_H
#define _NET_PPP_DEFS_H 1
+#define __need_time_t
+#include <time.h>
+
#include <asm/types.h>
#include <linux/ppp_defs.h>
diff --git a/sysdeps/unix/sysv/linux/netinet/ip_fw.h b/sysdeps/unix/sysv/linux/netinet/ip_fw.h
index 8ba10ae196..322467b5ff 100644
--- a/sysdeps/unix/sysv/linux/netinet/ip_fw.h
+++ b/sysdeps/unix/sysv/linux/netinet/ip_fw.h
@@ -53,6 +53,7 @@
#include <netinet/ip.h>
#include <netinet/tcp.h>
#include <netinet/udp.h>
+#include <net/if.h>
__BEGIN_DECLS
diff --git a/sysdeps/unix/sysv/linux/netipx/ipx.h b/sysdeps/unix/sysv/linux/netipx/ipx.h
index 170dfdf134..ec93c8185c 100644
--- a/sysdeps/unix/sysv/linux/netipx/ipx.h
+++ b/sysdeps/unix/sysv/linux/netipx/ipx.h
@@ -19,10 +19,94 @@
#ifndef __NETIPX_IPX_H
#define __NETIPX_IPX_H 1
-#include <asm/types.h>
-#include <linux/ipx.h>
+#include <features.h>
+
+#include <sys/types.h>
+#include <sys/socket.h>
+
+__BEGIN_DECLS
#define SOL_IPX 256 /* sockopt level */
-#define IPX_TYPE 1
+
+#define IPX_TYPE 1
+#define IPX_NODE_LEN 6
+#define IPX_MTU 576
+
+struct sockaddr_ipx
+ {
+ sa_family_t sipx_family;
+ u_int16_t sipx_port;
+ u_int32_t sipx_network;
+ unsigned char sipx_node[IPX_NODE_LEN];
+ u_int8_t sipx_type;
+ unsigned char sipx_zero; /* 16 byte fill */
+ };
+
+/*
+ * So we can fit the extra info for SIOCSIFADDR into the address nicely
+ */
+
+#define sipx_special sipx_port
+#define sipx_action sipx_zero
+#define IPX_DLTITF 0
+#define IPX_CRTITF 1
+
+typedef struct ipx_route_definition
+ {
+ unsigned long ipx_network;
+ unsigned long ipx_router_network;
+ unsigned char ipx_router_node[IPX_NODE_LEN];
+ }
+ipx_route_definition;
+
+typedef struct ipx_interface_definition
+ {
+ unsigned long ipx_network;
+ unsigned char ipx_device[16];
+ unsigned char ipx_dlink_type;
+#define IPX_FRAME_NONE 0
+#define IPX_FRAME_SNAP 1
+#define IPX_FRAME_8022 2
+#define IPX_FRAME_ETHERII 3
+#define IPX_FRAME_8023 4
+#define IPX_FRAME_TR_8022 5
+ unsigned char ipx_special;
+#define IPX_SPECIAL_NONE 0
+#define IPX_PRIMARY 1
+#define IPX_INTERNAL 2
+ unsigned char ipx_node[IPX_NODE_LEN];
+ }
+ipx_interface_definition;
+
+typedef struct ipx_config_data
+ {
+ unsigned char ipxcfg_auto_select_primary;
+ unsigned char ipxcfg_auto_create_interfaces;
+ }
+ipx_config_data;
+
+/*
+ * OLD Route Definition for backward compatibility.
+ */
+
+struct ipx_route_def
+ {
+ unsigned long ipx_network;
+ unsigned long ipx_router_network;
+#define IPX_ROUTE_NO_ROUTER 0
+ unsigned char ipx_router_node[IPX_NODE_LEN];
+ unsigned char ipx_device[16];
+ unsigned short ipx_flags;
+#define IPX_RT_SNAP 8
+#define IPX_RT_8022 4
+#define IPX_RT_BLUEBOOK 2
+#define IPX_RT_ROUTED 1
+ };
+
+#define SIOCAIPXITFCRT (SIOCPROTOPRIVATE)
+#define SIOCAIPXPRISLT (SIOCPROTOPRIVATE + 1)
+#define SIOCIPXCFGDATA (SIOCPROTOPRIVATE + 2)
+
+__END_DECLS
#endif /* netipx/ipx.h */
diff --git a/sysdeps/unix/sysv/linux/ptrace.c b/sysdeps/unix/sysv/linux/ptrace.c
index ede413a43c..b50234d2a1 100644
--- a/sysdeps/unix/sysv/linux/ptrace.c
+++ b/sysdeps/unix/sysv/linux/ptrace.c
@@ -1,20 +1,20 @@
-/* Copyright (C) 1995, 1996 Free Software Foundation, Inc.
-This file is part of the GNU C Library.
+/* 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 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., 59 Temple Place - Suite 330,
-Boston, MA 02111-1307, 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 <errno.h>
#include <sys/types.h>
@@ -52,6 +52,5 @@ ptrace (enum __ptrace_request request, ...)
return res;
}
- __set_errno (-res);
return -1;
}
diff --git a/sysdeps/unix/sysv/linux/socketbits.h b/sysdeps/unix/sysv/linux/socketbits.h
index 38a8fb74d1..3630ff5aa3 100644
--- a/sysdeps/unix/sysv/linux/socketbits.h
+++ b/sysdeps/unix/sysv/linux/socketbits.h
@@ -29,6 +29,9 @@
__BEGIN_DECLS
+/* Type for length arguments in socket calls. */
+typedef unsigned int socklen_t;
+
/* Types of sockets. */
enum __socket_type
{
@@ -116,25 +119,22 @@ enum
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. */
+ socklen_t msg_namelen; /* Length of address data. */
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. */
+ socklen_t msg_controllen; /* Ancillary data buffer length. */
+
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
+ socklen_t 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
diff --git a/sysdeps/unix/sysv/linux/sys/fsuid.h b/sysdeps/unix/sysv/linux/sys/fsuid.h
new file mode 100644
index 0000000000..fd30542e9f
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/sys/fsuid.h
@@ -0,0 +1,36 @@
+/* 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 _SYS_FSUID_H
+#define _SYS_FSUID_H 1
+
+#include <features.h>
+#include <sys/types.h>
+
+__BEGIN_DECLS
+
+/* Change uid used for file access control to UID, without affecting
+ other priveledges (such as who can send signals at the process). */
+extern int setfsuid __P ((__uid_t __uid));
+
+/* Ditto for group id. */
+extern int setfsgid __P ((__gid_t __gid));
+
+__END_DECLS
+
+#endif /* fsuid.h */
diff --git a/sysdeps/unix/sysv/linux/sys/mount.h b/sysdeps/unix/sysv/linux/sys/mount.h
index 59a1aa45be..08a2e3158f 100644
--- a/sysdeps/unix/sysv/linux/sys/mount.h
+++ b/sysdeps/unix/sysv/linux/sys/mount.h
@@ -1,5 +1,5 @@
/* Header file for mounting/unmount Linux filesystems.
- 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
@@ -17,13 +17,81 @@
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
+/* This is taken from /usr/include/linux/fs.h. */
+
#ifndef _SYS_MOUNT_H
#define _SYS_MOUNT_H 1
#include <features.h>
+#include <sys/ioctl.h>
+
__BEGIN_DECLS
+#define BLOCK_SIZE 1024
+#define BLOCK_SIZE_BITS 10
+
+
+/* These are the fs-independent mount-flags: up to 16 flags are
+ supported */
+#define MS_RDONLY 1 /* Mount read-only. */
+#define MS_NOSUID 2 /* Ignore suid and sgid bits. */
+#define MS_NODEV 4 /* Disallow access to device special files. */
+#define MS_NOEXEC 8 /* Disallow program execution. */
+#define MS_SYNCHRONOUS 16 /* Writes are synced at once. */
+#define MS_REMOUNT 32 /* Alter flags of a mounted FS. */
+#define MS_MANDLOCK 64 /* Allow mandatory locks on an FS. */
+#define S_WRITE 128 /* Write on file/directory/symlink. */
+#define S_APPEND 256 /* Append-only file. */
+#define S_IMMUTABLE 512 /* Immutable file. */
+#define MS_NOATIME 1024 /* Do not update access times. */
+
+
+/* Flags that can be altered by MS_REMOUNT */
+#define MS_RMT_MASK (MS_RDONLY | MS_MANDLOCK)
+
+
+/* Magic mount flag number. Has to be or-ed to the flag values. */
+
+#define MS_MGC_VAL 0xc0ed0000 /* Magic flag number to indicate "new" flags */
+#define MS_MGC_MSK 0xffff0000 /* Magic flag number mask */
+
+
+/* Note that read-only etc flags are inode-specific: setting some
+ file-system flags just means all the inodes inherit those flags by
+ default. It might be possible to override it selectively if you
+ really wanted to with some ioctl() that is not currently
+ implemented.
+
+ Exception: MS_RDONLY is always applied to the entire file system. */
+#define IS_RDONLY(inode) \
+ (((inode)->i_sb) && ((inode)->i_sb->s_flags & MS_RDONLY))
+#define DO_UPDATE_ATIME(inode) \
+ (!((inode)->i_flags & MS_NOATIME) && !IS_RDONLY (inode))
+#define IS_NOSUID(inode) ((inode)->i_flags & MS_NOSUID)
+#define IS_NODEV(inode) ((inode)->i_flags & MS_NODEV)
+#define IS_NOEXEC(inode) ((inode)->i_flags & MS_NOEXEC)
+#define IS_SYNC(inode) ((inode)->i_flags & MS_SYNCHRONOUS)
+#define IS_MANDLOCK(inode) ((inode)->i_flags & MS_MANDLOCK)
+
+#define IS_WRITABLE(inode) ((inode)->i_flags & S_WRITE)
+#define IS_APPEND(inode) ((inode)->i_flags & S_APPEND)
+#define IS_IMMUTABLE(inode) ((inode)->i_flags & S_IMMUTABLE)
+
+
+/* The read-only stuff doesn't really belong here, but any other place
+ is probably as bad and I don't want to create yet another include
+ file. */
+
+#define BLKROSET _IO(0x12, 93) /* Set device read-only (0 = read-write). */
+#define BLKROGET _IO(0x12, 94) /* Get read-only status (0 = read_write). */
+#define BLKRRPART _IO(0x12, 95) /* Re-read partition table. */
+#define BLKGETSIZE _IO(0x12, 96) /* Return device size. */
+#define BLKFLSBUF _IO(0x12, 97) /* Flush buffer cache. */
+#define BLKRASET _IO(0x12, 98) /* Set read ahead for block device. */
+#define BLKRAGET _IO(0x12, 99) /* Get current read ahead setting. */
+
+
/* Mount a filesystem. */
extern int mount __P ((__const char *__special_file, __const char *__dir,
__const char *__fstype, unsigned long int __rwflag,
diff --git a/sysdeps/unix/sysv/linux/sys/ttydefaults.h b/sysdeps/unix/sysv/linux/sys/ttydefaults.h
index 28512ebebb..b21c6d5686 100644
--- a/sysdeps/unix/sysv/linux/sys/ttydefaults.h
+++ b/sysdeps/unix/sysv/linux/sys/ttydefaults.h
@@ -61,14 +61,14 @@
#ifdef _POSIX_VDISABLE
# define CEOL _POSIX_VDISABLE
#else
-# define CEOL ((unsigned char)'\377') /* XXX avoid _POSIX_VDISABLE */
+# define CEOL '\0' /* XXX avoid _POSIX_VDISABLE */
#endif
#define CERASE 0177
#define CINTR CTRL('c')
#ifdef _POSIX_VDISABLE
# define CSTATUS _POSIX_VDISABLE
#else
-# define CSTATUS ((unsigned char)'\377') /* XXX avoid _POSIX_VDISABLE */
+# define CSTATUS '\0' /* XXX avoid _POSIX_VDISABLE */
#endif
#define CKILL CTRL('u')
#define CMIN 1
diff --git a/sysdeps/unix/sysv/linux/syscalls.list b/sysdeps/unix/sysv/linux/syscalls.list
index c7180ccb42..a3b0eef691 100644
--- a/sysdeps/unix/sysv/linux/syscalls.list
+++ b/sysdeps/unix/sysv/linux/syscalls.list
@@ -13,6 +13,7 @@ geteuid - geteuid 0 __geteuid geteuid
getpgid - getpgid 1 __getpgid getpgid
getpgrp - getpgrp 0 getpgrp
getppid - getppid 0 __getppid getppid
+getresgid EXTRA getresgid 3 getresgid
getresuid EXTRA getresuid 3 getresuid
getsid - getsid 1 getsid
init_module EXTRA init_module 5 init_module
@@ -32,6 +33,7 @@ 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
+quotactl EXTRA quotactl 4 quotactl
s_getdents EXTRA getdents 3 __getdents
s_getpriority getpriority getpriority 2 __syscall_getpriority
s_poll poll poll 3 __syscall_poll
@@ -53,6 +55,7 @@ select - _newselect 5 __select select
setfsgid EXTRA setfsgid 1 setfsgid
setfsuid EXTRA setfsuid 1 setfsuid
setpgid - setpgid 2 __setpgid setpgid
+setresgid EXTRA setresgid 3 setresgid
setresuid EXTRA setresuid 3 setresuid
sigpending - sigpending 1 sigpending
sigprocmask - sigprocmask 3 __sigprocmask sigprocmask
@@ -64,7 +67,8 @@ sys_readv readv readv 3 __syscall_readv
sys_stat xstat stat 2 __syscall_stat
sys_writev writev writev 3 __syscall_writev
sysinfo EXTRA sysinfo 1 sysinfo
-swapon - swapon 2 swapon
+swapon - swapon 2 __swapon swapon
+swapoff - swapoff 1 __swapoff swapoff
umount EXTRA umount 1 __umount umount
uselib EXTRA uselib 1 uselib
wait4 - wait4 4 __wait4 wait4