[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH,HURD][RFC] hurdselect: Step7x, almost complete rewrite finish
From: |
Svante Signell |
Subject: |
Re: [PATCH,HURD][RFC] hurdselect: Step7x, almost complete rewrite finished |
Date: |
Tue, 12 Feb 2013 23:46:00 +0100 |
On Tue, 2013-02-12 at 22:55 +0100, Samuel Thibault wrote:
> Svante Signell, le Tue 12 Feb 2013 09:09:25 +0100, a écrit :
> > Attached is a patch wrt the latest patch (step2) on January 24 2013. The
> > indentation is different, therefore the diff blocks are a little large
> > (but easier to read). Hopefully this is better. Including also the
> > resulting file hurdselect_step7x.c. Explanations later in a separate
> > mail.
>
> Explanations don't need to be very long. All we need is the rationale
> and the way you handle it in the patch.
>
> AIUI, there are three things:
>
> - pass 1ms as timeout. This will be fixed by Richard's patch.
> - in the poll() case, do not fail completely if an FD is bogus. Instead,
> poll on the remaining FDs, and later on set POLLNVAL. It seems your
> patch does this by using the i_index array indirection.
> - in the poll() case, on error returned by io_select, instead of setting
> readiness, set POLLHUP or POLLERR according to the error.
>
> Is that right?
Yes, mainly.
Here it goes:
- introduce the dfd struct, to be instantiated later in _hurd_select()
- introduce two helper functions, _io_select_request() and _wait_for
replies()
- in _io_select_request():
* this function calls __io_select()
* store the errors EPIPE and EPOLL for poll in errvec[nfds] to fill in
the revents field of the struct pollfd later.
* return with value -1 for other errors.
* add a delay of 1ms in the call to __io_select() for POLL to account
for the round-trip delay (will be fixed by the changes by Richard to
move time-outs to the server)
- in _wait_for_replies():
* move all union and MDGID definitions here, since they are local to
this routine.
* this function calls __mach_msg()
- in _hurd_select():
* split the code into two cases: POLL and SELECT
* change the FD_SETSIZE upper value check to larger than or equal from
larger than.
(from POSIX definition of select:
http://pubs.opengroup.org/onlinepubs/009604499/functions/select.html
)
* call the helper functions for both cases.
- for the POLL case:
* mark all FDs in i_index[nfds] with -1 to start.
* fill in the corresponding revents according to if the FDs are: good,
broken (EPIPE or EIO) or bad i_index[] = -1.
* fix a bug causing test_poll in python2.6 to fail: Clear out all
revents fields before fiilng in. The caller might have set the fd and
events correctly with crap in the revents field.
* remove the i < nfds check, it is redundant since all nfds FDs are
walked through.
- for the SELECT case
* exit with EBADF if nfds are larger than _hurd_dtablesize (fixes one
test case in test-select from gnulib.
- the POLL changes works with the Hurd built on January 28, see test
code to be sent in a forthcoming mail.
- some minor tweaks will still be made to be mor POSIX consistent.
Svante
- Re: [PATCH,HURD][RFC] hurdselect: Step7, almost complete rewrite finished, Svante Signell, 2013/02/11
- Re: [PATCH,HURD][RFC] hurdselect: Step7x, almost complete rewrite finished, Svante Signell, 2013/02/12
- Re: [PATCH,HURD][RFC] hurdselect: Step7x, almost complete rewrite finished, Samuel Thibault, 2013/02/12
- Re: [PATCH,HURD][RFC] hurdselect: Step7x, almost complete rewrite finished,
Svante Signell <=
- Re: [PATCH,HURD][RFC] hurdselect: Step7x, almost complete rewrite finished, Samuel Thibault, 2013/02/12
- Re: [PATCH,HURD][RFC] hurdselect: Step7x, almost complete rewrite finished, Svante Signell, 2013/02/12
- Re: [PATCH,HURD][RFC] hurdselect: Step7x, almost complete rewrite finished, Samuel Thibault, 2013/02/12
- Re: [PATCH,HURD][RFC] hurdselect: Step7x, almost complete rewrite finished, Svante Signell, 2013/02/12
- Re: [PATCH,HURD][RFC] hurdselect: Step7x, almost complete rewrite finished, Samuel Thibault, 2013/02/12
- Re: [PATCH,HURD][RFC] hurdselect: Step7x, almost complete rewrite finished, Svante Signell, 2013/02/12
- Re: [PATCH,HURD][RFC] hurdselect: Step7x, almost complete rewrite finished, Samuel Thibault, 2013/02/12
- Re: [PATCH,HURD][RFC] hurdselect: Step7x, almost complete rewrite finished, Richard Braun, 2013/02/12
- Re: [PATCH,HURD][RFC] hurdselect: Step7x, almost complete rewrite finished, Svante Signell, 2013/02/13
- Re: [PATCH,HURD][RFC] hurdselect: Step7x, almost complete rewrite finished, Richard Braun, 2013/02/13