Re: Proper use of select() parameter nfds?

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Proper use of select() parameter nfds?
Дата
Msg-id 6930.994426142@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Proper use of select() parameter nfds?  (Matthew Hagerty <mhagerty@voyager.net>)
Список pgsql-hackers
Matthew Hagerty <mhagerty@voyager.net> writes:
> I take this to mean that each descriptor set contains n descriptors

No.  nfds is the length (in bits) of the bit arrays passed to select().
Therefore, it is possible to inquire about descriptors numbered between
0 and nfds-1.  One sets the bits corresponding to the interesting
descriptors before calling select, and then examines those bits to see
if they're still set on return.

The code you quoted is perfectly correct, for code that is only
interested in one descriptor.
        regards, tom lane


В списке pgsql-hackers по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: AW: Re: Backup and Recovery
Следующее
От: Doug McNaught
Дата:
Сообщение: Re: Proper use of select() parameter nfds?