X-Recipient: archive-cygwin AT delorie DOT com X-SWARE-Spam-Status: No, hits=-3.2 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_LOW X-Spam-Check-By: sourceware.org Message-ID: <4BA85E92.5080700@cwilson.fastmail.fm> Date: Tue, 23 Mar 2010 02:24:18 -0400 From: Charles Wilson User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv:1.8.1.23) Gecko/20090812 Thunderbird/2.0.0.23 Mnenhy/0.7.6.666 MIME-Version: 1.0 To: Cygwin Mailing List Subject: Re: recvfrom + MSG_PEEK = broken? References: <4BA7085D DOT 3050307 AT cwilson DOT fastmail DOT fm> <20100322110352 DOT GA32321 AT calimero DOT vinschen DOT de> <4BA7D40E DOT 5010504 AT etr-usa DOT com> In-Reply-To: <4BA7D40E.5010504@etr-usa.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com 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