Don't call prctl() on FreeBSD.

This commit is contained in:
Gleb Popov 2019-11-10 11:51:46 +04:00 committed by Wim Taymans
parent 0a21c61ed0
commit feb9a4b9e1

View file

@ -29,7 +29,9 @@
#include <unistd.h>
#include <limits.h>
#include <stdio.h>
#ifndef __FreeBSD__
#include <sys/prctl.h>
#endif
#include <pwd.h>
#include <errno.h>
#include <dlfcn.h>
@ -436,8 +438,10 @@ const char *pw_get_prgname(void)
static char tcomm[16 + 1];
spa_zero(tcomm);
#ifndef __FreeBSD__
if (prctl(PR_GET_NAME, (unsigned long) tcomm, 0, 0, 0) == 0)
return tcomm;
#endif
return NULL;
}