Skip to content

Commit

Permalink
lkl: Check for POLLPRI in POSIX net_poll
Browse files Browse the repository at this point in the history
Strictly speaking, POSIX.1-2008 in the poll.h entry says:

   POLLIN
      Data other than high priority data may be read without blocking

   POLLPRI
      Priority data may be read without blocking

So to check that we can read(2) without blocking, we should check for
POLLPRI in addition to POLLIN.

Signed-off-by: Patrick Collins <pscollins@google.com>
  • Loading branch information
pscollins committed Feb 23, 2016
1 parent c5af86e commit d63b7d9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion tools/lkl/lib/posix-host.c
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,7 @@ static int net_poll(union lkl_netdev nd, int events)
int ret = 0;

if (events & LKL_DEV_NET_POLL_RX)
pfd.events |= POLLIN;
pfd.events |= POLLIN | POLLPRI;
if (events & LKL_DEV_NET_POLL_TX)
pfd.events |= POLLOUT;

Expand Down

0 comments on commit d63b7d9

Please sign in to comment.