linux-man.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Elie De Brauwer <eliedebrauwer-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
To: mtk.manpages-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
Cc: linux-man-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	Elie De Brauwer
	<eliedebrauwer-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
Subject: [PATCH] recvmmsg.2 Updated timeout documentation
Date: Sun, 23 Dec 2012 13:06:55 +0100	[thread overview]
Message-ID: <1356264415-5108-1-git-send-email-eliedebrauwer@gmail.com> (raw)
In-Reply-To: <CAKgNAkhz1E8c2jpECcYrKJyMv1RB36qC_HjW9s=i=+bYLfii4w-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>

All,

This is the second part of my recvmmsg update, this is splitted off from the 
version related information.

At first I considered the possibility of it being a kernel patch too, but I
compared the original commit and checked if it might have been evolved
upstream but short from the WAITFORNONE addition it has not.

In any case, when operating in non-blocking mode, the timeout is taken into
account, which could mean that recvmmsg() returns while data is still 
available (which was not clearly stated). (Combination of much data to 
copy and a very sharp timeout).

And when operating in blocking mode, the timeout is only taken into account
after the reception of data. Which may mean infinity when no data arrives. 
Having the timeout function in kernel space would probably imply calling 
something (e)poll()/select()-ish before attempting to recieve.

my 2 cents
E.

---
 man2/recvmmsg.2 |   18 ++++++++++--------
 1 file changed, 10 insertions(+), 8 deletions(-)

diff --git a/man2/recvmmsg.2 b/man2/recvmmsg.2
index 85e4080..b16335f 100644
--- a/man2/recvmmsg.2
+++ b/man2/recvmmsg.2
@@ -107,24 +107,26 @@ argument points to a
 (see
 .BR clock_gettime (2))
 defining a timeout (seconds plus nanoseconds) for the receive operation.
-(This interval will be rounded up to the system clock granularity,
-and kernel scheduling delays mean that the blocking interval
-may overrun by a small amount.)
 If
 .I timeout
 is
 .I NULL
-then the operation blocks indefinitely.
+then the timeout is not taken into account.
 
 A blocking
 .BR recvmmsg ()
 call blocks until
 .I vlen
-messages have been received
-or until the timeout expires.
+messages have been received,
+or the timeout expires, or until a reception error occurs. 
+The timeout expiration is checked each time a message has 
+been received in a buffer. Hence a blocking call may block
+indefinitely if no messages are arriving.
 A nonblocking call reads as many messages as are available
-(up to the limit specified by
-.IR vlen )
+(up to the limits specified by
+.IR vlen
+and
+.IR timeout)
 and returns immediately.
 
 On return from
-- 
1.7.10.4

--
To unsubscribe from this list: send the line "unsubscribe linux-man" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

  parent reply	other threads:[~2012-12-23 12:06 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-12-19 22:37 [PATCH] recvmmsg.2: correct since fields and correct specification of the timeout parameter Elie De Brauwer
     [not found] ` <1355956627-5676-1-git-send-email-eliedebrauwer-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2012-12-23  9:23   ` Michael Kerrisk (man-pages)
     [not found]     ` <CAKgNAkhz1E8c2jpECcYrKJyMv1RB36qC_HjW9s=i=+bYLfii4w-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2012-12-23 11:47       ` [PATCH] recvmmsg.2 Updated since fields for recvmmsg and MSG_WAITFORNONE Elie De Brauwer
     [not found]         ` <1356263235-4803-1-git-send-email-eliedebrauwer-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2012-12-23 17:50           ` Michael Kerrisk (man-pages)
2012-12-23 12:06       ` Elie De Brauwer [this message]
     [not found]         ` <1356264415-5108-1-git-send-email-eliedebrauwer-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2012-12-23 18:30           ` [PATCH] recvmmsg.2 Updated timeout documentation Michael Kerrisk (man-pages)
     [not found]             ` <CAKgNAkhFS_n4BrTvqV12VcLSPXGjkBE6MOFS-sUCnCT8y7Pjfw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2012-12-23 20:42               ` Elie De Brauwer

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=1356264415-5108-1-git-send-email-eliedebrauwer@gmail.com \
    --to=eliedebrauwer-re5jqeeqqe8avxtiumwx3w@public.gmane.org \
    --cc=linux-man-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=mtk.manpages-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.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;
as well as URLs for NNTP newsgroup(s).