From 3da9115905b7b7dc5eec494068a63d7f04ddf078 Mon Sep 17 00:00:00 2001 From: Michael Kerrisk Date: Mon, 21 Jul 2014 07:33:17 +0200 Subject: [PATCH] inotify.7: Mention use of timeout when reading IN_MOVED_TO after IN_MOVED_FROM Signed-off-by: Michael Kerrisk --- man7/inotify.7 | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/man7/inotify.7 b/man7/inotify.7 index ed52453f9..5c2597bb3 100644 --- a/man7/inotify.7 +++ b/man7/inotify.7 @@ -743,7 +743,14 @@ returned by the current call to and the accompanying .B IN_MOVED_TO event might be fetched only on the next -.BR read (2). +.BR read (2), +which should be done with a (small) timeout to allow for the fact that +insertion of the +.BR IN_MOVED_FROM - IN_MOVED_TO +event pair is not atomic, +and also the possibility that there may not be any +.B IN_MOVED_TO +event. .SH BUGS .\" FIXME kernel commit 611da04f7a31b2208e838be55a42c7a1310ae321 .\" implies that unmount events were buggy 2.6.11 to 2.6.36