summaryrefslogtreecommitdiff
path: root/sys/kern
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>2022-08-01 14:57:00 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>2022-08-01 14:57:00 +0000
commit1cecbd9931ba4c4dfe06967811b065b88d52131f (patch)
treeed903b918c72019a9a9a192a533ea00946fafd4b /sys/kern
parent35d8a897be1962cb5c9381c5f324f3707cb9c065 (diff)
some ports bootstraps, and go internals, need a bit more time to adapt
to the padded syscalls going away.
Diffstat (limited to 'sys/kern')
-rw-r--r--sys/kern/syscalls.master31
-rw-r--r--sys/kern/vfs_syscalls.c94
2 files changed, 114 insertions, 11 deletions
diff --git a/sys/kern/syscalls.master b/sys/kern/syscalls.master
index 4dd15aa4dcc..cf4612e067b 100644
--- a/sys/kern/syscalls.master
+++ b/sys/kern/syscalls.master
@@ -1,4 +1,4 @@
-; $OpenBSD: syscalls.master,v 1.228 2022/07/20 05:55:08 deraadt Exp $
+; $OpenBSD: syscalls.master,v 1.229 2022/08/01 14:56:59 deraadt Exp $
; $NetBSD: syscalls.master,v 1.32 1996/04/23 10:24:21 mycroft Exp $
; @(#)syscalls.master 8.2 (Berkeley) 1/13/94
@@ -324,8 +324,10 @@
172 STD NOLOCK { ssize_t sys_pwritev(int fd, \
const struct iovec *iovp, int iovcnt, \
off_t offset); }
-173 UNIMPL pad_pread
-174 UNIMPL pad_pwrite
+173 STD NOLOCK { ssize_t sys_pad_pread(int fd, void *buf, \
+ size_t nbyte, int pad, off_t offset); }
+174 STD NOLOCK { ssize_t sys_pad_pwrite(int fd, const void *buf, \
+ size_t nbyte, int pad, off_t offset); }
175 UNIMPL ntp_gettime
176 UNIMPL ntp_adjtime
177 UNIMPL
@@ -352,11 +354,14 @@
195 STD NOLOCK { int sys_setrlimit(int which, \
const struct rlimit *rlp); }
196 OBSOL ogetdirentries48
-197 UNIMPL pad_mmap
+197 STD { void *sys_pad_mmap(void *addr, size_t len, int prot, \
+ int flags, int fd, long pad, off_t pos); }
198 INDIR { quad_t sys___syscall(quad_t num, ...); }
-199 UNIMPL pad_lseek
-200 UNIMPL pad_truncate
-201 UNIMPL pad_ftruncate
+199 STD NOLOCK { off_t sys_pad_lseek(int fd, int pad, off_t offset, \
+ int whence); }
+200 STD { int sys_pad_truncate(const char *path, int pad, \
+ off_t length); }
+201 STD { int sys_pad_ftruncate(int fd, int pad, off_t length); }
202 STD { int sys_sysctl(const int *name, u_int namelen, \
void *old, size_t *oldlenp, void *new, \
size_t newlen); }
@@ -455,8 +460,12 @@
264 STD { int sys_fhopen(const fhandle_t *fhp, int flags); }
265 UNIMPL
266 UNIMPL
-267 UNIMPL pad_preadv
-268 UNIMPL pad_pwritev
+267 STD NOLOCK { ssize_t sys_pad_preadv(int fd, \
+ const struct iovec *iovp, int iovcnt, \
+ int pad, off_t offset); }
+268 STD NOLOCK { ssize_t sys_pad_pwritev(int fd, \
+ const struct iovec *iovp, int iovcnt, \
+ int pad, off_t offset); }
269 STD NOLOCK { int sys_kqueue(void); }
270 OBSOL t32_kevent
271 STD { int sys_mlockall(int flags); }
@@ -478,7 +487,9 @@
284 STD { int sys_setresgid(gid_t rgid, gid_t egid, \
gid_t sgid); }
285 OBSOL sys_omquery
-286 UNIMPL pad_mquery
+286 STD { void *sys_pad_mquery(void *addr, size_t len, \
+ int prot, int flags, int fd, long pad, \
+ off_t pos); }
287 STD NOLOCK { int sys_closefrom(int fd); }
288 STD { int sys_sigaltstack(const struct sigaltstack *nss, \
struct sigaltstack *oss); }
diff --git a/sys/kern/vfs_syscalls.c b/sys/kern/vfs_syscalls.c
index c69e513ddd6..13695585ee9 100644
--- a/sys/kern/vfs_syscalls.c
+++ b/sys/kern/vfs_syscalls.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: vfs_syscalls.c,v 1.358 2022/07/20 05:56:36 deraadt Exp $ */
+/* $OpenBSD: vfs_syscalls.c,v 1.359 2022/08/01 14:56:59 deraadt Exp $ */
/* $NetBSD: vfs_syscalls.c,v 1.71 1996/04/23 10:29:02 mycroft Exp $ */
/*
@@ -1936,6 +1936,20 @@ sys_lseek(struct proc *p, void *v, register_t *retval)
return (error);
}
+#if 1
+int
+sys_pad_lseek(struct proc *p, void *v, register_t *retval)
+{
+ struct sys_pad_lseek_args *uap = v;
+ struct sys_lseek_args unpad;
+
+ SCARG(&unpad, fd) = SCARG(uap, fd);
+ SCARG(&unpad, offset) = SCARG(uap, offset);
+ SCARG(&unpad, whence) = SCARG(uap, whence);
+ return sys_lseek(p, &unpad, retval);
+}
+#endif
+
/*
* Check access permissions.
*/
@@ -2881,6 +2895,30 @@ bad:
return (error);
}
+#if 1
+int
+sys_pad_truncate(struct proc *p, void *v, register_t *retval)
+{
+ struct sys_pad_truncate_args *uap = v;
+ struct sys_truncate_args unpad;
+
+ SCARG(&unpad, path) = SCARG(uap, path);
+ SCARG(&unpad, length) = SCARG(uap, length);
+ return sys_truncate(p, &unpad, retval);
+}
+
+int
+sys_pad_ftruncate(struct proc *p, void *v, register_t *retval)
+{
+ struct sys_pad_ftruncate_args *uap = v;
+ struct sys_ftruncate_args unpad;
+
+ SCARG(&unpad, fd) = SCARG(uap, fd);
+ SCARG(&unpad, length) = SCARG(uap, length);
+ return sys_ftruncate(p, &unpad, retval);
+}
+#endif
+
/*
* Sync an open file.
*/
@@ -3363,3 +3401,57 @@ sys_pwritev(struct proc *p, void *v, register_t *retval)
iovec_free(iov, iovcnt);
return (error);
}
+
+#if 1
+int
+sys_pad_pread(struct proc *p, void *v, register_t *retval)
+{
+ struct sys_pad_pread_args *uap = v;
+ struct sys_pread_args unpad;
+
+ SCARG(&unpad, fd) = SCARG(uap, fd);
+ SCARG(&unpad, buf) = SCARG(uap, buf);
+ SCARG(&unpad, nbyte) = SCARG(uap, nbyte);
+ SCARG(&unpad, offset) = SCARG(uap, offset);
+ return sys_pread(p, &unpad, retval);
+}
+
+int
+sys_pad_preadv(struct proc *p, void *v, register_t *retval)
+{
+ struct sys_pad_preadv_args *uap = v;
+ struct sys_preadv_args unpad;
+
+ SCARG(&unpad, fd) = SCARG(uap, fd);
+ SCARG(&unpad, iovp) = SCARG(uap, iovp);
+ SCARG(&unpad, iovcnt) = SCARG(uap, iovcnt);
+ SCARG(&unpad, offset) = SCARG(uap, offset);
+ return sys_preadv(p, &unpad, retval);
+}
+
+int
+sys_pad_pwrite(struct proc *p, void *v, register_t *retval)
+{
+ struct sys_pad_pwrite_args *uap = v;
+ struct sys_pwrite_args unpad;
+
+ SCARG(&unpad, fd) = SCARG(uap, fd);
+ SCARG(&unpad, buf) = SCARG(uap, buf);
+ SCARG(&unpad, nbyte) = SCARG(uap, nbyte);
+ SCARG(&unpad, offset) = SCARG(uap, offset);
+ return sys_pwrite(p, &unpad, retval);
+}
+
+int
+sys_pad_pwritev(struct proc *p, void *v, register_t *retval)
+{
+ struct sys_pad_pwritev_args *uap = v;
+ struct sys_pwritev_args unpad;
+
+ SCARG(&unpad, fd) = SCARG(uap, fd);
+ SCARG(&unpad, iovp) = SCARG(uap, iovp);
+ SCARG(&unpad, iovcnt) = SCARG(uap, iovcnt);
+ SCARG(&unpad, offset) = SCARG(uap, offset);
+ return sys_pwritev(p, &unpad, retval);
+}
+#endif