diff options
author | Andreas Baumann <abaumann@yahoo.com> | 2009-04-26 19:26:55 +0200 |
---|---|---|
committer | Andreas Baumann <abaumann@yahoo.com> | 2009-04-26 19:26:55 +0200 |
commit | 17a67d9faefbff1cc7e05b82ea1981f5e14ace2c (patch) | |
tree | 29d05818cafd4f1c66a5f7c3e974ecf79570f01d /include | |
parent | efbc5946bf6a8126ffaeea7a0abf54b29d3c572a (diff) | |
download | wolfbones-17a67d9faefbff1cc7e05b82ea1981f5e14ace2c.tar.gz wolfbones-17a67d9faefbff1cc7e05b82ea1981f5e14ace2c.tar.bz2 |
started to move Unix-specific networking stuff into the wolf library (out of the tests)
Diffstat (limited to 'include')
-rw-r--r-- | include/wolf/network/network.h | 17 |
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 |