diff options
Diffstat (limited to 'src/libstrongswan/threading/mutex.h')
-rw-r--r-- | src/libstrongswan/threading/mutex.h | 29 |
1 files changed, 0 insertions, 29 deletions
diff --git a/src/libstrongswan/threading/mutex.h b/src/libstrongswan/threading/mutex.h index ca242f680..ac36b6a25 100644 --- a/src/libstrongswan/threading/mutex.h +++ b/src/libstrongswan/threading/mutex.h @@ -25,35 +25,6 @@ typedef struct mutex_t mutex_t; typedef enum mutex_type_t mutex_type_t; -#include "condvar.h" - -#ifdef __APPLE__ -/* on Mac OS X 10.5 several system calls we use are no cancellation points. - * fortunately, select isn't one of them, so we wrap some of the others with - * calls to select(2). - */ -#include <sys/socket.h> -#include <sys/select.h> - -#define WRAP_WITH_SELECT(func, socket, ...)\ - fd_set rfds; FD_ZERO(&rfds); FD_SET(socket, &rfds);\ - if (select(socket + 1, &rfds, NULL, NULL, NULL) <= 0) { return -1; }\ - return func(socket, __VA_ARGS__) - -static inline int cancellable_accept(int socket, struct sockaddr *address, - socklen_t *address_len) -{ - WRAP_WITH_SELECT(accept, socket, address, address_len); -} -#define accept cancellable_accept -static inline int cancellable_recvfrom(int socket, void *buffer, size_t length, - int flags, struct sockaddr *address, socklen_t *address_len) -{ - WRAP_WITH_SELECT(recvfrom, socket, buffer, length, flags, address, address_len); -} -#define recvfrom cancellable_recvfrom -#endif /* __APPLE__ */ - /** * Type of mutex. */ |