SecBSD's official ports repository
This commit is contained in:
commit
2c0afcbbf3
64331 changed files with 5339189 additions and 0 deletions
29
net/poco/patches/patch-Foundation_src_Environment_UNIX_cpp
Normal file
29
net/poco/patches/patch-Foundation_src_Environment_UNIX_cpp
Normal file
|
@ -0,0 +1,29 @@
|
|||
prefer sysconf; we don't have sysctlbyname.
|
||||
https://github.com/pocoproject/poco/issues/130
|
||||
|
||||
--- Foundation/src/Environment_UNIX.cpp.orig Wed Mar 6 19:45:52 2013
|
||||
+++ Foundation/src/Environment_UNIX.cpp Tue Mar 19 17:14:38 2013
|
||||
@@ -133,7 +133,11 @@ std::string EnvironmentImpl::nodeNameImpl()
|
||||
|
||||
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;
|
||||
std::size_t size = sizeof(count);
|
||||
if (sysctlbyname("hw.ncpu", &count, &size, 0, 0))
|
||||
@@ -142,10 +146,6 @@ unsigned EnvironmentImpl::processorCountImpl()
|
||||
return count;
|
||||
#elif POCO_OS == POCO_OS_HPUX
|
||||
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
|
||||
return 1;
|
||||
#endif
|
Loading…
Add table
Add a link
Reference in a new issue