This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: recvfrom + MSG_PEEK = broken?


On 3/22/2010 4:33 PM, Warren Young wrote:
> On 3/22/2010 5:03 AM, Corinna Vinschen wrote:
>> The last time I had problems with MSG_PEEK was back in 2006.  Curious
>> how seldomly it's used, apparently.
> 
> Peeking is evil:
> 
>     http://tangentsoft.net/wskfaq/newbie.html#peeking
> 
> The extra kernel context switch problem isn't Windows-specific, so
> peeking should be avoided in all code for that reason alone.

That's all well and good, but I'm not writing new code; I also see no
need to rewrite xinetd from the ground up, as that'd be what it would
take to avoid the use of MSG_PEEK.  I'm simply trying to get existing
code, which uses normal POSIX functions in their normal, documented way,
to work properly.  recvfrom has a specific, documented POSIX behavior,
and that behavior includes MSG_PEEK.  Cygwin's implementation didn't
work before; now it does. That's a plus, no matter what some random
webpage might think about the function.

>  The other
> problems the FAQ item references may be Windows-specific, but they stem
> from perfectly reasonable stack design decisions that could affect any
> OS, so there's another reason not to peek regardless of what OS you run
> your code on.

Err...sure. "I want to design my networking stack in such a way that it
can't support a specific POSIX call, so I'll blame POSIX"

That's not "reasonable" -- that's just arrogance.  AKA Microsoft.

--
Chuck



--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]