From 17a67d9faefbff1cc7e05b82ea1981f5e14ace2c Mon Sep 17 00:00:00 2001 From: Andreas Baumann Date: Sun, 26 Apr 2009 19:26:55 +0200 Subject: started to move Unix-specific networking stuff into the wolf library (out of the tests) --- include/wolf/network/network.h | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) (limited to 'include') 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 /* for sockaddr_storage */ +#include /* 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 -- cgit v1.2.3-54-g00ecf