diff --git a/src/include/utils/os.h b/src/include/utils/os.h
index 07328dd11a2b0d9aaf96c82c0f920e1d88082070..38d53b2a8bb1281aa13987403ea60f96b3375a6d 100644 (file)
--- a/src/include/utils/os.h
+++ b/src/include/utils/os.h
char *
sdb_get_current_user(void);
+enum {
+ SDB_SELECTIN = 0,
+ SDB_SELECTOUT,
+ SDB_SELECTERR,
+};
+
+/*
+ * sdb_select:
+ * Wait for a file-descriptor to become ready for I/O operations of the
+ * specified type. This is a simple wrapper around the select() system call.
+ * The type argument may be any of the SDB_SELECT* constants.
+ *
+ * Returns:
+ * - the number of file descriptors ready for I/O
+ * - a negative value on error
+ */
+int
+sdb_select(int fd, int type);
+
+/*
+ * sdb_write:
+ * Write a message to a file-descriptor. This is a simple wrapper around the
+ * write() system call ensuring that all data is written on success.
+ *
+ * Returns:
+ * - the number of bytes written
+ * - a negative value on error
+ */
+ssize_t
+sdb_write(int fd, size_t msg_len, const void *msg);
+
#ifdef __cplusplus
} /* extern "C" */
#endif