From 0b9c8da8d155a86c41f425553d7a4dca4eb1b1c5 Mon Sep 17 00:00:00 2001 From: Nicolas Joly Date: Sun, 17 Feb 2008 21:49:17 +0000 Subject: [PATCH] pread/pwrite fixes: use SCARG_P32 to access pointers, and update syscalls definitions. --- sys/compat/linux32/arch/amd64/syscalls.master | 12 +++++++----- sys/compat/linux32/common/linux32_unistd.c | 16 ++++++++-------- 2 files changed, 15 insertions(+), 13 deletions(-) diff --git a/sys/compat/linux32/arch/amd64/syscalls.master b/sys/compat/linux32/arch/amd64/syscalls.master index c22db9fe34d..bf106f2cd0b 100644 --- a/sys/compat/linux32/arch/amd64/syscalls.master +++ b/sys/compat/linux32/arch/amd64/syscalls.master @@ -1,4 +1,4 @@ - $NetBSD: syscalls.master,v 1.28 2008/02/02 22:57:05 dsl Exp $ + $NetBSD: syscalls.master,v 1.29 2008/02/04 22:23:43 dsl Exp $ ; NetBSD i386 COMPAT_LINUX32 system call name/number "master" file. ; (See syscalls.conf to see what it is processed into.) @@ -307,10 +307,12 @@ 178 UNIMPL rt_queueinfo 179 STD { int linux32_sys_rt_sigsuspend(linux32_sigsetp_t unewset, \ netbsd32_size_t sigsetsize); } -180 STD { int linux32_sys_pread(int fd, char *buf, \ - netbsd32_size_t nbyte, int32_t offset); } -181 STD { int linux32_sys_pwrite(int fd, char *buf, \ - netbsd32_size_t nbyte, int32_t offset); } +180 STD { netbsd32_ssize_t linux32_sys_pread(int fd, \ + netbsd32_voidp buf, netbsd32_size_t nbyte, \ + linux32_off_t offset); } +181 STD { netbsd32_ssize_t linux32_sys_pwrite(int fd, \ + const netbsd32_voidp buf, netbsd32_size_t nbyte, \ + linux32_off_t offset); } 182 STD { int linux32_sys_chown16(const netbsd32_charp path, \ linux32_uid16_t uid, linux32_gid16_t gid); } 183 NOARGS { int netbsd32___getcwd(netbsd32_charp bufp, \ diff --git a/sys/compat/linux32/common/linux32_unistd.c b/sys/compat/linux32/common/linux32_unistd.c index 0639a277e8a..105252fa992 100644 --- a/sys/compat/linux32/common/linux32_unistd.c +++ b/sys/compat/linux32/common/linux32_unistd.c @@ -1,4 +1,4 @@ -/* $NetBSD: linux32_unistd.c,v 1.19 2008/01/15 22:38:36 njoly Exp $ */ +/* $NetBSD: linux32_unistd.c,v 1.20 2008/02/02 22:57:05 dsl Exp $ */ /*- * Copyright (c) 2006 Emmanuel Dreyfus, all rights reserved. @@ -33,7 +33,7 @@ #include -__KERNEL_RCSID(0, "$NetBSD: linux32_unistd.c,v 1.19 2008/01/15 22:38:36 njoly Exp $"); +__KERNEL_RCSID(0, "$NetBSD: linux32_unistd.c,v 1.20 2008/02/02 22:57:05 dsl Exp $"); #include #include @@ -493,14 +493,14 @@ linux32_sys_pread(struct lwp *l, { /* { syscallarg(int) fd; - syscallarg(void *) buf; + syscallarg(netbsd32_voidp) buf; syscallarg(netbsd32_size_t) nbyte; - syscallarg(int32_t) offset; + syscallarg(linux32_off_t) offset; } */ struct sys_pread_args pra; SCARG(&pra, fd) = SCARG(uap, fd); - SCARG(&pra, buf) = SCARG(uap, buf); + SCARG(&pra, buf) = SCARG_P32(uap, buf); SCARG(&pra, nbyte) = SCARG(uap, nbyte); SCARG(&pra, offset) = SCARG(uap, offset); @@ -516,14 +516,14 @@ linux32_sys_pwrite(struct lwp *l, { /* { syscallarg(int) fd; - syscallarg(void *) buf; + syscallarg(const netbsd32_voidp) buf; syscallarg(netbsd32_size_t) nbyte; - syscallarg(int32_t) offset; + syscallarg(linux32_off_t) offset; } */ struct sys_pwrite_args pra; SCARG(&pra, fd) = SCARG(uap, fd); - SCARG(&pra, buf) = SCARG(uap, buf); + SCARG(&pra, buf) = SCARG_P32(uap, buf); SCARG(&pra, nbyte) = SCARG(uap, nbyte); SCARG(&pra, offset) = SCARG(uap, offset); -- 2.11.4.GIT