Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 15 Sep 2019 07:46:38 +0000
From:      bugzilla-noreply@freebsd.org
To:        bugs@FreeBSD.org
Subject:   [Bug 240590] Linuxulator: EPOLLONESHOT is broken
Message-ID:  <bug-240590-227@https.bugs.freebsd.org/bugzilla/>

next in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D240590

            Bug ID: 240590
           Summary: Linuxulator: EPOLLONESHOT is broken
           Product: Base System
           Version: 12.0-RELEASE
          Hardware: Any
                OS: Any
            Status: New
          Severity: Affects Only Me
          Priority: ---
         Component: kern
          Assignee: bugs@FreeBSD.org
          Reporter: iwtcex@gmail.com

Here's a reproducer:

#include <assert.h>
#include <fcntl.h>
#include <stdio.h>
#include <unistd.h>
#include <sys/epoll.h>

int main() {

  int epfd =3D epoll_create(8);
  assert(epfd);

  struct epoll_event event =3D {
    .events =3D EPOLLOUT | EPOLLONESHOT,
    .data   =3D 0
  };

  int err1 =3D epoll_ctl(epfd, EPOLL_CTL_ADD, STDIN_FILENO, &event);
  assert(err1 =3D=3D 0);

  struct epoll_event events[1];
  int n =3D epoll_wait(epfd, events, 1, -1);
  assert(n > 0);

  int err2 =3D epoll_ctl(epfd, EPOLL_CTL_MOD, STDIN_FILENO, &event);
  if (err2 =3D=3D 0) {
    printf("ok\n");
  } else {
    perror("EPOLL_CTL_MOD failed");
  }

  return 0;
}

This program runs fine on Linux, while on FreeBSD it prints "EPOLL_CTL_MOD
failed: No such file or directory". The man page on kevent says about
EV_ONESHOT "After the user retrieves the event from the kqueue, it is delet=
ed",
so presumably that's why.

--=20
You are receiving this mail because:
You are the assignee for the bug.=



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-240590-227>