lkml.org 
[lkml]   [2007]   [Feb]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: Problem with unix sockets: SOCK_DGRAM ignores MSG_TRUNC
Date
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
-
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/

\
 
 \ /
  Last update: 2007-02-07 10:01    [W:0.043 / U:0.080 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site