[PATCH 4/4] Consolidate pwrite/pwrite64 implementations

Mike Frysinger vapier@gentoo.org
Tue Dec 29 17:28:00 GMT 2015


On 18 Nov 2015 12:02, Adhemerval Zanella wrote:
> This patch consolidates all the pwrite/pwrite64 implementation for Linux
> in only one (sysdeps/unix/sysv/linux/pwrite{64}.c).  It also removes the
> syscall from the auto-generation using assembly macros.
> 
> For pwrite{64} offset argument placement the new SYSCALL_LL{64} macro
> is used.  For pwrite ports that do not define __NR_pwrite will use
> __NR_pwrite64 and for pwrite64 ports that dot define __NR_pwrite64 will
> use __NR_pwrite for the syscall.

pretty sure you just broke sh here.  while it doesn't have the 64-bit
arg alignment issue, it has a wart where it copied the kernel interface
of one.  you can see it in the files you deleted:

> --- a/sysdeps/unix/sysv/linux/sh/pwrite.c
> +++ /dev/null
>
> -ssize_t
> -__libc_pwrite (int fd, const void *buf, size_t count, off_t offset)
> -{
> -  return SYSCALL_CANCEL (pwrite, fd, buf, count, 0,
> -			 __LONG_LONG_PAIR (offset >> 31, offset));
> -}
> --- a/sysdeps/unix/sysv/linux/sh/pwrite64.c
> +++ /dev/null
>
> -ssize_t
> -__libc_pwrite64 (int fd, const void *buf, size_t count, off64_t offset)
> -{
> -  return SYSCALL_CANCEL (pwrite, fd, buf, count, 0,
> -			 __LONG_LONG_PAIR ((off_t) (offset >> 32),
> -					   (off_t) (offset & 0xffffffff)));
> -}
-mike
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://sourceware.org/pipermail/libc-alpha/attachments/20151229/d18b9c06/attachment.sig>


More information about the Libc-alpha mailing list