Recent versions of freebsd have a threadsafe poll.

Use sched_get_priority_* to get actual priority min & max rather than hardcoding defaults.
Patches from freebsd ports system.
Bug #112987 r=rjesup@wgate.com
This commit is contained in:
seawood%netscape.com 2002-01-01 00:44:07 +00:00
Родитель 43eab1081d
Коммит 66d0a73479
2 изменённых файлов: 4 добавлений и 3 удалений

Просмотреть файл

@ -37,6 +37,7 @@
#include "prthread.h"
#include <sys/param.h>
#include <sys/syscall.h>
#define PR_LINKER_ARCH "freebsd"
@ -65,7 +66,7 @@
#define _PR_HAVE_SOCKADDR_LEN
#define _PR_STAT_HAS_ST_ATIMESPEC
#define _PR_NO_LARGE_FILES
#if ( __FreeBSD__ > 2 )
#if ( __FreeBSD_version >= 220000 ) && ( __FreeBSD_version < 400008 )
#if !defined(_PR_PTHREADS)
/*
* libc_r doesn't have poll(). Although libc has poll(), it is not

Просмотреть файл

@ -225,7 +225,7 @@
#define PT_PRIO_MAX sched_get_priority_max(SCHED_OTHER)
#endif /* defined(_PR_DCETHREADS) */
#elif defined(LINUX)
#elif defined(LINUX) || defined(FREEBSD)
#define PT_PRIO_MIN sched_get_priority_min(SCHED_OTHER)
#define PT_PRIO_MAX sched_get_priority_max(SCHED_OTHER)
#elif defined(NTO)
@ -245,7 +245,7 @@
*/
#define PT_PRIO_MIN 1
#define PT_PRIO_MAX 127
#elif defined(FREEBSD) || defined(NETBSD) || defined(OPENBSD) \
#elif defined(NETBSD) || defined(OPENBSD) \
|| defined(BSDI) || defined(DARWIN) || defined(UNIXWARE) /* XXX */
#define PT_PRIO_MIN 0
#define PT_PRIO_MAX 126