[uClibc]Re: pread/pwrite broken w/o large file support
Ronald Wahl
rwa at peppercon.com
Thu Jul 4 07:34:45 UTC 2002
On 04 Jul 2002 09:01:07 +0200, Ronald Wahl wrote:
> On 04 Jul 2002 09:54:57 +0900, Miles Bader wrote:
>> presumably it would
>> have to be handled the same way truncate64 is, by explicitly splitting the
>> 64-bit argument into two 32-bit arguments on 32-bit architectures.
>> Does the glibc def really do the same thing?
> Ah, I looked wrong. :-/ For Linux you are right... It needs to be
> splitted (depending on byte order). But anyway - it needs to be fixed in
> uClibc.
Hmm, just tried splitting and it does not work for PowerPC. At least for
PowerPC my patch was correct:
glibc-2.2.5/sysdeps/unix/sysv/linux/mips/pread.c:
...
static ssize_t __emulate_pread (int fd, void *buf, size_t count,
off_t offset) internal_function;
...
ssize_t
__libc_pread (fd, buf, count, offset)
int fd;
void *buf;
size_t count;
off_t offset;
{
ssize_t result;
/* First try the syscall. */
result = INLINE_SYSCALL (pread, 6, fd, CHECK_N (buf, count), count, 0,
__LONG_LONG_PAIR (0, offset));
# if __ASSUME_PREAD_SYSCALL == 0
if (result == -1 && errno == ENOSYS)
/* No system call available. Use the emulation. */
result = __emulate_pread (fd, buf, count, offset);
# endif
return result;
}
...
ron
--
\\ Dipl.-Inf. Ronald Wahl | Peppercon AG //
\\\ rwa at peppercon.com ||| http://www.peppercon.com/ ///
\OO ----------------------- OOO ------------------------- OO/
OO GnuPG/PGP key available OOO Keep Systems running OO
More information about the uClibc
mailing list