]> git.ozlabs.org Git - ccan/blobdiff - ccan/io/io.h
io: add io_conn_fd()
[ccan] / ccan / io / io.h
index 067a69c1dec441a752508dfe50ee8f83b8421466..6248fec02c2e5c5ae3d42e65d80eb8483af1d5aa 100644 (file)
@@ -491,6 +491,14 @@ struct io_plan io_close_cb(struct io_conn *, void *unused);
  */
 void *io_loop(void);
 
+/**
+ * io_conn_fd - get the fd from a connection.
+ * @conn: the connection.
+ *
+ * Sometimes useful, eg for getsockname().
+ */
+int io_conn_fd(const struct io_conn *conn);
+
 /**
  * io_set_alloc - set alloc/realloc/free function for io to use.
  * @allocfn: allocator function