From owner-freebsd-bugs Thu Apr 13 13:30: 7 2000 Delivered-To: freebsd-bugs@freebsd.org Received: from freefall.freebsd.org (freefall.FreeBSD.ORG [204.216.27.21]) by hub.freebsd.org (Postfix) with ESMTP id 8B26137BDD1 for ; Thu, 13 Apr 2000 13:30:01 -0700 (PDT) (envelope-from gnats@FreeBSD.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.9.3/8.9.2) id NAA22742; Thu, 13 Apr 2000 13:30:01 -0700 (PDT) (envelope-from gnats@FreeBSD.org) Received: from caribbean.sea-incorporated.com (caribbean.sea-incorporated.com [209.74.10.130]) by hub.freebsd.org (Postfix) with ESMTP id 3286B37B95B for ; Thu, 13 Apr 2000 13:20:05 -0700 (PDT) (envelope-from geoff@caribbean.sea-incorporated.com) Received: (from geoff@localhost) by caribbean.sea-incorporated.com (8.9.3/8.9.3) id PAA57090; Thu, 13 Apr 2000 15:54:02 -0400 (EDT) (envelope-from geoff) Message-Id: <200004131954.PAA57090@caribbean.sea-incorporated.com> Date: Thu, 13 Apr 2000 15:54:02 -0400 (EDT) From: "Geoffrey C. Speicher" Reply-To: geoff@caribbean.sea-incorporated.com To: FreeBSD-gnats-submit@freebsd.org X-Send-Pr-Version: 3.2 Subject: i386/17991: linux module doesn't implement pread/pwrite Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org >Number: 17991 >Category: i386 >Synopsis: linux module doesn't implement pread/pwrite >Confidential: no >Severity: non-critical >Priority: medium >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: change-request >Submitter-Id: current-users >Arrival-Date: Thu Apr 13 13:30:01 PDT 2000 >Closed-Date: >Last-Modified: >Originator: Geoffrey C. Speicher >Release: FreeBSD 3.2-RELEASE i386 >Organization: Software Engineering Associates, Inc. >Environment: FreeBSD baltic.sea-incorporated.com 4.0-STABLE FreeBSD 4.0-STABLE #2: Wed Apr 12 14:22:44 GMT 2000 geoff@baltic.sea-incorporated.com:/usr/src/sys/compile/GENERIC i386 >Description: The Linux module doesn't implement pread/pwrite syscalls, which are now required by glibc and the new InterBase 6.0 beta kit for Linux. >How-To-Repeat: N/A >Fix: Apply following patches to files in /usr/src/sys/i386/linux/ then make linux_sysent.c and rebuild Linux module: *** /usr/src/sys/i386/linux/linux_dummy.c.orig Wed Apr 12 10:00:43 2000 --- /usr/src/sys/i386/linux/linux_dummy.c Wed Apr 12 10:00:59 2000 *************** *** 98,105 **** DUMMY(rt_sigpending); DUMMY(rt_sigtimedwait); DUMMY(rt_sigqueueinfo); - DUMMY(pread); - DUMMY(pwrite); DUMMY(capget); DUMMY(capset); DUMMY(sendfile); --- 98,103 ---- *** /usr/src/sys/i386/linux/linux_file.c.orig Wed Apr 12 16:53:09 2000 --- /usr/src/sys/i386/linux/linux_file.c Wed Apr 12 17:09:44 2000 *************** *** 891,893 **** --- 891,930 ---- bsd.fd = uap->fd; return fsync(p, &bsd); } + + int + linux_pread(struct proc *p, struct linux_pread_args *args) + { + struct pread_args /* { + int fd; + void *buf; + size_t nbyte; + int pad; + off_t offset; + } */ bsd; + + bsd.fd = args->d; + bsd.buf = args->buf; + bsd.nbyte = args->nbytes; + bsd.offset = args->offset; + return pread(p, &bsd); + } + + int + linux_pwrite(struct proc *p, struct linux_pwrite_args *args) + { + struct pwrite_args /* { + int fd; + const void *buf; + size_t nbyte; + int pad; + off_t offset; + } */ bsd; + + bsd.fd = args->d; + bsd.buf = args->buf; + bsd.nbyte = args->nbytes; + bsd.offset = args->offset; + return pwrite(p, &bsd); + } + *** /usr/src/sys/i386/linux/syscalls.master.orig Wed Apr 12 09:58:26 2000 --- /usr/src/sys/i386/linux/syscalls.master Wed Apr 12 16:52:34 2000 *************** *** 265,272 **** 178 STD LINUX { int linux_rt_sigqueueinfo(void); } 179 STD LINUX { int linux_rt_sigsuspend(linux_sigset_t *newset, \ size_t sigsetsize); } ! 180 STD LINUX { int linux_pread(void); } ! 181 STD LINUX { int linux_pwrite(void); } 182 STD LINUX { int linux_chown(char *path, int uid, int gid); } 183 STD LINUX { int linux_getcwd(char *buf, unsigned long bufsize); } 184 STD LINUX { int linux_capget(void); } --- 265,274 ---- 178 STD LINUX { int linux_rt_sigqueueinfo(void); } 179 STD LINUX { int linux_rt_sigsuspend(linux_sigset_t *newset, \ size_t sigsetsize); } ! 180 STD LINUX { int linux_pread(int d, char *buf, \ ! u_int nbytes, off_t offset); } ! 181 STD LINUX { int linux_pwrite(int d, const char *buf, \ ! u_int nbytes, off_t offset); } 182 STD LINUX { int linux_chown(char *path, int uid, int gid); } 183 STD LINUX { int linux_getcwd(char *buf, unsigned long bufsize); } 184 STD LINUX { int linux_capget(void); } >Release-Note: >Audit-Trail: >Unformatted: To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message