Deleted Added
full compact
linux_event.c (346812) linux_event.c (346832)
1/*-
2 * Copyright (c) 2007 Roman Divacky
3 * Copyright (c) 2014 Dmitry Chagin
4 * All rights reserved.
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions
8 * are met:

--- 12 unchanged lines hidden (view full) ---

21 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
22 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
23 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
24 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
25 * SUCH DAMAGE.
26 */
27
28#include <sys/cdefs.h>
1/*-
2 * Copyright (c) 2007 Roman Divacky
3 * Copyright (c) 2014 Dmitry Chagin
4 * All rights reserved.
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions
8 * are met:

--- 12 unchanged lines hidden (view full) ---

21 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
22 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
23 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
24 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
25 * SUCH DAMAGE.
26 */
27
28#include <sys/cdefs.h>
29__FBSDID("$FreeBSD: stable/11/sys/compat/linux/linux_event.c 346812 2019-04-28 09:53:08Z dchagin $");
29__FBSDID("$FreeBSD: stable/11/sys/compat/linux/linux_event.c 346832 2019-04-28 14:03:32Z dchagin $");
30
31#include "opt_compat.h"
32
33#include <sys/param.h>
34#include <sys/systm.h>
35#include <sys/imgact.h>
36#include <sys/kernel.h>
37#include <sys/limits.h>

--- 220 unchanged lines hidden (view full) ---

258 if (error != 0)
259 return (error);
260
261 epoll_fd_install(td, EPOLL_DEF_SZ, 0);
262
263 return (0);
264}
265
30
31#include "opt_compat.h"
32
33#include <sys/param.h>
34#include <sys/systm.h>
35#include <sys/imgact.h>
36#include <sys/kernel.h>
37#include <sys/limits.h>

--- 220 unchanged lines hidden (view full) ---

258 if (error != 0)
259 return (error);
260
261 epoll_fd_install(td, EPOLL_DEF_SZ, 0);
262
263 return (0);
264}
265
266#ifdef LINUX_LEGACY_SYSCALLS
266int
267linux_epoll_create(struct thread *td, struct linux_epoll_create_args *args)
268{
269
270 /*
271 * args->size is unused. Linux just tests it
272 * and then forgets it as well.
273 */
274 if (args->size <= 0)
275 return (EINVAL);
276
277 return (epoll_create_common(td, 0));
278}
267int
268linux_epoll_create(struct thread *td, struct linux_epoll_create_args *args)
269{
270
271 /*
272 * args->size is unused. Linux just tests it
273 * and then forgets it as well.
274 */
275 if (args->size <= 0)
276 return (EINVAL);
277
278 return (epoll_create_common(td, 0));
279}
280#endif
279
280int
281linux_epoll_create1(struct thread *td, struct linux_epoll_create1_args *args)
282{
283 int flags;
284
285 if ((args->flags & ~(LINUX_O_CLOEXEC)) != 0)
286 return (EINVAL);

--- 324 unchanged lines hidden (view full) ---

611 if (uset != NULL)
612 error = kern_sigprocmask(td, SIG_SETMASK, &omask,
613 NULL, 0);
614leave1:
615 fdrop(epfp, td);
616 return (error);
617}
618
281
282int
283linux_epoll_create1(struct thread *td, struct linux_epoll_create1_args *args)
284{
285 int flags;
286
287 if ((args->flags & ~(LINUX_O_CLOEXEC)) != 0)
288 return (EINVAL);

--- 324 unchanged lines hidden (view full) ---

613 if (uset != NULL)
614 error = kern_sigprocmask(td, SIG_SETMASK, &omask,
615 NULL, 0);
616leave1:
617 fdrop(epfp, td);
618 return (error);
619}
620
621#ifdef LINUX_LEGACY_SYSCALLS
619int
620linux_epoll_wait(struct thread *td, struct linux_epoll_wait_args *args)
621{
622
623 return (linux_epoll_wait_common(td, args->epfd, args->events,
624 args->maxevents, args->timeout, NULL));
625}
622int
623linux_epoll_wait(struct thread *td, struct linux_epoll_wait_args *args)
624{
625
626 return (linux_epoll_wait_common(td, args->epfd, args->events,
627 args->maxevents, args->timeout, NULL));
628}
629#endif
626
627int
628linux_epoll_pwait(struct thread *td, struct linux_epoll_pwait_args *args)
629{
630 sigset_t mask, *pmask;
631 l_sigset_t lmask;
632 int error;
633

--- 68 unchanged lines hidden (view full) ---

702
703 finit(fp, fflags, DTYPE_LINUXEFD, efd, &eventfdops);
704 fdrop(fp, td);
705
706 td->td_retval[0] = fd;
707 return (error);
708}
709
630
631int
632linux_epoll_pwait(struct thread *td, struct linux_epoll_pwait_args *args)
633{
634 sigset_t mask, *pmask;
635 l_sigset_t lmask;
636 int error;
637

--- 68 unchanged lines hidden (view full) ---

706
707 finit(fp, fflags, DTYPE_LINUXEFD, efd, &eventfdops);
708 fdrop(fp, td);
709
710 td->td_retval[0] = fd;
711 return (error);
712}
713
714#ifdef LINUX_LEGACY_SYSCALLS
710int
711linux_eventfd(struct thread *td, struct linux_eventfd_args *args)
712{
713
714 return (eventfd_create(td, args->initval, 0));
715}
715int
716linux_eventfd(struct thread *td, struct linux_eventfd_args *args)
717{
718
719 return (eventfd_create(td, args->initval, 0));
720}
721#endif
716
717int
718linux_eventfd2(struct thread *td, struct linux_eventfd2_args *args)
719{
720
721 if ((args->flags & ~(LINUX_O_CLOEXEC|LINUX_O_NONBLOCK|LINUX_EFD_SEMAPHORE)) != 0)
722 return (EINVAL);
723

--- 601 unchanged lines hidden ---
722
723int
724linux_eventfd2(struct thread *td, struct linux_eventfd2_args *args)
725{
726
727 if ((args->flags & ~(LINUX_O_CLOEXEC|LINUX_O_NONBLOCK|LINUX_EFD_SEMAPHORE)) != 0)
728 return (EINVAL);
729

--- 601 unchanged lines hidden ---