summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/wolf/network/network.h17
1 files changed, 16 insertions, 1 deletions
diff --git a/include/wolf/network/network.h b/include/wolf/network/network.h
index b98723f..29e9ce2 100644
--- a/include/wolf/network/network.h
+++ b/include/wolf/network/network.h
@@ -35,9 +35,18 @@ extern "C" {
#include "port/sys.h"
+#include "errors.h"
+
+#if defined LINUX
+#include <sys/socket.h> /* for sockaddr_storage */
+#include <netinet/in.h> /* for sockaddr_in */
+#else
+#error Check includes first!
+#endif
+
/**
* helper union to avoid anti-aliasing warnings in old network functions like getpeername,
- * use instead of struct sockaddr_storage when declaring socket address variables which need
+ * used instead of struct sockaddr_storage when declaring socket address variables which need
* proper alignment
*/
typedef union wolf_network_sockaddr_union_t {
@@ -49,6 +58,12 @@ typedef union wolf_network_sockaddr_union_t {
struct sockaddr addr;
} wolf_network_sockaddr_union_t;
+/**
+ * Set a file descriptor non-blocking, Unix-specific, and more important, doesn't
+ * work on all kind of descriptors!
+ */
+wolf_error_t wolf_network_set_nonblocking( int fd );
+
#ifdef __cplusplus
}
#endif