Date: Thu, 13 Apr 2000 15:54:02 -0400 (EDT) From: "Geoffrey C. Speicher" <geoff@caribbean.sea-incorporated.com> To: FreeBSD-gnats-submit@freebsd.org Subject: i386/17991: linux module doesn't implement pread/pwrite Message-ID: <200004131954.PAA57090@caribbean.sea-incorporated.com>
next in thread | raw e-mail | index | archive | help
>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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200004131954.PAA57090>
