Bug 5258 - pread()/pwrite() should default to __NR_pread64/__NR_pwrite64
Summary: pread()/pwrite() should default to __NR_pread64/__NR_pwrite64
Status: RESOLVED FIXED
Alias: None
Product: uClibc
Classification: Unclassified
Component: Standard Compliance (show other bugs)
Version: unspecified
Hardware: Other Linux
: P5 minor
Target Milestone: ---
Assignee: unassigned
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-05-29 08:41 UTC by David Laight
Modified: 2012-05-30 08:08 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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 ...