2 Copyright (C) 2012-2015 Free Software Foundation, Inc.
3 This file is part of the GNU C Library.
5 The GNU C Library is free software; you can redistribute it and/or
6 modify it under the terms of the GNU Lesser General Public
7 License as published by the Free Software Foundation; either
8 version 2.1 of the License, or (at your option) any later version.
10 The GNU C Library is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Lesser General Public License for more details.
15 You should have received a copy of the GNU Lesser General Public
16 License along with the GNU C Library; if not, see
17 <http://www.gnu.org/licenses/>. */
21 #include <sys/param.h>
22 /* Hide the preadv64 declaration. */
23 #define preadv64 __redirect_preadv64
26 #include <sysdep-cancel.h>
27 #include <sys/syscall.h>
28 #include <kernel-features.h>
30 #ifndef __ASSUME_PREADV
31 static ssize_t
__atomic_preadv_replacement (int, const struct iovec
*,
32 int, off_t
) internal_function
;
36 preadv (int fd
, const struct iovec
*vector
, int count
, off_t offset
)
42 result
= INLINE_SYSCALL (preadv
, 4, fd
, vector
, count
, offset
);
45 int oldtype
= LIBC_CANCEL_ASYNC ();
47 result
= INLINE_SYSCALL (preadv
, 4, fd
, vector
, count
, offset
);
49 LIBC_CANCEL_RESET (oldtype
);
51 # ifdef __ASSUME_PREADV
56 #ifndef __ASSUME_PREADV
58 if (result
>= 0 || errno
!= ENOSYS
)
62 return __atomic_preadv_replacement (fd
, vector
, count
, offset
);
66 strong_alias (preadv
, preadv64
)
68 #ifndef __ASSUME_PREADV
69 # define PREADV static internal_function __atomic_preadv_replacement
70 # define PREAD __pread
72 # include <sysdeps/posix/preadv.c>