mirror of
https://github.com/checkpoint-restore/criu.git
synced 2026-01-23 02:14:37 +00:00
syscall: fix arguments for preadv()
It has two arguments "pos_l and "pos_h" instead of one "off". It is used
to handle 64-bit offsets on 32-bit kernels.
SYSCALL_DEFINE5(preadv, unsigned long, fd, const struct iovec __user *, vec,
unsigned long, vlen, unsigned long, pos_l, unsigned long, pos_h)
https://github.com/checkpoint-restore/criu/issues/424
Signed-off-by: Andrei Vagin <avagin@openvz.org>
Reviewed-by: Dmitry Safonov <0x7f454c46@gmail.com>
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
This commit is contained in:
parent
88fbd37f53
commit
03fb0b8223
6 changed files with 21 additions and 5 deletions
|
|
@ -15,6 +15,8 @@
|
|||
#include <fcntl.h>
|
||||
#include <time.h>
|
||||
|
||||
#include "common/bitsperlong.h"
|
||||
|
||||
struct cap_header {
|
||||
uint32_t version;
|
||||
int pid;
|
||||
|
|
@ -53,4 +55,18 @@ typedef int kernel_timer_t;
|
|||
|
||||
#include <compel/plugins/std/asm/syscall-types.h>
|
||||
|
||||
|
||||
extern long sys_preadv_raw(int fd, struct iovec *iov, unsigned long nr, unsigned long pos_l, unsigned long pos_h);
|
||||
|
||||
static inline long sys_preadv(int fd, struct iovec *iov, unsigned long nr, off_t off)
|
||||
{
|
||||
#if BITS_PER_LONG == 64
|
||||
return sys_preadv_raw(fd, iov, nr, off, 0);
|
||||
#elif BITS_PER_LONG == 32
|
||||
return sys_preadv_raw(fd, iov, nr, off, ((uint64_t)off) >> 32);
|
||||
#else
|
||||
# error "BITS_PER_LONG isn't defined"
|
||||
#endif
|
||||
}
|
||||
|
||||
#endif /* COMPEL_SYSCALL_TYPES_H__ */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue