Page MenuHomeFreeBSD

Linux epoll: Register events with zero event mask.
ClosedPublic

Authored by wulf on Nov 23 2019, 12:13 PM.
Tags
None
Referenced Files
F132136751: D22516.id.diff
Tue, Oct 14, 2:15 AM
Unknown Object (File)
Fri, Oct 3, 11:24 PM
Unknown Object (File)
Fri, Oct 3, 4:39 PM
Unknown Object (File)
Sun, Sep 28, 3:18 PM
Unknown Object (File)
Mon, Sep 22, 3:33 PM
Unknown Object (File)
Sep 13 2025, 1:27 AM
Unknown Object (File)
Aug 24 2025, 11:28 AM
Unknown Object (File)
Aug 24 2025, 12:47 AM
Subscribers

Details

Summary

Such events are legal and should be interpreted as EPOLLERR | EPOLLHUP.
Register a disabled kqueue event in that case as we do not support EPOLLHUP yet.

Required for Linux Steam client.

PR/240590

Test Plan
/* Sample testcase */

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

int
main(int argc, char *argv[])
{
        struct epoll_event event;
        int epfd;

        epfd = epoll_create1(EPOLL_CLOEXEC);
        assert(epfd);

        event.events = 0;

        if (epoll_ctl(epfd, EPOLL_CTL_ADD, STDIN_FILENO, &event) != 0) {
                perror("EPOLL_CTL_ADD failed");
                exit(EXIT_FAILURE);
        }

        if (epoll_ctl(epfd, EPOLL_CTL_MOD, STDIN_FILENO, &event) != 0) {
                perror("EPOLL_CTL_MOD failed");
                exit(EXIT_FAILURE);
        }

        if (epoll_ctl(epfd, EPOLL_CTL_DEL, STDIN_FILENO, &event) != 0) {
                perror("EPOLL_CTL_DEL failed");
                exit(EXIT_FAILURE);
        }

        printf("ok\n");
        return (EXIT_SUCCESS);
}

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable