mirror of
https://sourceware.org/git/glibc.git
synced 2025-07-28 00:21:52 +03:00
Linux: Clean up preadv2, pwritev2 system call names
With the built-in tables __NR_preadv2 and __NR_pwritev2 are always defined. The kernel has never defined __NR_preadv64v2 and __NR_pwritev64v2 and is unlikely to do so, given that the preadv2 and pwritev2 system calls themselves are 64-bit. Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
This commit is contained in:
@ -21,20 +21,15 @@
|
|||||||
|
|
||||||
#ifndef __OFF_T_MATCHES_OFF64_T
|
#ifndef __OFF_T_MATCHES_OFF64_T
|
||||||
|
|
||||||
# if !defined (__NR_preadv2) && defined (__NR_pread64v2)
|
|
||||||
# define __NR_preadv2 __NR_pread64v2
|
|
||||||
# endif
|
|
||||||
|
|
||||||
ssize_t
|
ssize_t
|
||||||
preadv2 (int fd, const struct iovec *vector, int count, off_t offset,
|
preadv2 (int fd, const struct iovec *vector, int count, off_t offset,
|
||||||
int flags)
|
int flags)
|
||||||
{
|
{
|
||||||
# ifdef __NR_preadv2
|
|
||||||
ssize_t result = SYSCALL_CANCEL (preadv2, fd, vector, count,
|
ssize_t result = SYSCALL_CANCEL (preadv2, fd, vector, count,
|
||||||
LO_HI_LONG (offset), flags);
|
LO_HI_LONG (offset), flags);
|
||||||
if (result >= 0 || errno != ENOSYS)
|
if (result >= 0 || errno != ENOSYS)
|
||||||
return result;
|
return result;
|
||||||
# endif
|
|
||||||
/* Trying to emulate the preadv2 syscall flags is troublesome:
|
/* Trying to emulate the preadv2 syscall flags is troublesome:
|
||||||
|
|
||||||
* We can not temporary change the file state of the O_DSYNC and O_SYNC
|
* We can not temporary change the file state of the O_DSYNC and O_SYNC
|
||||||
|
@ -19,20 +19,15 @@
|
|||||||
#include <sys/uio.h>
|
#include <sys/uio.h>
|
||||||
#include <sysdep-cancel.h>
|
#include <sysdep-cancel.h>
|
||||||
|
|
||||||
#if !defined(__NR_preadv64v2) && defined(__NR_preadv2)
|
|
||||||
# define __NR_preadv64v2 __NR_preadv2
|
|
||||||
#endif
|
|
||||||
|
|
||||||
ssize_t
|
ssize_t
|
||||||
preadv64v2 (int fd, const struct iovec *vector, int count, off64_t offset,
|
preadv64v2 (int fd, const struct iovec *vector, int count, off64_t offset,
|
||||||
int flags)
|
int flags)
|
||||||
{
|
{
|
||||||
#ifdef __NR_preadv64v2
|
ssize_t result = SYSCALL_CANCEL (preadv2, fd, vector, count,
|
||||||
ssize_t result = SYSCALL_CANCEL (preadv64v2, fd, vector, count,
|
|
||||||
LO_HI_LONG (offset), flags);
|
LO_HI_LONG (offset), flags);
|
||||||
if (result >= 0 || errno != ENOSYS)
|
if (result >= 0 || errno != ENOSYS)
|
||||||
return result;
|
return result;
|
||||||
#endif
|
|
||||||
/* Trying to emulate the preadv2 syscall flags is troublesome:
|
/* Trying to emulate the preadv2 syscall flags is troublesome:
|
||||||
|
|
||||||
* We can not temporary change the file state of the O_DSYNC and O_SYNC
|
* We can not temporary change the file state of the O_DSYNC and O_SYNC
|
||||||
|
@ -25,12 +25,12 @@ ssize_t
|
|||||||
pwritev2 (int fd, const struct iovec *vector, int count, off_t offset,
|
pwritev2 (int fd, const struct iovec *vector, int count, off_t offset,
|
||||||
int flags)
|
int flags)
|
||||||
{
|
{
|
||||||
# ifdef __NR_pwritev2
|
|
||||||
ssize_t result = SYSCALL_CANCEL (pwritev2, fd, vector, count,
|
ssize_t result = SYSCALL_CANCEL (pwritev2, fd, vector, count,
|
||||||
LO_HI_LONG (offset), flags);
|
LO_HI_LONG (offset), flags);
|
||||||
if (result >= 0 || errno != ENOSYS)
|
if (result >= 0 || errno != ENOSYS)
|
||||||
return result;
|
return result;
|
||||||
# endif
|
|
||||||
/* Trying to emulate the pwritev2 syscall flags is troublesome:
|
/* Trying to emulate the pwritev2 syscall flags is troublesome:
|
||||||
|
|
||||||
* We can not temporary change the file state of the O_DSYNC and O_SYNC
|
* We can not temporary change the file state of the O_DSYNC and O_SYNC
|
||||||
|
@ -19,20 +19,15 @@
|
|||||||
#include <sys/uio.h>
|
#include <sys/uio.h>
|
||||||
#include <sysdep-cancel.h>
|
#include <sysdep-cancel.h>
|
||||||
|
|
||||||
#if !defined(__NR_pwritev64v2) && defined(__NR_pwritev2)
|
|
||||||
# define __NR_pwritev64v2 __NR_pwritev2
|
|
||||||
#endif
|
|
||||||
|
|
||||||
ssize_t
|
ssize_t
|
||||||
pwritev64v2 (int fd, const struct iovec *vector, int count, off64_t offset,
|
pwritev64v2 (int fd, const struct iovec *vector, int count, off64_t offset,
|
||||||
int flags)
|
int flags)
|
||||||
{
|
{
|
||||||
#ifdef __NR_pwritev64v2
|
ssize_t result = SYSCALL_CANCEL (pwritev2, fd, vector, count,
|
||||||
ssize_t result = SYSCALL_CANCEL (pwritev64v2, fd, vector, count,
|
|
||||||
LO_HI_LONG (offset), flags);
|
LO_HI_LONG (offset), flags);
|
||||||
if (result >= 0 || errno != ENOSYS)
|
if (result >= 0 || errno != ENOSYS)
|
||||||
return result;
|
return result;
|
||||||
#endif
|
|
||||||
/* Trying to emulate the pwritev2 syscall flags is troublesome:
|
/* Trying to emulate the pwritev2 syscall flags is troublesome:
|
||||||
|
|
||||||
* We can not temporary change the file state of the O_DSYNC and O_SYNC
|
* We can not temporary change the file state of the O_DSYNC and O_SYNC
|
||||||
|
Reference in New Issue
Block a user