Re: epoll_ctl and const correctness

Jeremy Fitzhardinge
2009-03-25T21:21:37Z

nicolas sitbon wrote:
> valgrind confirms this
> behaviour, so am I wrong?

That doesn't prove very much. Unlike usermode code, Valgrind doesn't
instrument the kernel, so it computes the side-effects of kernel
operations by parsing the syscall stream and simulating the effect.
(That is to say, it strengthens your argument somewhat, but valgrind's
handling of this syscall could be buggy.)

> or the good prototype is
>
> int epoll_ctl(int epfd, int op, int fd, struct epoll_event const *event);
>

Putting "const" first is conventional.

J