• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // SPDX-License-Identifier: GPL-2.0-or-later
2 /*
3  * Copyright (c) 2018 FUJITSU LIMITED. All rights reserved.
4  * Author: Xiao Yang <yangx.jy@cn.fujitsu.com>
5  */
6 
7 #ifndef PREADV2_H
8 #define PREADV2_H
9 
10 #include "config.h"
11 #include "lapi/syscalls.h"
12 
13 #if !defined(HAVE_PREADV2)
14 
15 /* LO_HI_LONG taken from glibc */
16 # define LO_HI_LONG(val) (long) (val), (long) (((uint64_t) (val)) >> 32)
17 
preadv2(int fd,const struct iovec * iov,int iovcnt,off_t offset,int flags)18 ssize_t preadv2(int fd, const struct iovec *iov, int iovcnt, off_t offset,
19 		int flags)
20 {
21 	return tst_syscall(__NR_preadv2, fd, iov, iovcnt,
22 			   LO_HI_LONG(offset), flags);
23 }
24 #endif
25 
26 #endif /* PREADV2_H */
27