Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758012AbYAJA6r (ORCPT ); Wed, 9 Jan 2008 19:58:47 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1755239AbYAJA6h (ORCPT ); Wed, 9 Jan 2008 19:58:37 -0500 Received: from rhun.apana.org.au ([64.62.148.172]:3584 "EHLO arnor.apana.org.au" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1754457AbYAJA6f (ORCPT ); Wed, 9 Jan 2008 19:58:35 -0500 From: Herbert Xu To: Brent Casavant Subject: Re: AF_UNIX MSG_PEEK bug? Cc: penguin-kernel@i-love.sakura.ne.jp, netdev@vger.kernel.org, davem@davemloft.net, linux-kernel@vger.kernel.org Organization: Core In-Reply-To: X-Newsgroups: apana.lists.os.linux.kernel,apana.lists.os.linux.netdev User-Agent: tin/1.7.4-20040225 ("Benbecula") (UNIX) (Linux/2.6.17-rc4 (i686)) Message-Id: Date: Thu, 10 Jan 2008 11:01:53 +1100 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1109 Lines: 28 Brent Casavant wrote: > >> Did you try MSG_WAITALL flag? See "man 2 recv". >> A TCP socket handles data in bytes. >> You cannot complain if the amount received by recv() is smaller than expected >> unless you use MSG_WAITALL flag. > > Yes. It made no difference, as noted in the comments in the > provided test program. The POSIX text for MSG_WAITALL actually says that when used in conjunction with MSG_PEEK it may not return the full data. Having said that, I do agree that having TCP and AF_UNIX behave in the same way is a plus. However, if you really want this to happen it would help if you had attached a patch :) Thanks, -- Visit Openswan at http://www.openswan.org/ Email: Herbert Xu ~{PmV>HI~} Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/