summaryrefslogtreecommitdiff
path: root/pjlib/src/pj/os_core_unix.c
diff options
context:
space:
mode:
authorBenny Prijono <bennylp@teluu.com>2010-01-13 13:09:45 +0000
committerBenny Prijono <bennylp@teluu.com>2010-01-13 13:09:45 +0000
commit8cc7aef25ecc698b6fdfa620877f72e6b8dd536f (patch)
tree40e3c7c8df20a5b26d95543285145348a18009db /pjlib/src/pj/os_core_unix.c
parentd4663d0cbfd495529f7ce486d9f9d36f7969bc50 (diff)
Initial OpenBSD fixes (#994):
pjlib: - Autoconf fixes in detecting header availability - Undefined sched_get_priority_max() and sched_get_priority_min() - protect with #ifdef _POSIX_PRIORITY_SCHEDULING, and - return hardcoded (0, 31) if __OpenBSD__ macro is declared - Better GUID generation pjlib-test: - Reduce the loop in PJILB activesock test - Fixed bug in ioqueue unregistration test which caused assertion error in destroying mutex pjlib-util-test: - Fixed bug in pjlib-util resolver test git-svn-id: http://svn.pjsip.org/repos/pjproject/trunk@3057 74dad513-b988-da41-8d7b-12977e46ad98
Diffstat (limited to 'pjlib/src/pj/os_core_unix.c')
-rw-r--r--pjlib/src/pj/os_core_unix.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/pjlib/src/pj/os_core_unix.c b/pjlib/src/pj/os_core_unix.c
index 00094cf3..c46fbf09 100644
--- a/pjlib/src/pj/os_core_unix.c
+++ b/pjlib/src/pj/os_core_unix.c
@@ -308,7 +308,14 @@ PJ_DEF(int) pj_thread_get_prio_min(pj_thread_t *thread)
if (rc != 0)
return -1;
+#if defined _POSIX_PRIORITY_SCHEDULING
return sched_get_priority_min(policy);
+#elif defined __OpenBSD__
+ return 0;
+#else
+ pj_assert("pj_thread_get_prio_min() not supported!");
+ return 0;
+#endif
}
@@ -325,7 +332,14 @@ PJ_DEF(int) pj_thread_get_prio_max(pj_thread_t *thread)
if (rc != 0)
return -1;
+#if defined _POSIX_PRIORITY_SCHEDULING
return sched_get_priority_max(policy);
+#elif defined __OpenBSD__
+ return 31;
+#else
+ pj_assert("pj_thread_get_prio_max() not supported!");
+ return 0;
+#endif
}