From: Sowmini Varadhan <sowmini.varadhan@oracle.com>
To: Steven Whitehouse <swhiteho@redhat.com>
Cc: Sam Kumar <samkumar99@gmail.com>,
linux-kernel@vger.kernel.org,
"netdev@vger.kernel.org" <netdev@vger.kernel.org>
Subject: Re: Question about SOCK_SEQPACKET
Date: Fri, 5 May 2017 06:09:26 -0400 [thread overview]
Message-ID: <20170505100926.GD1547@oracle.com> (raw)
In-Reply-To: <af19f11a-1bc3-bb8f-faf6-65c11b632bbf@redhat.com>
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
next prev parent reply other threads:[~2017-05-05 10:09 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <CAGtMfeCt95bj3-J5+TNb5gxVJUBDrgRjMXqMz-3jk9cOh0Z=tA@mail.gmail.com>
2017-05-05 9:45 ` Question about SOCK_SEQPACKET Steven Whitehouse
2017-05-05 10:09 ` Sowmini Varadhan [this message]
2017-05-05 10:34 ` Steven Whitehouse
2017-05-05 11:21 ` David Laight
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=20170505100926.GD1547@oracle.com \
--to=sowmini.varadhan@oracle.com \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=samkumar99@gmail.com \
--cc=swhiteho@redhat.com \
/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