mirror of
https://github.com/pocoproject/poco.git
synced 2025-10-24 17:30:44 +02:00
- fixed GH #130: Patch: prefer sysconf over sysctlbyname - fixed GH #131: Patch: no timezone global var on OpenBSD
This commit is contained in:
@@ -31,6 +31,8 @@ Release 1.5.2 (2013-03-??)
|
|||||||
- SocketAddress small object optimization
|
- SocketAddress small object optimization
|
||||||
- fixed GH #79: Poco::Thread leak on Linux
|
- fixed GH #79: Poco::Thread leak on Linux
|
||||||
- fixed GH #61: static_md build configs for Crypto and NetSSL
|
- fixed GH #61: static_md build configs for Crypto and NetSSL
|
||||||
|
- fixed GH #130: prefer sysconf over sysctlbyname
|
||||||
|
- fixed GH #131: no timezone global var on OpenBSD
|
||||||
|
|
||||||
Release 1.5.1 (2013-01-11)
|
Release 1.5.1 (2013-01-11)
|
||||||
==========================
|
==========================
|
||||||
|
|||||||
@@ -133,7 +133,11 @@ std::string EnvironmentImpl::nodeNameImpl()
|
|||||||
|
|
||||||
unsigned EnvironmentImpl::processorCountImpl()
|
unsigned EnvironmentImpl::processorCountImpl()
|
||||||
{
|
{
|
||||||
#if defined(POCO_OS_FAMILY_BSD)
|
#if defined(_SC_NPROCESSORS_ONLN)
|
||||||
|
int count = sysconf(_SC_NPROCESSORS_ONLN);
|
||||||
|
if (count <= 0) count = 1;
|
||||||
|
return static_cast<int>(count);
|
||||||
|
#elif defined(POCO_OS_FAMILY_BSD)
|
||||||
unsigned count;
|
unsigned count;
|
||||||
std::size_t size = sizeof(count);
|
std::size_t size = sizeof(count);
|
||||||
if (sysctlbyname("hw.ncpu", &count, &size, 0, 0))
|
if (sysctlbyname("hw.ncpu", &count, &size, 0, 0))
|
||||||
@@ -142,10 +146,6 @@ unsigned EnvironmentImpl::processorCountImpl()
|
|||||||
return count;
|
return count;
|
||||||
#elif POCO_OS == POCO_OS_HPUX
|
#elif POCO_OS == POCO_OS_HPUX
|
||||||
return pthread_num_processors_np();
|
return pthread_num_processors_np();
|
||||||
#elif defined(_SC_NPROCESSORS_ONLN)
|
|
||||||
int count = sysconf(_SC_NPROCESSORS_ONLN);
|
|
||||||
if (count <= 0) count = 1;
|
|
||||||
return static_cast<int>(count);
|
|
||||||
#else
|
#else
|
||||||
return 1;
|
return 1;
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -52,7 +52,7 @@ public:
|
|||||||
|
|
||||||
int timeZone()
|
int timeZone()
|
||||||
{
|
{
|
||||||
#if defined(__APPLE__) || defined(__FreeBSD__) || defined(POCO_ANDROID) // no timezone global var
|
#if defined(__APPLE__) || defined(__FreeBSD__) || defined (__OpenBSD__) || defined(POCO_ANDROID) // no timezone global var
|
||||||
std::time_t now = std::time(NULL);
|
std::time_t now = std::time(NULL);
|
||||||
struct std::tm t;
|
struct std::tm t;
|
||||||
gmtime_r(&now, &t);
|
gmtime_r(&now, &t);
|
||||||
|
|||||||
Reference in New Issue
Block a user