mirror of
https://github.com/checkpoint-restore/criu.git
synced 2026-07-21 09:10:10 +00:00
zdtm/fanotify00: fix fanotify_{init, mark} calls
O_* flags should be in event_f_flags parameter, according to
fanotify_init(2).
On x86_32 fanotify_mark() has second mask argument (as mask is 64-bit,
the higher parts of mask shouldn't be used):
> COMPAT_SYSCALL_DEFINE6(fanotify_mark,
> int, fanotify_fd, unsigned int, flags,
> __u32, mask0, __u32, mask1, int, dfd,
> const char __user *, pathname)
> {
> return sys_fanotify_mark(fanotify_fd, flags,
> #ifdef __BIG_ENDIAN
> ((__u64)mask0 << 32) | mask1,
> #else
> ((__u64)mask1 << 32) | mask0,
> #endif
> dfd, pathname);
travis-ci: success for 32-bit tests fixes
Signed-off-by: Dmitry Safonov <dsafonov@virtuozzo.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
This commit is contained in:
parent
10e38c6300
commit
d6f18fa49b
1 changed files with 6 additions and 3 deletions
|
|
@ -75,7 +75,11 @@ static int fanotify_init(unsigned int flags, unsigned int event_f_flags)
|
|||
static int fanotify_mark(int fanotify_fd, unsigned int flags, unsigned long mask,
|
||||
int dfd, const char *pathname)
|
||||
{
|
||||
#ifdef __i386__
|
||||
return syscall(__NR_fanotify_mark, fanotify_fd, flags, mask, 0, dfd, pathname);
|
||||
#else
|
||||
return syscall(__NR_fanotify_mark, fanotify_fd, flags, mask, dfd, pathname);
|
||||
#endif
|
||||
}
|
||||
|
||||
#define fdinfo_field(str, field) !strncmp(str, field":", sizeof(field))
|
||||
|
|
@ -226,9 +230,8 @@ int main (int argc, char *argv[])
|
|||
}
|
||||
}
|
||||
|
||||
fa_fd = fanotify_init(FAN_NONBLOCK | O_RDONLY | O_LARGEFILE |
|
||||
FAN_CLASS_NOTIF | FAN_UNLIMITED_QUEUE,
|
||||
0);
|
||||
fa_fd = fanotify_init(FAN_NONBLOCK | FAN_CLASS_NOTIF | FAN_UNLIMITED_QUEUE,
|
||||
O_RDONLY | O_LARGEFILE);
|
||||
if (fa_fd < 0) {
|
||||
pr_perror("fanotify_init failed");
|
||||
exit(1);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue