kern/80362: [PATCH] add preadv() and pwritev() system calls
John Baldwin
jhb at FreeBSD.org
Tue Jul 5 19:53:25 GMT 2005
The following reply was made to PR kern/80362; it has been noted by GNATS.
From: John Baldwin <jhb at FreeBSD.org>
To: bug-followup at FreeBSD.org,
marcolz at stack.nl
Cc: sobomax at FreeBSD.org
Subject: Re: kern/80362: [PATCH] add preadv() and pwritev() system calls
Date: Tue, 5 Jul 2005 15:09:42 -0400
I've looked at this patch and have integrated into a test tree in P4 and
played with it some. The original patch didn't do any of the extra checks
that pread() and pwrite() do compared to read() and write() in the preadv()
and pwritev() functions (i.e. don't allow the operation on pipes and don't
allow negative offsets on devices in /dev). It also exposed some
implementation details in the kern_p{read,write}v() interface (FOF_OFFSET
flag) that normally should be hidden from the ABIs. Instead, I merged much
of the common code in dofile{read,write}() and the old kern_{read,write}v()
such that read() and write() just construct a uio and call kern_readv() and
kern_writev(), respectively. I then moved the extra p* checks into the
kern_preadv() and kern_pwritev() functions and made pread() and pwritev()
construct a simple uio and call the kern_foov() cousin as well. kern_foov()
now no longer calls kern_pfoov() but instead, both are simpler wrappers
around dofilefoo(). Also, the kern_pfoov() interface is simpler in that it
just takes arguments normally passed to the associated syscall. I didn't
change any of the docs for this, just the kernel side. The updated kernel
patch is at http://www.FreeBSD.org/~jhb/patches/preadv.patch
Marc, can you test it to make sure nothing was broken by all the reshuffling?
--
John Baldwin <jhb at FreeBSD.org> <>< http://www.FreeBSD.org/~jhb/
"Power Users Use the Power to Serve" = http://www.FreeBSD.org
More information about the freebsd-bugs
mailing list