Insert bits to allow successful compilation (and apparent success in
running) on FreeBSD.
This commit is contained in:
parent
724af76462
commit
7b6452aa2d
4 changed files with 11 additions and 3 deletions
|
@ -47,6 +47,10 @@
|
||||||
#include <fcntl.h>
|
#include <fcntl.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
|
#ifdef __FreeBSD__
|
||||||
|
#include <machine/param.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
void
|
void
|
||||||
vmem_heap_init(void)
|
vmem_heap_init(void)
|
||||||
{
|
{
|
||||||
|
@ -84,8 +88,10 @@ umem_type_init(caddr_t start, size_t len, size_t pgsize)
|
||||||
SYSTEM_INFO info;
|
SYSTEM_INFO info;
|
||||||
GetSystemInfo(&info);
|
GetSystemInfo(&info);
|
||||||
pagesize = info.dwPageSize;
|
pagesize = info.dwPageSize;
|
||||||
#else
|
#elseif !defined(__FreeBSD__)
|
||||||
pagesize = _sysconf(_SC_PAGESIZE);
|
pagesize = _sysconf(_SC_PAGESIZE);
|
||||||
|
#else
|
||||||
|
pagesize = PAGE_SIZE;
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
2
malloc.c
2
malloc.c
|
@ -33,7 +33,9 @@
|
||||||
|
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
|
#ifdef HAVE_SYS_SYSMACROS_H
|
||||||
#include <sys/sysmacros.h>
|
#include <sys/sysmacros.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
#include "umem_base.h"
|
#include "umem_base.h"
|
||||||
|
|
||||||
|
|
|
@ -165,7 +165,7 @@ static INLINE uint_t ec_atomic_inc(uint_t *mem)
|
||||||
|
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
#define issetugid() 0
|
#define issetugid() 0
|
||||||
#else
|
#elseif !defined(__FreeBSD__)
|
||||||
#define issetugid() (geteuid() == 0)
|
#define issetugid() (geteuid() == 0)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
2
umem.c
2
umem.c
|
@ -518,7 +518,7 @@ umem_log_header_t *umem_failure_log;
|
||||||
umem_log_header_t *umem_slab_log;
|
umem_log_header_t *umem_slab_log;
|
||||||
|
|
||||||
extern thread_t _thr_self(void);
|
extern thread_t _thr_self(void);
|
||||||
#if defined(__MACH__)
|
#if defined(__MACH__) || defined(__FreeBSD__)
|
||||||
# define CPUHINT() ((int)(_thr_self()))
|
# define CPUHINT() ((int)(_thr_self()))
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue