summaryrefslogtreecommitdiff
path: root/sysdeps
diff options
context:
space:
mode:
Diffstat (limited to 'sysdeps')
-rw-r--r--sysdeps/generic/setenv.c15
-rw-r--r--sysdeps/unix/sysv/fcntlbits.h34
-rw-r--r--sysdeps/unix/sysv/linux/alpha/fcntlbits.h93
-rw-r--r--sysdeps/unix/sysv/linux/alpha/ustat.c3
-rw-r--r--sysdeps/unix/sysv/linux/fcntlbits.h61
-rw-r--r--sysdeps/unix/sysv/linux/syscalls.list3
-rw-r--r--sysdeps/unix/sysv/linux/ustat.c3
7 files changed, 189 insertions, 23 deletions
diff --git a/sysdeps/generic/setenv.c b/sysdeps/generic/setenv.c
index 9403ccb035..6d0c23114c 100644
--- a/sysdeps/generic/setenv.c
+++ b/sysdeps/generic/setenv.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1992, 1995, 1996 Free Software Foundation, Inc.
+/* 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
@@ -21,6 +21,12 @@
#endif
#include <errno.h>
+#if !_LIBC
+# if !defined(errno) && !defined(HAVE_ERRNO_DECL)
+extern int errno;
+# endif
+# define __set_errno(ev) ((errno) = (ev))
+#endif
#if _LIBC || HAVE_STDLIB_H
# include <stdlib.h>
@@ -32,11 +38,14 @@
# include <unistd.h>
#endif
-#if _LIBC - 0 == 0
+#if !_LIBC
# define __environ environ
+# ifndef HAVE_ENVIRON_DECL
+extern char **environ;
+# endif
#endif
-#if _LIBC - 0
+#if _LIBC
/* This lock protects against simultaneous modifications of `environ'. */
# include <libc-lock.h>
__libc_lock_define_initialized (static, envlock)
diff --git a/sysdeps/unix/sysv/fcntlbits.h b/sysdeps/unix/sysv/fcntlbits.h
index d7dbd0c20a..d04901406a 100644
--- a/sysdeps/unix/sysv/fcntlbits.h
+++ b/sysdeps/unix/sysv/fcntlbits.h
@@ -1,21 +1,21 @@
/* O_*, F_*, FD_* bit values for System V.
-Copyright (C) 1991, 1992 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. */
+ Copyright (C) 1991, 1992, 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 _FCNTLBITS_H
diff --git a/sysdeps/unix/sysv/linux/alpha/fcntlbits.h b/sysdeps/unix/sysv/linux/alpha/fcntlbits.h
new file mode 100644
index 0000000000..e8697d9898
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/alpha/fcntlbits.h
@@ -0,0 +1,93 @@
+/* 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 _FCNTLBITS_H
+#define _FCNTLBITS_H 1
+
+#include <sys/types.h>
+
+
+/* open/fcntl - O_SYNC is only implemented on blocks devices and on files
+ located on an ext2 file system */
+#define O_ACCMODE 0003
+#define O_RDONLY 00
+#define O_WRONLY 01
+#define O_RDWR 02
+#define O_CREAT 01000 /* not fcntl */
+#define O_TRUNC 02000 /* not fcntl */
+#define O_EXCL 04000 /* not fcntl */
+#define O_NOCTTY 010000 /* not fcntl */
+
+#define O_NONBLOCK 00004
+#define O_APPEND 00010
+#define O_NDELAY O_NONBLOCK
+#define O_SYNC 040000
+#define FASYNC 020000 /* fcntl, for BSD compatibility */
+
+#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 7
+#define F_SETLK 8
+#define F_SETLKW 9
+
+#define F_SETOWN 5 /* for sockets. */
+#define F_GETOWN 6 /* 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 1
+#define F_WRLCK 2
+#define F_UNLCK 8
+
+/* for old implementation of bsd flock () */
+#define F_EXLCK 16 /* or 3 */
+#define F_SHLCK 32 /* 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
+ blocking */
+#define LOCK_UN 8 /* remove lock */
+
+struct flock
+ {
+ short int l_type;
+ short int l_whence;
+ __off_t l_start;
+ __off_t l_len;
+ __pid_t l_pid;
+ };
+
+
+/* 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 FNONBLOCK O_NONBLOCK
+#define FNDELAY O_NDELAY
+#endif /* Use BSD. */
+
+#endif /* fcntlbits.h */
diff --git a/sysdeps/unix/sysv/linux/alpha/ustat.c b/sysdeps/unix/sysv/linux/alpha/ustat.c
index c09b4fd84e..6c64d31edc 100644
--- a/sysdeps/unix/sysv/linux/alpha/ustat.c
+++ b/sysdeps/unix/sysv/linux/alpha/ustat.c
@@ -20,6 +20,9 @@
#include <sys/ustat.h>
#include <sys/sysmacros.h>
+
+extern int __syscall_ustat (unsigned int dev, struct ustat *ubuf);
+
int
ustat (dev_t dev, struct ustat *ubuf)
{
diff --git a/sysdeps/unix/sysv/linux/fcntlbits.h b/sysdeps/unix/sysv/linux/fcntlbits.h
index 43954df6ec..d7e889fc5e 100644
--- a/sysdeps/unix/sysv/linux/fcntlbits.h
+++ b/sysdeps/unix/sysv/linux/fcntlbits.h
@@ -1,5 +1,5 @@
/* O_*, F_*, FD_* bit values for Linux.
- Copyright (C) 1995, 1996 Free Software Foundation, Inc.
+ 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
@@ -21,7 +21,64 @@
#define _FCNTLBITS_H 1
#include <sys/types.h>
-#include <linux/fcntl.h>
+
+
+/* open/fcntl - O_SYNC is only implemented on blocks devices and on files
+ located on an ext2 file system */
+#define O_ACCMODE 0003
+#define O_RDONLY 00
+#define O_WRONLY 01
+#define O_RDWR 02
+#define O_CREAT 0100 /* not fcntl */
+#define O_EXCL 0200 /* not fcntl */
+#define O_NOCTTY 0400 /* not fcntl */
+#define O_TRUNC 01000 /* not fcntl */
+#define O_APPEND 02000
+#define O_NONBLOCK 04000
+#define O_NDELAY O_NONBLOCK
+#define O_SYNC 010000
+#define FASYNC 020000 /* fcntl, for BSD compatibility */
+
+#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 5
+#define F_SETLK 6
+#define F_SETLKW 7
+
+#define F_SETOWN 8 /* for sockets. */
+#define F_GETOWN 9 /* 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
+ blocking */
+#define LOCK_UN 8 /* remove lock */
+
+struct flock
+ {
+ short int l_type;
+ short int l_whence;
+ __off_t l_start;
+ __off_t l_len;
+ __pid_t l_pid;
+ };
+
/* Define some more compatibility macros to be backward compatible with
BSD systems which did not managed to hide these kernel macros. */
diff --git a/sysdeps/unix/sysv/linux/syscalls.list b/sysdeps/unix/sysv/linux/syscalls.list
index 246470a66a..5367a2826b 100644
--- a/sysdeps/unix/sysv/linux/syscalls.list
+++ b/sysdeps/unix/sysv/linux/syscalls.list
@@ -53,7 +53,8 @@ setpgid - setpgid 2 __setpgid setpgid
setresuid EXTRA setresuid 3 setresuid
sigpending - sigpending 1 sigpending
sigprocmask - sigprocmask 3 __sigprocmask sigprocmask
-sigreturn EXTRA sigreturn 1 __sigreturn sigreturn
+sigreturn - sigreturn 1 __sigreturn sigreturn
+sys_mknod xmknod mknod 3 __syscall_mknod
sysinfo EXTRA sysinfo 1 sysinfo
swapon - swapon 2 swapon
umount EXTRA umount 1 __umount umount
diff --git a/sysdeps/unix/sysv/linux/ustat.c b/sysdeps/unix/sysv/linux/ustat.c
index 8cec8eb9b7..a8dfbb4191 100644
--- a/sysdeps/unix/sysv/linux/ustat.c
+++ b/sysdeps/unix/sysv/linux/ustat.c
@@ -20,6 +20,9 @@
#include <sys/ustat.h>
#include <sys/sysmacros.h>
+
+extern int __syscall_ustat (unsigned short int dev, struct ustat *ubuf);
+
int
ustat (dev_t dev, struct ustat *ubuf)
{