summaryrefslogtreecommitdiff
path: root/doc/socket_functions.rst
diff options
context:
space:
mode:
Diffstat (limited to 'doc/socket_functions.rst')
-rw-r--r--doc/socket_functions.rst16
1 files changed, 16 insertions, 0 deletions
diff --git a/doc/socket_functions.rst b/doc/socket_functions.rst
new file mode 100644
index 0000000..fe2b69d
--- /dev/null
+++ b/doc/socket_functions.rst
@@ -0,0 +1,16 @@
+================
+Socket functions
+================
+
+.. code-block:: c
+
+ #include <libHX/socket.h>
+
+ int HX_socket_from_env(const struct addrinfo *ai, const char *intf);
+
+``HX_socket_from_env``
+ The function looks up the current process's file descriptors for a
+ socket that is listening and which matches the given addrinfo and
+ (optionally) intf if the latter is not NULL``. Upon success, the fd
+ number is returned, or -1 if no file descriptor matched. No errors are
+ signalled.