From: Erik Faye-Lund Date: Sat, 16 Jan 2010 10:59:51 GMT Subject: Re: [PATCH v2 13/14] daemon: use select() instead of poll() Message-ID: <40aa078e1001160259h7f82b702u405a2bed515cfd81@mail.gmail.com> In-Reply-To: <201001161144.55263.j6t@kdbg.org> On Sat, Jan 16, 2010 at 11:44 AM, Johannes Sixt wrote: > On Samstag, 16. Januar 2010, Erik Faye-Lund wrote: >> On Sat, Jan 16, 2010 at 9:08 AM, Johannes Sixt wrote: >> > Wouldn't it be possible to call getsockopt(), and if it returns ENOTSOCK >> > (WSAENOTSOCK), then it is a pipe? >> >> I read reports that this didn't work in Wine. Not that I care that >> much about Wine. > > What does it mean that "it does not work"? Is it that it does not return > ENOTSOCK, so that we mistake pipes as sockets? > > -- Hannes > Yes, according to the gnulib sources[1], getsockopt returns 0 for pipes. [1]: http://git.savannah.gnu.org/gitweb/?p=gnulib.git;a=blob;f=lib/poll.c;h=90d99d92dca5d7ce2f31097e4b8fc06a83aae245;hb=HEAD#l80 -- Erik "kusma" Faye-Lund