Re: Problem with unix sockets: SOCK_DGRAM ignores MSG_TRUNC

2007-02-07 Thread Daniel Kabs
On Monday 05 February 2007 01:52, David Miller wrote: > What UDP is doing is different, it's returning the full packet length > when the packet is larger then the given buffer size, but it does this > irregardless of whether you set MSG_TRUNC in the recvmsg() passed-in > flags. UDP itself sets the

Re: Problem with unix sockets: SOCK_DGRAM ignores MSG_TRUNC

2007-02-07 Thread Daniel Kabs
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 wo

RE: Problem with unix sockets: SOCK_DGRAM ignores MSG_TRUNC

2007-02-06 Thread David Schwartz
> 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. Perhap

Re: Problem with unix sockets: SOCK_DGRAM ignores MSG_TRUNC

2007-02-06 Thread Daniel Kabs
On Monday 05 February 2007 01:52, David Miller wrote: > > Thus I used recv() with flags MSG_TRUNC|MSG_PEEK in order to detect > > message truncation due to insufficient buffer size. > > What part of "Only valid for packet sockets" from the manual page > escapes you? :-)) > It's a feature which onl

Re: Problem with unix sockets: SOCK_DGRAM ignores MSG_TRUNC

2007-02-04 Thread David Miller
From: Daniel Kabs <[EMAIL PROTECTED]> Date: Mon, 29 Jan 2007 12:59:49 +0100 > I use unix domain datagram sockets for IPC, e.g. I receive messages by > calling recv(). > > "man 2 recv" tells me about the flags argument to a recv() call, namely: > > MSG_TRUNC > Return the real length of

Problem with unix sockets: SOCK_DGRAM ignores MSG_TRUNC

2007-01-29 Thread Daniel Kabs
Hi, I use unix domain datagram sockets for IPC, e.g. I receive messages by calling recv(). "man 2 recv" tells me about the flags argument to a recv() call, namely: MSG_TRUNC Return the real length of the packet, even when it was longer than the passed buffer. Only valid for pack