FreeBSD lacks preadv() and pwritev(). Since all underlying code already supports the functionality it is very easy to add. NetBSD and OpenBSD have had these calls, that are useful in multi-threaded fileaccess, for years now and for orthogonality it's nice to have them as well. Fix: Patches for 5.4-STABLE and 6-CURRENT to follow: 5.4-STABLE.patch: 6-CURRENT.patch:
New patches are at http://www.stack.nl/~marcolz/FreeBSD/preadv.current.patch.txt and http://www.stack.nl/~marcolz/FreeBSD/preadv.stable.patch.txt Marc
Updated the patches again: http://www.stack.nl/~marcolz/FreeBSD/preadv.current.20050627.patch.txt After patching, type 'make syscalls.c' in /usr/src/sys/kern and 'make sysent' in /usr/src/sys/compat/freebsd32/ Could someone please take a look at it / commit it ? Or do you want me to put the files generated by the two 'make's into the patch as well ? I figured it would be better not to, since they are generated anyway... Marc
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@FreeBSD.org> <>< http://www.FreeBSD.org/~jhb/ "Power Users Use the Power to Serve" = http://www.FreeBSD.org
State Changed From-To: open->patched Will MFC in a week or so.
Unless this is going to be merged to RELENG_4 as well (I initially built it on RELENG_4, but don't have problems keeping the patch in my local source tree), I'd say let's close this PR... :-) Marc
State Changed From-To: patched->closed Requested by submitter.
On Thursday 22 September 2005 05:55 am, Marc Olzheim wrote: > Unless this is going to be merged to RELENG_4 as well (I initially built > it on RELENG_4, but don't have problems keeping the patch in my local > source tree), I'd say let's close this PR... :-) Ok. Did I put it in 5? -- John Baldwin <jhb@FreeBSD.org> <>< http://www.FreeBSD.org/~jhb/ "Power Users Use the Power to Serve" = http://www.FreeBSD.org