diff options
author | David Howells <dhowells@redhat.com> | 2020-01-14 17:07:12 +0000 |
---|---|---|
committer | David Howells <dhowells@redhat.com> | 2020-05-19 15:40:28 +0100 |
commit | e7d553d69cf63aec7de0f38fed49ccbb30922e1e (patch) | |
tree | a10a83373994d18fb79809ddf9b62be7f57d4fff /samples/watch_queue | |
parent | 8cfba76383e902acbed95092163052b1572f17a8 (diff) |
pipe: Add notification lossage handling
Add handling for loss of notifications by having read() insert a
loss-notification message after it has read the pipe buffer that was last
in the ring when the loss occurred.
Lossage can come about either by running out of notification descriptors or
by running out of space in the pipe ring.
Signed-off-by: David Howells <dhowells@redhat.com>
Diffstat (limited to 'samples/watch_queue')
-rw-r--r-- | samples/watch_queue/watch_test.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/samples/watch_queue/watch_test.c b/samples/watch_queue/watch_test.c index 8628b4c5d567..46e618a897fe 100644 --- a/samples/watch_queue/watch_test.c +++ b/samples/watch_queue/watch_test.c @@ -120,6 +120,9 @@ static void consumer(int fd) (n.n.info & WATCH_INFO_ID) >> WATCH_INFO_ID__SHIFT); break; + case WATCH_META_LOSS_NOTIFICATION: + printf("-- LOSS --\n"); + break; default: printf("other meta record\n"); break; |