Add posix_* weak helpers

Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
diff --git a/Makefile.solaris b/Makefile.solaris
index 595f854..b87a92f 100644
--- a/Makefile.solaris
+++ b/Makefile.solaris
@@ -4,7 +4,7 @@
 SCRIPTS = fio_generate_plots
 OBJS = gettime.o fio.o ioengines.o init.o stat.o log.o time.o filesetup.o \
 	eta.o verify.o memory.o io_u.o parse.o mutex.o options.o \
-	rbtree.o fifo.o smalloc.o filehash.o lib/strsep.o
+	rbtree.o fifo.o smalloc.o filehash.o lib/strsep.o helpers.o
 
 OBJS += crc/crc7.o
 OBJS += crc/crc16.o
diff --git a/compiler/compiler.h b/compiler/compiler.h
index 1a0556b..0a08bb1 100644
--- a/compiler/compiler.h
+++ b/compiler/compiler.h
@@ -15,4 +15,6 @@
 
 #define uninitialized_var(x) x = x
 
+#define __weak	__attribute__((weak))
+
 #endif
diff --git a/helpers.c b/helpers.c
new file mode 100644
index 0000000..987f5b6
--- /dev/null
+++ b/helpers.c
@@ -0,0 +1,15 @@
+#include <malloc.h>
+#include <stdlib.h>
+
+#include "compiler/compiler.h"
+
+int __weak posix_memalign(void **ptr, size_t align, size_t size)
+{
+	*ptr = memalign(align, size);
+	return *ptr == NULL;
+}
+
+int __weak posix_fallocate(int fd, off_t offset, off_t len)
+{
+	return 0;
+}