Issue 121614 - SAL Unix file handling : pread/pwrite vs lseek
SAL Unix file handling : pread/pwrite vs lseek
Status: RESOLVED FIXED
Product: General
Classification: Code
Component: code
4.0.0-dev
All Mac OSX, all
: P3 trivial (vote)
: 4.0.0
Assigned To: AOO issues mailing list
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2013-01-13 15:50 UTC by Pedro Giffuni
Modified: 2013-07-12 09:19 UTC (History)
1 user (show)

See Also:
Issue Type: ENHANCEMENT
Latest Confirmation on: ---
Developer Difficulty: easy


Attachments
Use pread for FreeBSD/MacOSX too (1.77 KB, patch)
2013-01-13 15:50 UTC, Pedro Giffuni
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this issue.
Description Pedro Giffuni 2013-01-13 15:50:44 UTC
Created attachment 80142 [details]
Use pread for FreeBSD/MacOSX too

We are currently using pread/pwrite in sal/osl/unx/file.cxx
but only for the linux/Solaris case. According to FreeBSD's man page, "The pread(2) function appeared in AT&T System V Release 4 UNIX." and it is available in FreeBSD and MacOSX.

The code should probably be cleaned to use it everywhere though.
Comment 1 Pedro Giffuni 2013-01-14 03:42:13 UTC
The issue was found originally by Riccardo Magliocchetti and reported on a LibreOffice mailinglist.

My patch is completely different because my main interest is FreeBSD, but a cleaner workaround is very easy and left as an exercise for the reader.
Comment 2 SVN Robot 2013-01-14 21:04:19 UTC
"pfg" committed SVN revision 1433129 into trunk:
i121614 - SAL Unix file handling: used pread/pwrite on FreeBSD
Comment 3 Pedro Giffuni 2013-02-01 21:36:42 UTC
I didn't clean out the old code but at least I added the important cases.
Comment 4 hdu@apache.org 2013-07-12 09:19:27 UTC
Fixed for FreeBSD and MacOSX in AOO 4.0.0