[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <49CD4967.2090606@msgid.tls.msk.ru>
Date: Sat, 28 Mar 2009 00:47:19 +0300
From: Michael Tokarev <mjt@....msk.ru>
To: nicolas sitbon <nicolas.sitbon@...il.com>
CC: Jeremy Fitzhardinge <jeremy@...p.org>,
linux-kernel@...r.kernel.org,
Davide Libenzi <davidel@...ilserver.org>
Subject: Re: epoll_ctl and const correctness
nicolas sitbon wrote:
> Please, can anyone answer me, I need a response.
> 2009/3/25 nicolas sitbon <nicolas.sitbon@...il.com>:
>> You don't teach me anything, I know that, the fact is the
>> documentation is incomplete, so rather saying that, please answer my
>> questions. For the moment, only the documenation and the prototype of
>> epoll are buggy.
So which response do you want -- the one saying that the documentation
is buggy or or epoll prototype? Or something else?
[]
>>>> or the good prototype is
>>>>
>>>> int epoll_ctl(int epfd, int op, int fd, struct epoll_event const *event);
Why should it be const? There is no guarantee the argument will not be
modified by the kernel. Documentation does not say that. Current prototype
does not say that. If you need such a guarantee, you're free to add another
system call into your kernel, and fix both your documentation and your
prototype to match. What's the deal?
Back from useless rants and to the technical points.
Again: there's no guarantee the `event' argument will not be modified.
Even if kernel CURRENTLY indeed does not modify it, but the interface
does not PROMISE it to be that way for ever.
Why does it not promise that is another question. Just one example:
what, some day, stops us from adding some EPOLL_CTL_GET operation
to RETRIEVE information associated with that filedescriptor in kernel
currently and STORE that info in the structure pointed to by `event'
argument? That way it will not be const anymore.
So.. what's your problem?
/mjt
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists