Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1636287

Re: Question about SOCK_SEQPACKET

From Sowmini Varadhan <sowmini.varadhan@oracle.com>
Newsgroups linux.kernel
Subject Re: Question about SOCK_SEQPACKET
Date 2017-05-05 12:20 +0200
Message-ID <tDIv8-kZ-5@gated-at.bofh.it> (permalink)
References <tDDON-5Im-3@gated-at.bofh.it> <tDI26-8l5-1@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On (05/05/17 10:45), Steven Whitehouse wrote:
> 
> I do wonder if the man page for recvmsg is wrong, or at least a bit
> confusing. SOCK_SEQPACKET is stream based not message based - it just
> happens to have EOR markers in the stream. There is no reason that the whole
> message needs to be returned in a single read, and in fact that would be
> impossible if the sender didn't insert any EOR markers but kept sending data
> beyond the size that the socket could buffer.
> 
> I notice that man 7 socket says SOCK_SEQPACKET is for datagrams of fixed
> maximum length which is definitely wrong, as is the statement that a
> consumer has to read an entire packet with each system call.

Which man page do you think is wrong here? The POSIX definition is here

http://pubs.opengroup.org/onlinepubs/009695399/functions/recvmsg.html

The description in

http://pubs.opengroup.org/onlinepubs/009695399/functions/xsh_chap02_10.html

says, "It is protocol-specific whether a maximum record size is imposed."
In my machine (Ubuntu 4.4.0-72, and it is in socket(2), not socket(7), btw)
doesnt have any references to max length, but I'm not sure I'd boldly assert
"definitely wrong" about the requirement of having to read entire
packet in a system call (see POSIX man page)

--Sowmini

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Question about SOCK_SEQPACKET Sam Kumar <samkumar99@gmail.com> - 2017-05-05 07:20 +0200
  Re: Question about SOCK_SEQPACKET Steven Whitehouse <swhiteho@redhat.com> - 2017-05-05 11:50 +0200
    Re: Question about SOCK_SEQPACKET Sowmini Varadhan <sowmini.varadhan@oracle.com> - 2017-05-05 12:20 +0200
      Re: Question about SOCK_SEQPACKET Steven Whitehouse <swhiteho@redhat.com> - 2017-05-05 12:40 +0200
        RE: Question about SOCK_SEQPACKET David Laight <David.Laight@ACULAB.COM> - 2017-05-05 13:30 +0200

csiph-web