Commit 66628f1e authored by Marek Vavrusa's avatar Marek Vavrusa

Ported to OS X.

parent bac4caa2
......@@ -40,9 +40,9 @@ LDFLAGS="$LDFLAGS -L/usr/local/lib"
AC_SEARCH_LIBS([pow], [m])
AC_SEARCH_LIBS([pthread_create], [pthread], [], [AC_MSG_ERROR([pthreads not found])])
AC_SEARCH_LIBS([rcu_read_lock], [urcu], [], [AC_MSG_ERROR([liburcu not found])])
AC_SEARCH_LIBS([clock_gettime], [rt], [], [AC_MSG_ERROR([librt not found])])
#AC_SEARCH_LIBS([clock_gettime], [rt], [], [AC_MSG_ERROR([librt not found])])
AC_SEARCH_LIBS([OpenSSL_add_all_digests], [crypto],[], [AC_MSG_ERROR([libcrypto not found])])
AC_SEARCH_LIBS([ev_loop], [ev],[], [AC_MSG_ERROR([libev not found])])
AC_SEARCH_LIBS([ev_run], [ev],[], [AC_MSG_ERROR([libev not found])])
#AC_SEARCH_LIBS([ldns_rr_list_pop_rrset], [ldns], [], [AC_MSG_ERROR([libldns not found])])
# Checks for header files.
......
......@@ -19,12 +19,12 @@ header="${1%.*}_rc"
header=`basename ${header}`
# Get file size and dump content
size=`stat --format "%s" ${1} 2>/dev/null`
size=`stat -f "%z" ${1} 2>/dev/null`
dump=`${hd} "${fmt}" ${1} 2>/dev/null`
# Format file size variable
echo "static const unsigned ${header}_size = ${size};"
# Format file content dump
echo -n "static const char ${header}[] = { "
echo "static const char ${header}[] = { "
echo "${dump}0x00 };"
......@@ -33,7 +33,7 @@ struct dt_unit_t;
/*!
* \brief Thread state enumeration.
*/
enum {
typedef enum {
ThreadJoined = 1 << 0, /*!< Thread is finished and joined. */
ThreadJoinable = 1 << 1, /*!< Thread is waiting to be reclaimed. */
ThreadCancelled = 1 << 2, /*!< Thread is cancelled, finishing task. */
......
......@@ -23,7 +23,7 @@
#include "common/sockaddr.h"
/*! \brief Socket-related constants. */
enum {
typedef enum {
SOCKET_MTU_SZ = 8192, /*!< \todo Determine UDP MTU size. */
} socket_const_t;
......
......@@ -366,8 +366,10 @@ int tcp_send(int fd, uint8_t *msg, size_t msglen)
/*! \brief TCP corking.
* \see http://vger.kernel.org/~acme/unbehaved.txt
*/
#ifdef TCP_CORK
int cork = 1;
setsockopt(fd, SOL_TCP, TCP_CORK, &cork, sizeof(cork));
#endif§
/* Send message size. */
unsigned short pktsize = htons(msglen);
......@@ -382,9 +384,11 @@ int tcp_send(int fd, uint8_t *msg, size_t msglen)
return KNOT_ERROR;
}
#ifdef TCP_CORK
/* Uncork. */
cork = 0;
setsockopt(fd, SOL_TCP, TCP_CORK, &cork, sizeof(cork));
#endif
return sent;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment