X-Recipient: archive-cygwin@delorie.com
X-SWARE-Spam-Status: No, hits=-2.2 required=5.0 	tests=AWL,BAYES_00
X-Spam-Check-By: sourceware.org
Message-ID: <4BA7D40E.5010504@etr-usa.com>
Date: Mon, 22 Mar 2010 14:33:18 -0600
From: Warren Young <warren@etr-usa.com>
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv:1.9.1.8) Gecko/20100227 Thunderbird/3.0.3
MIME-Version: 1.0
To: cygwin@cygwin.com
Subject: Re: recvfrom + MSG_PEEK = broken?
References: <4BA7085D.3050307@cwilson.fastmail.fm> <20100322110352.GA32321@calimero.vinschen.de>
In-Reply-To: <20100322110352.GA32321@calimero.vinschen.de>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-IsSubscribed: yes
Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe@cygwin.com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin@cygwin.com>
List-Help: <mailto:cygwin-help@cygwin.com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner@cygwin.com
Mail-Followup-To: cygwin@cygwin.com
Delivered-To: mailing list cygwin@cygwin.com

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.  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.

--
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

