Commit 03fb0b82 authored by Andrei Vagin's avatar Andrei Vagin Committed by Andrei Vagin

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/424Signed-off-by: 's avatarAndrei Vagin <avagin@openvz.org>
Reviewed-by: 's avatarDmitry Safonov <0x7f454c46@gmail.com>
Signed-off-by: 's avatarAndrei Vagin <avagin@virtuozzo.com>
parent 88fbd37f
......@@ -107,5 +107,5 @@ io_submit 2 246 (aio_context_t ctx_id, long nr, struct iocb **iocbpp)
io_getevents 4 245 (aio_context_t ctx, long min_nr, long nr, struct io_event *evs, struct timespec *tmo)
seccomp 277 383 (unsigned int op, unsigned int flags, const char *uargs)
gettimeofday 169 78 (struct timeval *tv, struct timezone *tz)
preadv 69 361 (int fd, struct iovec *iov, unsigned long nr, loff_t off)
preadv_raw 69 361 (int fd, struct iovec *iov, unsigned long nr, unsigned long pos_l, unsigned long pos_h)
userfaultfd 282 388 (int flags)
......@@ -104,5 +104,5 @@ __NR_io_getevents 229 sys_io_getevents (aio_context_t ctx_id, long min_nr, long
__NR_io_submit 230 sys_io_submit (aio_context_t ctx_id, long nr, struct iocb **iocbpp)
__NR_ipc 117 sys_ipc (unsigned int call, int first, unsigned long second, unsigned long third, const void *ptr, long fifth)
__NR_gettimeofday 78 sys_gettimeofday (struct timeval *tv, struct timezone *tz)
__NR_preadv 320 sys_preadv (int fd, struct iovec *iov, unsigned long nr, loff_t off)
__NR_preadv 320 sys_preadv_raw (int fd, struct iovec *iov, unsigned long nr, unsigned long pos_l, unsigned long pos_h)
__NR_userfaultfd 364 sys_userfaultfd (int flags)
......@@ -104,5 +104,5 @@ __NR_io_getevents 245 sys_io_getevents (aio_context_t ctx_id, long min_nr, long
__NR_io_submit 246 sys_io_submit (aio_context_t ctx_id, long nr, struct iocb **iocbpp)
__NR_ipc 117 sys_ipc (unsigned int call, int first, unsigned long second, unsigned long third, const void *ptr, long fifth)
__NR_userfaultfd 355 sys_userfaultfd (int flags)
__NR_preadv 328 sys_preadv (int fd, struct iovec *iov, unsigned long nr, loff_t off)
__NR_preadv 328 sys_preadv_raw (int fd, struct iovec *iov, unsigned long nr, unsigned long pos_l, unsigned long pos_h)
__NR_gettimeofday 78 sys_gettimeofday (struct timeval *tv, struct timezone *tz)
......@@ -84,7 +84,7 @@ __NR_get_robust_list 312 sys_get_robust_list (int pid, struct robust_list_head
__NR_vmsplice 316 sys_vmsplice (int fd, const struct iovec *iov, unsigned int nr_segs, unsigned int flags)
__NR_signalfd 321 sys_signalfd (int ufd, const k_rtsigset_t *sigmask, size_t sigsetsize)
__NR_timerfd_settime 325 sys_timerfd_settime (int ufd, int flags, const struct itimerspec *utmr, struct itimerspec *otmr)
__NR_preadv 333 sys_preadv (int fd, struct iovec *iov, unsigned long nr, loff_t off)
__NR_preadv 333 sys_preadv_raw (int fd, struct iovec *iov, unsigned long nr, unsigned long pos_l, unsigned long pos_h)
__NR_rt_tgsigqueueinfo 335 sys_rt_tgsigqueueinfo (pid_t tgid, pid_t pid, int sig, siginfo_t *uinfo)
__NR_fanotify_init 338 sys_fanotify_init (unsigned int flags, unsigned int event_f_flags)
__NR_fanotify_mark 339 sys_fanotify_mark (int fanotify_fd, unsigned int flag, uint32_t mask, int dfd, const char *pathname)
......
......@@ -96,7 +96,7 @@ __NR_seccomp 317 sys_seccomp (unsigned int op, unsigned int flags, const cha
__NR_vmsplice 278 sys_vmsplice (int fd, const struct iovec *iov, unsigned long nr_segs, unsigned int flags)
__NR_timerfd_settime 286 sys_timerfd_settime (int ufd, int flags, const struct itimerspec *utmr, struct itimerspec *otmr)
__NR_signalfd4 289 sys_signalfd (int fd, k_rtsigset_t *mask, size_t sizemask, int flags)
__NR_preadv 295 sys_preadv (int fd, struct iovec *iov, unsigned long nr, loff_t off)
__NR_preadv 295 sys_preadv_raw (int fd, struct iovec *iov, unsigned long nr, unsigned long pos_l, unsigned long pos_h)
__NR_rt_tgsigqueueinfo 297 sys_rt_tgsigqueueinfo (pid_t tgid, pid_t pid, int sig, siginfo_t *info)
__NR_fanotify_init 300 sys_fanotify_init (unsigned int flags, unsigned int event_f_flags)
__NR_fanotify_mark 301 sys_fanotify_mark (int fanotify_fd, unsigned int flags, uint64_t mask, int dfd, const char *pathname)
......
......@@ -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__ */
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment