summaryrefslogtreecommitdiff
path: root/libc/sysdeps/linux/common
diff options
context:
space:
mode:
Diffstat (limited to 'libc/sysdeps/linux/common')
-rw-r--r--libc/sysdeps/linux/common/statfix.h4
-rw-r--r--libc/sysdeps/linux/common/syscalls.c14
2 files changed, 17 insertions, 1 deletions
diff --git a/libc/sysdeps/linux/common/statfix.h b/libc/sysdeps/linux/common/statfix.h
index 21a776c92..df85d84d4 100644
--- a/libc/sysdeps/linux/common/statfix.h
+++ b/libc/sysdeps/linux/common/statfix.h
@@ -3,9 +3,11 @@
/* Pull in whatever this particular arch's kernel thinks the kernel version of
* struct stat should look like. It turn out that each arch has a different
- * opinion on the subject... */
+ * opinion on the subject, and different kernel revs use different names... */
#define stat kernel_stat
+#define new_stat kernel_stat
#include <asm/stat.h>
+#undef new_stat
#undef stat
/* Now pull in libc's version of stat */
diff --git a/libc/sysdeps/linux/common/syscalls.c b/libc/sysdeps/linux/common/syscalls.c
index c0630e1fd..a0bad06be 100644
--- a/libc/sysdeps/linux/common/syscalls.c
+++ b/libc/sysdeps/linux/common/syscalls.c
@@ -135,11 +135,19 @@ _syscall3(int, mknod, const char *, pathname, mode_t, mode, dev_t, dev);
_syscall2(int, chmod, const char *, path, mode_t, mode);
#endif
+/* Old kernels don't have lchown -- do chown instead. This
+ * is sick and wrong, but at least things will compile.
+ * They may not follow links when they should though... */
+#ifndef __NR_lchown
+#define __NR_lchown __NR_chown
+#endif
+
//#define __NR_lchown 16
#ifdef L_lchown
#include <unistd.h>
_syscall3(int, lchown, const char *, path, uid_t, owner, gid_t, group);
#endif
+#endif
//#define __NR_break 17
@@ -325,11 +333,13 @@ gid_t getegid(void)
//#define __NR_acct 51
+#ifdef __NR_umount2 /* Old kernels don't have umount2 */
//#define __NR_umount2 52
#ifdef L_umount2
#include <sys/mount.h>
_syscall2(int, umount2, const char *, special_file, int, flags);
#endif
+#endif
//#define __NR_lock 53
@@ -639,6 +649,7 @@ _syscall2(int, statfs, const char *, path, struct statfs *, buf);
_syscall2(int, fstatfs, int, fd, struct statfs *, buf);
#endif
+#ifndef __HAS_NO_MMU__
//#define __NR_ioperm 101
#ifdef L_ioperm
#include <sys/io.h>
@@ -646,6 +657,7 @@ syscall3(int, ioperm, unsigned, long, from, unsigned long, num, int,
turn_on);
#endif
+#endif
//#define __NR_socketcall 102
#ifdef L_socketcall
@@ -737,11 +749,13 @@ int fstat(int fd, struct libc_stat *cstat)
//#define __NR_olduname 109
+#ifndef __HAS_NO_MMU__
//#define __NR_iopl 110
#ifdef L_iopl
#include <sys/io.h>
_syscall1(int, iopl, int, level);
#endif
+#endif
//#define __NR_vhangup 111
#ifdef L_vhangup