Bug 5258

Summary: pread()/pwrite() should default to __NR_pread64/__NR_pwrite64
Product: uClibc Reporter: David Laight <david.laight>
Component: Standard ComplianceAssignee: unassigned
Status: RESOLVED FIXED    
Severity: minor CC: uclibc-cvs
Priority: P5    
Version: unspecified   
Target Milestone: ---   
Hardware: Other   
OS: Linux   
Host: Target:
Build:

Description David Laight 2012-05-29 08:41:09 UTC
The uClibc stubs for pread() and pwrite() for powerpc (and possibly other architectures) are attempted to be implemented using multiple lseek calls. This is broken for just so many reasons.

Even for non-threaded programs the cost of the extra system calls is significant.

A proper system call stub can easily be generated by copying the mmap code.

AFAICT this affects all versions of uClibc, we are still using 0.9.27. I believe we can't update because of a binary incompatibility in a slightly later version.
Comment 1 Mike Frysinger 2012-05-30 05:04:41 UTC
the fallback hacks should not be used.  we should be hitting the kernel syscalls directly whenever possible.  this is merely a case of the kernel renamed their syscall names and uClibc missed the update.

i don't know what you mean by referring to mmap
Comment 3 David Laight 2012-05-30 08:08:13 UTC
I couldn't find the definition of __syscall_pread() or __syscall_pwrite(), but I didn't try to build it to see what happens.

There is an mmap.c in the 0.9.27 sources ...