aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/samples
diff options
context:
space:
mode:
authorDavid Howells <dhowells@redhat.com>2020-01-14 17:07:12 +0000
committerDavid Howells <dhowells@redhat.com>2020-05-19 15:40:28 +0100
commite7d553d69cf63aec7de0f38fed49ccbb30922e1e (patch)
treea10a83373994d18fb79809ddf9b62be7f57d4fff /samples
parentpipe: Allow buffers to be marked read-whole-or-error for notifications (diff)
downloadwireguard-linux-e7d553d69cf63aec7de0f38fed49ccbb30922e1e.tar.xz
wireguard-linux-e7d553d69cf63aec7de0f38fed49ccbb30922e1e.zip
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')
-rw-r--r--samples/watch_queue/watch_test.c3
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;