aboutsummaryrefslogtreecommitdiffstats
path: root/src/bus.h
diff options
context:
space:
mode:
authorMattias Andrée <maandree@operamail.com>2015-04-27 01:17:21 +0200
committerMattias Andrée <maandree@operamail.com>2015-04-27 01:17:24 +0200
commitdc61596aabe1d74718ba999f1002e0d7d88a944e (patch)
tree791c63a21524240a918d3f25fcee7e801461cad8 /src/bus.h
parentm whitespace (diff)
downloadbus-dc61596aabe1d74718ba999f1002e0d7d88a944e.tar.gz
bus-dc61596aabe1d74718ba999f1002e0d7d88a944e.tar.bz2
bus-dc61596aabe1d74718ba999f1002e0d7d88a944e.tar.xz
add nowait option to bus_write
Signed-off-by: Mattias Andrée <maandree@operamail.com>
Diffstat (limited to 'src/bus.h')
-rw-r--r--src/bus.h13
1 files changed, 11 insertions, 2 deletions
diff --git a/src/bus.h b/src/bus.h
index 52d0e98..ed1c5de 100644
--- a/src/bus.h
+++ b/src/bus.h
@@ -57,6 +57,12 @@
*/
#define BUS_INTR 4
+/**
+ * Function shall fail with errno set to `EAGAIN`
+ * if the it would block and this flag is used
+ */
+#define BUS_NOWAIT 1
+
/**
@@ -150,9 +156,12 @@ int bus_close(bus_t *bus);
* @param bus Bus information
* @param message The message to write, may not be longer than
* `BUS_MEMORY_SIZE` including the NUL-termination
+ * @param flags `BUS_NOWAIT` if this function shall fail if
+ * another process is currently running this
+ * procedure
* @return 0 on success, -1 on error
*/
-int bus_write(const bus_t *bus, const char *message);
+int bus_write(const bus_t *bus, const char *message, int flags);
/**
* Listen (in a loop, forever) for new message on a bus
@@ -181,7 +190,7 @@ int bus_read(const bus_t *bus, int (*callback)(const char *message, void *user_d
int bus_poll_start(bus_t *bus);
int bus_poll_stop(const bus_t *bus);
-const char *bus_poll(bus_t *bus);
+const char *bus_poll(bus_t *bus, int falgs);