From: bert hubert Date: Sat, 7 Mar 2015 21:01:49 +0000 (+0100) Subject: remove dependency on unix_utility.cc from misc.hh X-Git-Tag: dnsdist-1.0.0-alpha1~248^2~88^2~88 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=15ad1a993350f9d19c278dc19b1b4fb8cd60ed32;p=thirdparty%2Fpdns.git remove dependency on unix_utility.cc from misc.hh --- diff --git a/pdns/misc.hh b/pdns/misc.hh index 515e35fe5f..e7b69169f9 100644 --- a/pdns/misc.hh +++ b/pdns/misc.hh @@ -34,7 +34,6 @@ #include using namespace ::boost::multi_index; -#include "utility.hh" #include "dns.hh" #include #include @@ -206,13 +205,13 @@ private: inline void DTime::set() { - Utility::gettimeofday(&d_set,0); + gettimeofday(&d_set,0); } inline int DTime::udiff() { int res=udiffNoReset(); - Utility::gettimeofday(&d_set,0); + gettimeofday(&d_set,0); return res; } @@ -220,7 +219,7 @@ inline int DTime::udiffNoReset() { struct timeval now; - Utility::gettimeofday(&now,0); + gettimeofday(&now,0); int ret=1000000*(now.tv_sec-d_set.tv_sec)+(now.tv_usec-d_set.tv_usec); return ret; } @@ -283,7 +282,7 @@ inline string toUpper( const string& s ) inline double getTime() { struct timeval now; - Utility::gettimeofday(&now,0); + gettimeofday(&now,0); return now.tv_sec+now.tv_usec/1000000.0; } @@ -545,4 +544,11 @@ void setFilenumLimit(unsigned int lim); bool readFileIfThere(const char* fname, std::string* line); uint32_t burtle(const unsigned char* k, uint32_t lengh, uint32_t init); void setSocketTimestamps(int fd); + +//! Sets the socket into blocking mode. +bool setBlocking( int sock ); + +//! Sets the socket into non-blocking mode. +bool setNonBlocking( int sock ); + #endif