Another round of documentation.
Bug: N/A
Test: N/A
Change-Id: I1b818fbb36ddd6d084dee56828290c2717a0c9b0
diff --git a/libc/include/sys/eventfd.h b/libc/include/sys/eventfd.h
index 3cfb5e7..85f9877 100644
--- a/libc/include/sys/eventfd.h
+++ b/libc/include/sys/eventfd.h
@@ -26,24 +26,48 @@
* SUCH DAMAGE.
*/
-#ifndef _SYS_EVENTFD_H
-#define _SYS_EVENTFD_H
+#pragma once
+
+/**
+ * @file sys/eventfd.h
+ * @brief Event notification file descriptors.
+ */
#include <sys/cdefs.h>
#include <fcntl.h>
__BEGIN_DECLS
+/** The eventfd() flag for a close-on-exec file descriptor. */
#define EFD_CLOEXEC O_CLOEXEC
+/** The eventfd() flag for a non-blocking file descriptor. */
#define EFD_NONBLOCK O_NONBLOCK
-typedef uint64_t eventfd_t;
-
+/**
+ * [eventfd(2)](http://man7.org/linux/man-pages/man2/eventfd.2.html) creates a file descriptor
+ * for event notification.
+ *
+ * Returns a new file descriptor on success, and returns -1 and sets `errno` on failure.
+ */
int eventfd(unsigned int __initial_value, int __flags);
+/** The type used by eventfd_read() and eventfd_write(). */
+typedef uint64_t eventfd_t;
+
+/**
+ * [eventfd_read(3)](http://man7.org/linux/man-pages/man2/eventfd.2.html) is a convenience
+ * wrapper to read an `eventfd_t` from an eventfd file descriptor.
+ *
+ * Returns 0 on success, or returns -1 otherwise.
+ */
int eventfd_read(int __fd, eventfd_t* __value);
+
+/**
+ * [eventfd_write(3)](http://man7.org/linux/man-pages/man2/eventfd.2.html) is a convenience
+ * wrapper to write an `eventfd_t` to an eventfd file descriptor.
+ *
+ * Returns 0 on success, or returns -1 otherwise.
+ */
int eventfd_write(int __fd, eventfd_t __value);
__END_DECLS
-
-#endif