sched_get_priority_max() on OpenBSD

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

Returning 31 for sched_get_priority_max() is valid on FreeBSD only, 
since OpenBSD doesn't have sched_get_priority_{min,max} at all.

I propose the following patch:

--- pjlib/src/pj/os_core_unix.c.orig
+++ pjlib/src/pj/os_core_unix.c
@@ -310,7 +310,7 @@ PJ_DEF(int) pj_thread_get_prio_min(pj_thread_t *thread
 
 #if defined _POSIX_PRIORITY_SCHEDULING
     return sched_get_priority_min(policy);
-#elif defined __OpenBSD__
+#elif defined __FreeBSD__ || defined __OpenBSD__
     return 0;
 #else
     pj_assert("pj_thread_get_prio_min() not supported!");
@@ -334,8 +334,10 @@ PJ_DEF(int) pj_thread_get_prio_max(pj_thread_t *thread
 
 #if defined _POSIX_PRIORITY_SCHEDULING
     return sched_get_priority_max(policy);
-#elif defined __OpenBSD__
+#elif defined __FreeBSD__
     return 31;
+#elif defined __OpenBSD__
+    return 0;
 #else
     pj_assert("pj_thread_get_prio_max() not supported!");
     return 0;


Best Regards,
David Coppa




[Index of Archives]     [Asterisk Users]     [Asterisk App Development]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [Linux API]
  Powered by Linux