Portability fixes:

- Use fcntl.h for O_RDONLY and friends.
- Only use mallinfo with glibc.

Source: Void-Linux

--- a/libdaemon/server/daemon-server.c
+++ b/libdaemon/server/daemon-server.c
@@ -16,6 +16,7 @@
 #include "daemon-server.h"
 #include "daemon-log.h"

+#include <fcntl.h>
 #include <dlfcn.h>
 #include <errno.h>
 #include <pthread.h>

--- a/lib/mm/memlock.c
+++ b/lib/mm/memlock.c
@@ -159,7 +159,7 @@ static void _touch_memory(void *mem, siz

 static void _allocate_memory(void)
 {
-#ifndef VALGRIND_POOL
+#if !defined(VALGRIND_POOL) && defined(__GLIBC__)
	void *stack_mem;
	struct rlimit limit;
	int i, area = 0, missing = _size_malloc_tmp, max_areas = 32, hblks;
