summaryrefslogtreecommitdiffstats
path: root/sys/compat/linux/linux_file.c
diff options
context:
space:
mode:
authortedu <tedu@openbsd.org>2011-07-07 01:19:39 +0000
committertedu <tedu@openbsd.org>2011-07-07 01:19:39 +0000
commitfbf7d76740c1b7b509979f05d8e13dfb66028cff (patch)
treee4d1f60018f9ba7e0926e8578367f935db0e5a89 /sys/compat/linux/linux_file.c
parentDocument extended-precision routines. (diff)
downloadwireguard-openbsd-fbf7d76740c1b7b509979f05d8e13dfb66028cff.tar.xz
wireguard-openbsd-fbf7d76740c1b7b509979f05d8e13dfb66028cff.zip
remove all the old COMPAT_43 syscalls. The option itself remains for
the other things it enables. Move a few old wrappers into linux compat where they are still being used. ok deraadt guenther
Diffstat (limited to 'sys/compat/linux/linux_file.c')
-rw-r--r--sys/compat/linux/linux_file.c46
1 files changed, 44 insertions, 2 deletions
diff --git a/sys/compat/linux/linux_file.c b/sys/compat/linux/linux_file.c
index 3cce3741841..584aaf10bff 100644
--- a/sys/compat/linux/linux_file.c
+++ b/sys/compat/linux/linux_file.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: linux_file.c,v 1.24 2010/07/26 01:56:27 guenther Exp $ */
+/* $OpenBSD: linux_file.c,v 1.25 2011/07/07 01:19:39 tedu Exp $ */
/* $NetBSD: linux_file.c,v 1.15 1996/05/20 01:59:09 fvdl Exp $ */
/*
@@ -205,6 +205,26 @@ linux_sys_open(p, v, retval)
return 0;
}
+int
+linux_sys_lseek(p, v, retval)
+ struct proc *p;
+ void *v;
+ register_t *retval;
+{
+ struct linux_sys_lseek_args /* {
+ syscallarg(int) fd;
+ syscallarg(long) offset;
+ syscallarg(int) whence;
+ } */ *uap = v;
+ struct sys_lseek_args bla;
+
+ SCARG(&bla, fd) = SCARG(uap, fd);
+ SCARG(&bla, offset) = SCARG(uap, offset);
+ SCARG(&bla, whence) = SCARG(uap, whence);
+
+ return sys_lseek(p, &bla, retval);
+}
+
/*
* This appears to be part of a Linux attempt to switch to 64 bits file sizes.
*/
@@ -828,6 +848,24 @@ linux_sys_readlink(p, v, retval)
}
int
+linux_sys_ftruncate(p, v, retval)
+ struct proc *p;
+ void *v;
+ register_t *retval;
+{
+ struct linux_sys_ftruncate_args /* {
+ syscallarg(int) fd;
+ syscallarg(long) length;
+ } */ *uap = v;
+ struct sys_ftruncate_args sta;
+
+ SCARG(&sta, fd) = SCARG(uap, fd);
+ SCARG(&sta, length) = SCARG(uap, length);
+
+ return sys_ftruncate(p, uap, retval);
+}
+
+int
linux_sys_truncate(p, v, retval)
struct proc *p;
void *v;
@@ -838,10 +876,14 @@ linux_sys_truncate(p, v, retval)
syscallarg(long) length;
} */ *uap = v;
caddr_t sg = stackgap_init(p->p_emul);
+ struct sys_truncate_args sta;
LINUX_CHECK_ALT_EXIST(p, &sg, SCARG(uap, path));
- return compat_43_sys_truncate(p, uap, retval);
+ SCARG(&sta, path) = SCARG(uap, path);
+ SCARG(&sta, length) = SCARG(uap, length);
+
+ return sys_truncate(p, &sta, retval);
}
/*