Re: [PATCH v2 13/14] daemon: use select() instead of poll()
- From
Johannes Sixt <j6t@kdbg.org>
- Date
- Jan 16, 2010, 08:08 UTC
- Message-ID
- <201001160908.33996.j6t@kdbg.org>
- In-Reply-To
- <40aa078e1001151508j208fa50boc5565a3be6bef893@mail.gmail.com>
On Samstag, 16. Januar 2010, Erik Faye-Lund wrote:
> The problem with that is differentiating between pipes and sockets. > GetFileType() returns FILE_TYPE_PIPE for sockets (ugh). I did find > some code in gnulib that used WSAEnumNetworkEvents() to differentiate > between them, but I find this quite hacky.
Wouldn't it be possible to call getsockopt(), and if it returns ENOTSOCK (WSAENOTSOCK), then it is a pipe?
-- Hannes