public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Daniel Kabs <dkabs@mobotix.com>
To: davids@webmaster.com
Cc: "Linux-Kernel@Vger. Kernel. Org" <linux-kernel@vger.kernel.org>
Subject: Re: Problem with unix sockets: SOCK_DGRAM ignores MSG_TRUNC
Date: Wed, 7 Feb 2007 09:58:51 +0100	[thread overview]
Message-ID: <200702070958.51520.dkabs@mobotix.com> (raw)
In-Reply-To: <MDEHLPKNGKAHNMBLJOLKCEKJBGAC.davids@webmaster.com>

On Tuesday 06 February 2007 21:11, David Schwartz wrote:
> > Why not improve consistency and make unix_dgram_recvmsg() return the
> > full packet length? So it would behave as UDP does. What do you think
> > about adding the following code to linux/net/unix/af_unix.c:
>
> It would be nice if the world worked that way, but you can't break
> POSIX compliance. Perhaps another receive flag?

I now understand that setting the MSG_TRUNC flag is only applicable for 
PF_PACKET. I do not argue about that any more. :-)

What I question is the return value when receiving from a local socket 
using recv(). Sorry, I don't know what the POSIX standard has to say 
about receiving from local sockets in contrast to UDP sockets as my only 
reference are the man pages.

According to "man 2 recv", on success the return value is the "the  number  
of bytes received". Since patch-2.6.8, UDP is always returning the full 
packet length. I'd like to see local sockets (PF_UNIX) to do the same. 

Does POSIX stipulate a different behaviour for local sockets?

Cheers
Daniel

  reply	other threads:[~2007-02-07  8:59 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-01-29 11:59 Problem with unix sockets: SOCK_DGRAM ignores MSG_TRUNC Daniel Kabs
2007-02-05  0:52 ` David Miller
2007-02-06 12:55   ` Daniel Kabs
2007-02-06 20:11     ` David Schwartz
2007-02-07  8:58       ` Daniel Kabs [this message]
2007-02-07  9:31   ` Daniel Kabs

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200702070958.51520.dkabs@mobotix.com \
    --to=dkabs@mobotix.com \
    --cc=davids@webmaster.com \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox