diff --git a/src/modules/module-rtkit.c b/src/modules/module-rtkit.c index 6c0d2723d..041b95820 100644 --- a/src/modules/module-rtkit.c +++ b/src/modules/module-rtkit.c @@ -29,6 +29,9 @@ #include #include #include +#ifdef __FreeBSD__ +#include +#endif #include #include #include @@ -144,7 +147,13 @@ void pw_rtkit_bus_free(struct pw_rtkit_bus *system_bus) static pid_t _gettid(void) { +#ifndef __FreeBSD__ return (pid_t) syscall(SYS_gettid); +#else + long pid; + thr_self(&pid); + return (pid_t)pid; +#endif } static int translate_error(const char *name) @@ -440,10 +449,12 @@ static void idle_func(struct spa_source *source) spa_zero(sp); sp.sched_priority = rtprio; +#ifndef __FreeBSD__ if (pthread_setschedparam(pthread_self(), SCHED_OTHER | SCHED_RESET_ON_FORK, &sp) == 0) { pw_log_debug("SCHED_OTHER|SCHED_RESET_ON_FORK worked."); return; } +#endif system_bus = pw_rtkit_bus_get_system(); if (system_bus == NULL)