summaryrefslogtreecommitdiff
path: root/sys/compat/linux
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>2003-08-02 18:37:07 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>2003-08-02 18:37:07 +0000
commita39a3381baea1f6cde799e3d8f3a96e517beffbc (patch)
treeac49ffde0d4b4b850dc861dc8535af3678454fd8 /sys/compat/linux
parent9d7bb4ee87ceba38a7813ee56e3174eb4f8d6575 (diff)
wrong args for linux ftruncate64; marius@monkey.org
Diffstat (limited to 'sys/compat/linux')
-rw-r--r--sys/compat/linux/linux_file64.c23
-rw-r--r--sys/compat/linux/syscalls.master14
2 files changed, 29 insertions, 8 deletions
diff --git a/sys/compat/linux/linux_file64.c b/sys/compat/linux/linux_file64.c
index 4e4f1213fe0..37d55183167 100644
--- a/sys/compat/linux/linux_file64.c
+++ b/sys/compat/linux/linux_file64.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: linux_file64.c,v 1.4 2002/12/16 16:27:41 fgsch Exp $ */
+/* $OpenBSD: linux_file64.c,v 1.5 2003/08/02 18:37:06 deraadt Exp $ */
/* $NetBSD: linux_file64.c,v 1.2 2000/12/12 22:24:56 jdolecek Exp $ */
/*-
@@ -229,6 +229,27 @@ linux_sys_truncate64(p, v, retval)
}
/*
+ * This is needed due to padding in OpenBSD's sys_ftruncate_args
+ */
+int
+linux_sys_ftruncate64(p, v, retval)
+ struct proc *p;
+ void *v;
+ register_t *retval;
+{
+ struct linux_sys_ftruncate64_args /* {
+ syscallarg(int) fd;
+ syscallarg(off_t) length;
+ } */ *uap = v;
+ struct sys_ftruncate_args fta;
+
+ SCARG(&fta, fd) = SCARG(uap, fd);
+ SCARG(&fta, length) = SCARG(uap, length);
+
+ return sys_ftruncate(p, &fta, retval);
+}
+
+/*
* The next two functions take care of converting the flock
* structure back and forth between Linux and OpenBSD format.
* The only difference in the structures is the order of
diff --git a/sys/compat/linux/syscalls.master b/sys/compat/linux/syscalls.master
index 226739eb780..09c9eb47944 100644
--- a/sys/compat/linux/syscalls.master
+++ b/sys/compat/linux/syscalls.master
@@ -1,4 +1,4 @@
- $OpenBSD: syscalls.master,v 1.39 2003/07/23 17:42:09 tedu Exp $
+ $OpenBSD: syscalls.master,v 1.40 2003/08/02 18:37:06 deraadt Exp $
; $NetBSD: syscalls.master,v 1.15 1995/12/18 14:35:10 fvdl Exp $
; @(#)syscalls.master 8.1 (Berkeley) 7/19/93
@@ -317,17 +317,17 @@
190 STD { int sys_vfork(void); }
191 STD { int linux_sys_ugetrlimit(u_int which, \
struct linux_rlimit *rlp); }
-192 STD { linux_off_t linux_sys_mmap2(unsigned long addr, \
+192 STD { linux_off_t linux_sys_mmap2(unsigned long addr, \
size_t len, int prot, int flags, int fd, \
linux_off_t offset); }
-193 STD { int linux_sys_truncate64(char *path, \
+193 STD { int linux_sys_truncate64(char *path, \
off_t length); }
-194 NOARGS linux_ftruncate64 { int sys_ftruncate(int fd, off_t length); }
-195 STD { int linux_sys_stat64(char *path, \
+194 STD { int linux_sys_ftruncate64(int fd, off_t length); }
+195 STD { int linux_sys_stat64(char *path, \
struct linux_stat64 *sp); }
-196 STD { int linux_sys_lstat64(char *path, \
+196 STD { int linux_sys_lstat64(char *path, \
struct linux_stat64 *sp); }
-197 STD { int linux_sys_fstat64(int fd, \
+197 STD { int linux_sys_fstat64(int fd, \
struct linux_stat64 *sp); }
198 NOARGS { int linux_sys_lchown(void); }
199 STD { uid_t linux_sys_getuid(void); }