Patchwork [2/8] add event_notifier_set

login
register
mail settings
Submitter Paolo Bonzini
Date May 26, 2010, 2:09 p.m.
Message ID <1274882978-9875-3-git-send-email-pbonzini@redhat.com>
Download mbox | patch
Permalink /patch/53637/
State New
Headers show

Comments

Paolo Bonzini - May 26, 2010, 2:09 p.m.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 event_notifier.c |    7 +++++++
 event_notifier.h |    1 +
 2 files changed, 8 insertions(+), 0 deletions(-)

Patch

diff --git a/event_notifier.c b/event_notifier.c
index 2c73555..3f50568 100644
--- a/event_notifier.c
+++ b/event_notifier.c
@@ -38,6 +38,13 @@  int event_notifier_get_fd(EventNotifier *e)
     return e->fd;
 }
 
+int event_notifier_set(EventNotifier *e)
+{
+    uint64_t value = 1;
+    int r = write(e->fd, &value, sizeof(value));
+    return r == sizeof(value);
+}
+
 int event_notifier_test_and_clear(EventNotifier *e)
 {
     uint64_t value;
diff --git a/event_notifier.h b/event_notifier.h
index 24117ea..8d5735f 100644
--- a/event_notifier.h
+++ b/event_notifier.h
@@ -10,6 +10,7 @@  struct EventNotifier {
 int event_notifier_init(EventNotifier *, int active);
 void event_notifier_cleanup(EventNotifier *);
 int event_notifier_get_fd(EventNotifier *);
+int event_notifier_set(EventNotifier *);
 int event_notifier_test_and_clear(EventNotifier *);
 int event_notifier_test(EventNotifier *);