linux(4): Add epoll_pwai2 syscall.
MFC after: 2 weeks
This commit is contained in:
parent
df377f1fb8
commit
e00aad1042
@ -140,7 +140,6 @@ DUMMY(close_range);
|
|||||||
DUMMY(openat2);
|
DUMMY(openat2);
|
||||||
DUMMY(pidfd_getfd);
|
DUMMY(pidfd_getfd);
|
||||||
DUMMY(process_madvise);
|
DUMMY(process_madvise);
|
||||||
DUMMY(epoll_pwait2);
|
|
||||||
DUMMY(mount_setattr);
|
DUMMY(mount_setattr);
|
||||||
/* Linux 4.18: */
|
/* Linux 4.18: */
|
||||||
DUMMY(io_pgetevents);
|
DUMMY(io_pgetevents);
|
||||||
|
@ -535,6 +535,62 @@ linux_epoll_pwait(struct thread *td, struct linux_epoll_pwait_args *args)
|
|||||||
args->maxevents, args->timeout, pmask));
|
args->maxevents, args->timeout, pmask));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if defined(__i386__) || (defined(__amd64__) && defined(COMPAT_LINUX32))
|
||||||
|
int
|
||||||
|
linux_epoll_pwait2_64(struct thread *td, struct linux_epoll_pwait2_64_args *args)
|
||||||
|
{
|
||||||
|
struct timespec ts, *tsa;
|
||||||
|
struct l_timespec64 lts;
|
||||||
|
sigset_t mask, *pmask;
|
||||||
|
int error;
|
||||||
|
|
||||||
|
error = linux_copyin_sigset(args->mask, sizeof(l_sigset_t),
|
||||||
|
&mask, &pmask);
|
||||||
|
if (error != 0)
|
||||||
|
return (error);
|
||||||
|
|
||||||
|
if (args->timeout) {
|
||||||
|
if ((error = copyin(args->timeout, <s, sizeof(lts))))
|
||||||
|
return (error);
|
||||||
|
error = linux_to_native_timespec64(&ts, <s);
|
||||||
|
if (error != 0)
|
||||||
|
return (error);
|
||||||
|
tsa = &ts;
|
||||||
|
} else
|
||||||
|
tsa = NULL;
|
||||||
|
|
||||||
|
return (linux_epoll_wait_ts(td, args->epfd, args->events,
|
||||||
|
args->maxevents, tsa, pmask));
|
||||||
|
}
|
||||||
|
#else
|
||||||
|
int
|
||||||
|
linux_epoll_pwait2(struct thread *td, struct linux_epoll_pwait2_args *args)
|
||||||
|
{
|
||||||
|
struct timespec ts, *tsa;
|
||||||
|
struct l_timespec lts;
|
||||||
|
sigset_t mask, *pmask;
|
||||||
|
int error;
|
||||||
|
|
||||||
|
error = linux_copyin_sigset(args->mask, sizeof(l_sigset_t),
|
||||||
|
&mask, &pmask);
|
||||||
|
if (error != 0)
|
||||||
|
return (error);
|
||||||
|
|
||||||
|
if (args->timeout) {
|
||||||
|
if ((error = copyin(args->timeout, <s, sizeof(lts))))
|
||||||
|
return (error);
|
||||||
|
error = linux_to_native_timespec(&ts, <s);
|
||||||
|
if (error != 0)
|
||||||
|
return (error);
|
||||||
|
tsa = &ts;
|
||||||
|
} else
|
||||||
|
tsa = NULL;
|
||||||
|
|
||||||
|
return (linux_epoll_wait_ts(td, args->epfd, args->events,
|
||||||
|
args->maxevents, tsa, pmask));
|
||||||
|
}
|
||||||
|
#endif /* __i386__ || (__amd64__ && COMPAT_LINUX32) */
|
||||||
|
|
||||||
static int
|
static int
|
||||||
epoll_register_kevent(struct thread *td, struct file *epfp, int fd, int filter,
|
epoll_register_kevent(struct thread *td, struct file *epfp, int fd, int filter,
|
||||||
unsigned int flags)
|
unsigned int flags)
|
||||||
|
Loading…
Reference in New Issue
Block a user