diff options
author | Nikos Mavrogiannopoulos <nmav@gnutls.org> | 2011-04-03 23:42:13 +0200 |
---|---|---|
committer | Nikos Mavrogiannopoulos <nmav@gnutls.org> | 2011-04-03 23:42:20 +0200 |
commit | a736f12ec8ae65636c87bee1df779f2d8c628da9 (patch) | |
tree | 79c3595c9415abe06a0c669b45e58e8b1ff5bd3b /lib/system.h | |
parent | 52b816623848d54934b7d4c8795ec6be1eaf618e (diff) | |
download | gnutls-a736f12ec8ae65636c87bee1df779f2d8c628da9.tar.gz |
Added support for non-blocking DTLS.
Added mini-eagain-dtls to test its operation.
Improved mini-eagain.
Diffstat (limited to 'lib/system.h')
-rw-r--r-- | lib/system.h | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/lib/system.h b/lib/system.h index b1f556557a..849090ee3a 100644 --- a/lib/system.h +++ b/lib/system.h @@ -4,7 +4,9 @@ #include <gnutls_int.h> #ifndef _WIN32 -#include <sys/uio.h> /* for writev */ +# include <sys/uio.h> /* for writev */ +#else +# include <windows.h> /* for Sleep */ #endif int system_errno (gnutls_transport_ptr_t); @@ -35,4 +37,17 @@ ssize_t system_read_peek (gnutls_transport_ptr_t ptr, void *data, int _gnutls_atfork (void (*prepare) (void), void (*parent) (void), void (*child) (void)); +static inline void millisleep(unsigned int ms) +{ +#ifdef _WIN32 + Sleep(ms); +#else +struct timespec ts; + ts.tv_sec = 0; + ts.tv_nsec = ms*1000*1000; + + nanosleep(&ts, NULL); +#endif +} + #endif /* SYSTEM_H */ |