Changeset View
Changeset View
Standalone View
Standalone View
head/sys/compat/linux/linux_event.c
Show First 20 Lines • Show All 257 Lines • ▼ Show 20 Lines | epoll_create_common(struct thread *td, int flags) | ||||
if (error != 0) | if (error != 0) | ||||
return (error); | return (error); | ||||
epoll_fd_install(td, EPOLL_DEF_SZ, 0); | epoll_fd_install(td, EPOLL_DEF_SZ, 0); | ||||
return (0); | return (0); | ||||
} | } | ||||
#ifdef LINUX_LEGACY_SYSCALLS | |||||
int | int | ||||
linux_epoll_create(struct thread *td, struct linux_epoll_create_args *args) | linux_epoll_create(struct thread *td, struct linux_epoll_create_args *args) | ||||
{ | { | ||||
/* | /* | ||||
* args->size is unused. Linux just tests it | * args->size is unused. Linux just tests it | ||||
* and then forgets it as well. | * and then forgets it as well. | ||||
*/ | */ | ||||
if (args->size <= 0) | if (args->size <= 0) | ||||
return (EINVAL); | return (EINVAL); | ||||
return (epoll_create_common(td, 0)); | return (epoll_create_common(td, 0)); | ||||
} | } | ||||
#endif | |||||
int | int | ||||
linux_epoll_create1(struct thread *td, struct linux_epoll_create1_args *args) | linux_epoll_create1(struct thread *td, struct linux_epoll_create1_args *args) | ||||
{ | { | ||||
int flags; | int flags; | ||||
if ((args->flags & ~(LINUX_O_CLOEXEC)) != 0) | if ((args->flags & ~(LINUX_O_CLOEXEC)) != 0) | ||||
return (EINVAL); | return (EINVAL); | ||||
▲ Show 20 Lines • Show All 324 Lines • ▼ Show 20 Lines | leave0: | ||||
if (uset != NULL) | if (uset != NULL) | ||||
error = kern_sigprocmask(td, SIG_SETMASK, &omask, | error = kern_sigprocmask(td, SIG_SETMASK, &omask, | ||||
NULL, 0); | NULL, 0); | ||||
leave1: | leave1: | ||||
fdrop(epfp, td); | fdrop(epfp, td); | ||||
return (error); | return (error); | ||||
} | } | ||||
#ifdef LINUX_LEGACY_SYSCALLS | |||||
int | int | ||||
linux_epoll_wait(struct thread *td, struct linux_epoll_wait_args *args) | linux_epoll_wait(struct thread *td, struct linux_epoll_wait_args *args) | ||||
{ | { | ||||
return (linux_epoll_wait_common(td, args->epfd, args->events, | return (linux_epoll_wait_common(td, args->epfd, args->events, | ||||
args->maxevents, args->timeout, NULL)); | args->maxevents, args->timeout, NULL)); | ||||
} | } | ||||
#endif | |||||
int | int | ||||
linux_epoll_pwait(struct thread *td, struct linux_epoll_pwait_args *args) | linux_epoll_pwait(struct thread *td, struct linux_epoll_pwait_args *args) | ||||
{ | { | ||||
sigset_t mask, *pmask; | sigset_t mask, *pmask; | ||||
l_sigset_t lmask; | l_sigset_t lmask; | ||||
int error; | int error; | ||||
▲ Show 20 Lines • Show All 68 Lines • ▼ Show 20 Lines | eventfd_create(struct thread *td, uint32_t initval, int flags) | ||||
finit(fp, fflags, DTYPE_LINUXEFD, efd, &eventfdops); | finit(fp, fflags, DTYPE_LINUXEFD, efd, &eventfdops); | ||||
fdrop(fp, td); | fdrop(fp, td); | ||||
td->td_retval[0] = fd; | td->td_retval[0] = fd; | ||||
return (error); | return (error); | ||||
} | } | ||||
#ifdef LINUX_LEGACY_SYSCALLS | |||||
int | int | ||||
linux_eventfd(struct thread *td, struct linux_eventfd_args *args) | linux_eventfd(struct thread *td, struct linux_eventfd_args *args) | ||||
{ | { | ||||
return (eventfd_create(td, args->initval, 0)); | return (eventfd_create(td, args->initval, 0)); | ||||
} | } | ||||
#endif | |||||
int | int | ||||
linux_eventfd2(struct thread *td, struct linux_eventfd2_args *args) | linux_eventfd2(struct thread *td, struct linux_eventfd2_args *args) | ||||
{ | { | ||||
if ((args->flags & ~(LINUX_O_CLOEXEC|LINUX_O_NONBLOCK|LINUX_EFD_SEMAPHORE)) != 0) | if ((args->flags & ~(LINUX_O_CLOEXEC|LINUX_O_NONBLOCK|LINUX_EFD_SEMAPHORE)) != 0) | ||||
return (EINVAL); | return (EINVAL); | ||||
▲ Show 20 Lines • Show All 599 Lines • Show Last 20 Lines |