aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorH. Peter Anvin <hpa@zytor.com>2002-08-09 20:44:50 +0000
committerH. Peter Anvin <hpa@zytor.com>2002-08-09 20:44:50 +0000
commit5f1d11bf0263e8ab25431730822db651bc925d46 (patch)
treea48540bfc5dc5d2ce484db97278c5be7f21b321d
parent3175765c0ee6bd8edffd6af71e1a414648132565 (diff)
downloadklibc-5f1d11bf0263e8ab25431730822db651bc925d46.tar.gz
Handle more platform braindamageklibc-0.2
-rw-r--r--SYSCALLS21
-rw-r--r--fdatasync.c15
-rw-r--r--klibc/Makefile2
-rw-r--r--klibc/SYSCALLS21
-rw-r--r--klibc/fdatasync.c15
5 files changed, 51 insertions, 23 deletions
diff --git a/SYSCALLS b/SYSCALLS
index 267fe8d0f2ffb..f12bbdf416424 100644
--- a/SYSCALLS
+++ b/SYSCALLS
@@ -13,7 +13,7 @@ pid_t getpid()
int setpgid(pid_t, pid_t)
pid_t getpgid(pid_t)
pid_t getppid()
-pid_t getpgrp()
+<!ia64> pid_t getpgrp()
pid_t setsid()
pid_t getsid(pid_t)
pid_t wait4(pid_t, int *, int, struct rusage *)
@@ -24,17 +24,17 @@ int execve(const char *, char * const *, char * const *)
# User and group IDs
#
int setuid(uid_t)
-uid_t getuid()
+<!alpha> uid_t getuid()
int setgid(gid_t)
-gid_t getgid()
-uid_t geteuid()
-gid_t getegid()
+<!alpha> gid_t getgid()
+<!alpha> uid_t geteuid()
+<!alpha> gid_t getegid()
int getgroups(int, gid_t *)
int setgroups(size_t, const gid_t *)
int setreuid(uid_t, uid_t)
int setregid(gid_t, gid_t)
-int setresuid(uid_t, uid_t, uid_t)
-int setresgid(gid_t, gid_t, gid_t)
+<!sparc> int setresuid(uid_t, uid_t, uid_t)
+<!sparc> int setresgid(gid_t, gid_t, gid_t)
int setfsuid(uid_t)
int setfsgid(gid_t)
@@ -44,7 +44,7 @@ int setfsgid(gid_t)
int mount(const char *, const char *, const char *, unsigned long, const void *)
<!alpha,ia64> int umount2(const char *, int)
<alpha,ia64> int umount::umount2(const char *, int)
-int pivot_root(const char *, const char *)
+<!m68k,mips64> int pivot_root(const char *, const char *)
int sync()
int statfs(const char *, struct statfs *)
int fstatfs(int, struct statfs *)
@@ -60,7 +60,7 @@ int unlink(const char *)
int chdir(const char *)
int mknod(const char *, mode_t, dev_t)
int chmod(const char *, mode_t)
-int utime(const char *, struct utimbuf *)
+<!alpha> int utime(const char *, struct utimbuf *)
int mkdir(const char *, mode_t)
int rmdir(const char *)
int pipe(int *)
@@ -92,7 +92,6 @@ int flock(int, int)
int select(int, fd_set *, fd_set *, fd_set *, struct timeval *)
int poll(struct pollfd *, nfds_t, long)
int fsync(int)
-int fdatasync(int)
int readv(int, const struct iovec *, int)
int writev(int, const struct iovec *, int)
@@ -103,7 +102,7 @@ int kill(pid_t, int)
int rt_sigaction(int, const struct sigaction *, struct sigaction *, size_t)
int rt_sigsuspend(const sigset_t *, size_t)
int rt_sigpending(sigset_t *, size_t)
-int pause()
+<!alpha> int pause()
<!alpha,ia64> unsigned int alarm(unsigned int)
int rt_sigprocmask(int, const sigset_t *, sigset_t *, size_t)
diff --git a/fdatasync.c b/fdatasync.c
new file mode 100644
index 0000000000000..53079b09d62ee
--- /dev/null
+++ b/fdatasync.c
@@ -0,0 +1,15 @@
+/*
+ * fdatasync.c
+ *
+ * Some systems don't have this (alpha?) ... this is really a bug,
+ * but mimic using fsync()
+ */
+
+#include <unistd.h>
+#include <sys/syscall.h>
+
+#ifndef __NR_fdatasync
+#define __NR_fdatasync __NR_fsync
+#endif
+
+_syscall1(int,fdatasync,int,fd);
diff --git a/klibc/Makefile b/klibc/Makefile
index 3244021bbc526..688ba2d8add8c 100644
--- a/klibc/Makefile
+++ b/klibc/Makefile
@@ -29,7 +29,7 @@ LIBOBJS = vsnprintf.o snprintf.o vsprintf.o sprintf.o \
strncmp.o strncpy.o strrchr.o strspn.o strsep.o strtok.o \
gethostname.o getdomainname.o getcwd.o seteuid.o setegid.o \
getenv.o setenv.o unsetenv.o getopt.o \
- time.o
+ time.o fdatasync.o
LIB = libc.a
SOFLAGS = -fPIC
diff --git a/klibc/SYSCALLS b/klibc/SYSCALLS
index 267fe8d0f2ffb..f12bbdf416424 100644
--- a/klibc/SYSCALLS
+++ b/klibc/SYSCALLS
@@ -13,7 +13,7 @@ pid_t getpid()
int setpgid(pid_t, pid_t)
pid_t getpgid(pid_t)
pid_t getppid()
-pid_t getpgrp()
+<!ia64> pid_t getpgrp()
pid_t setsid()
pid_t getsid(pid_t)
pid_t wait4(pid_t, int *, int, struct rusage *)
@@ -24,17 +24,17 @@ int execve(const char *, char * const *, char * const *)
# User and group IDs
#
int setuid(uid_t)
-uid_t getuid()
+<!alpha> uid_t getuid()
int setgid(gid_t)
-gid_t getgid()
-uid_t geteuid()
-gid_t getegid()
+<!alpha> gid_t getgid()
+<!alpha> uid_t geteuid()
+<!alpha> gid_t getegid()
int getgroups(int, gid_t *)
int setgroups(size_t, const gid_t *)
int setreuid(uid_t, uid_t)
int setregid(gid_t, gid_t)
-int setresuid(uid_t, uid_t, uid_t)
-int setresgid(gid_t, gid_t, gid_t)
+<!sparc> int setresuid(uid_t, uid_t, uid_t)
+<!sparc> int setresgid(gid_t, gid_t, gid_t)
int setfsuid(uid_t)
int setfsgid(gid_t)
@@ -44,7 +44,7 @@ int setfsgid(gid_t)
int mount(const char *, const char *, const char *, unsigned long, const void *)
<!alpha,ia64> int umount2(const char *, int)
<alpha,ia64> int umount::umount2(const char *, int)
-int pivot_root(const char *, const char *)
+<!m68k,mips64> int pivot_root(const char *, const char *)
int sync()
int statfs(const char *, struct statfs *)
int fstatfs(int, struct statfs *)
@@ -60,7 +60,7 @@ int unlink(const char *)
int chdir(const char *)
int mknod(const char *, mode_t, dev_t)
int chmod(const char *, mode_t)
-int utime(const char *, struct utimbuf *)
+<!alpha> int utime(const char *, struct utimbuf *)
int mkdir(const char *, mode_t)
int rmdir(const char *)
int pipe(int *)
@@ -92,7 +92,6 @@ int flock(int, int)
int select(int, fd_set *, fd_set *, fd_set *, struct timeval *)
int poll(struct pollfd *, nfds_t, long)
int fsync(int)
-int fdatasync(int)
int readv(int, const struct iovec *, int)
int writev(int, const struct iovec *, int)
@@ -103,7 +102,7 @@ int kill(pid_t, int)
int rt_sigaction(int, const struct sigaction *, struct sigaction *, size_t)
int rt_sigsuspend(const sigset_t *, size_t)
int rt_sigpending(sigset_t *, size_t)
-int pause()
+<!alpha> int pause()
<!alpha,ia64> unsigned int alarm(unsigned int)
int rt_sigprocmask(int, const sigset_t *, sigset_t *, size_t)
diff --git a/klibc/fdatasync.c b/klibc/fdatasync.c
new file mode 100644
index 0000000000000..53079b09d62ee
--- /dev/null
+++ b/klibc/fdatasync.c
@@ -0,0 +1,15 @@
+/*
+ * fdatasync.c
+ *
+ * Some systems don't have this (alpha?) ... this is really a bug,
+ * but mimic using fsync()
+ */
+
+#include <unistd.h>
+#include <sys/syscall.h>
+
+#ifndef __NR_fdatasync
+#define __NR_fdatasync __NR_fsync
+#endif
+
+_syscall1(int,fdatasync,int,fd);