diff options
-rw-r--r-- | sys/compat/linux/linux_event.c | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/sys/compat/linux/linux_event.c b/sys/compat/linux/linux_event.c index 1fe3445..a089d43 100644 --- a/sys/compat/linux/linux_event.c +++ b/sys/compat/linux/linux_event.c @@ -41,6 +41,7 @@ __FBSDID("$FreeBSD$"); #include <sys/types.h> #include <sys/file.h> #include <sys/filedesc.h> +#include <sys/filio.h> #include <sys/errno.h> #include <sys/event.h> #include <sys/poll.h> @@ -868,8 +869,24 @@ static int eventfd_ioctl(struct file *fp, u_long cmd, void *data, struct ucred *active_cred, struct thread *td) { + struct eventfd *efd; - return (ENXIO); + efd = fp->f_data; + if (fp->f_type != DTYPE_LINUXEFD || efd == NULL) + return (EINVAL); + + switch (cmd) + { + case FIONBIO: + if (*(int *)data) + efd->efd_flags |= LINUX_O_NONBLOCK; + else + efd->efd_flags &= ~LINUX_O_NONBLOCK; + case FIOASYNC: + return (0); + default: + return (ENXIO); + } } /*ARGSUSED*/ |