The manpages linked from kernel.org, at http://man7.org/linux/man-pages/man2/epoll_ctl.2.html, declare the
int epoll_ctl(int epfd, int op, int fd, struct epoll_event *event);
Nevermind, found a rather conclusive answer on the linux kernel mailing list. For posterity, quoting Davide Libenzi here, chief or sole author of
From: Davide Libenzi <davidel <at> xmailserver.org> Subject: Re: epoll_ctl and const correctness Newsgroups: gmane.linux.kernel Date: 2009-03-25 16:23:21 GMT (7 years, 17 weeks, 1 day, 9 hours and 4 minutes ago) On Wed, 25 Mar 2009, nicolas sitbon wrote: > Currently, the prototype of epoll_ctl is : > > int epoll_ctl(int epfd, int op, int fd, struct epoll_event *event); > > I searched in the man of epoll_ctl and google, and it seems that the > structure pointed to by event isn't modify, valgrind confirms this > behaviour, so am I wrong? or the good prototype is > > int epoll_ctl(int epfd, int op, int fd, struct epoll_event const *event); According to the current ctl operations, yes. But doing that would prevent other non-const operations to be added later on. - Davide
The takeaway is that even though de-facto behavior is not to modify the structure, the interface omits
const modifier because other control operations may be added in the future through the same system call, which necessitate potentially modifiable structure as pointed at by
I should have hit the linux kernel mailing list first, apologies for another perhaps redundant information on SO.