Flexible I/O Tester development
 help / color / mirror / Atom feed
* Patch to fix FreeBSD support
@ 2010-02-10  6:55 Josh Aune
  2010-02-10  8:29 ` Jens Axboe
  0 siblings, 1 reply; 4+ messages in thread
From: Josh Aune @ 2010-02-10  6:55 UTC (permalink / raw)
  To: fio

[-- Attachment #1: Type: text/plain, Size: 133 bytes --]

Hi,

Attached is a patch against fio-1.36 that fixes a few build issues on
FreeBSD.  Tested with FreeBSD 8 and Linux Fedora 6.

Josh

[-- Attachment #2: fio-1.36__FreeBSD8.patch --]
[-- Type: application/octet-stream, Size: 1367 bytes --]

Index: fio-1.36/helpers.c
===================================================================
--- fio-1.36.orig/helpers.c	2010-02-09 14:37:13.000000000 -0700
+++ fio-1.36/helpers.c	2010-02-09 14:39:57.000000000 -0700
@@ -1,4 +1,6 @@
-#include <malloc.h>
+#ifndef __FreeBSD__
+  #include <malloc.h>
+#endif
 #include <stdlib.h>
 #include <errno.h>
 #include <sys/socket.h>
@@ -6,6 +8,17 @@
 
 #include "compiler/compiler.h"
 
+#ifdef __FreeBSD__
+
+// No fdatasync() in FreeBSD
+#include <unistd.h>
+int __weak fdatasync(int fd)
+{
+	return fsync(fd);
+}
+
+#else /* __FreeBSD__ */
+
 int __weak posix_memalign(void **ptr, size_t align, size_t size)
 {
 	*ptr = memalign(align, size);
@@ -15,6 +28,8 @@
 	return ENOMEM;
 }
 
+#endif
+
 int __weak posix_fallocate(int fd, off_t offset, off_t len)
 {
 	return 0;
Index: fio-1.36/helpers.h
===================================================================
--- fio-1.36.orig/helpers.h	2010-02-09 14:37:13.000000000 -0700
+++ fio-1.36/helpers.h	2010-02-09 14:38:10.000000000 -0700
@@ -3,7 +3,12 @@
 
 struct in_addr;
 
+#ifdef __FreeBSD__
+extern int __weak fdatasync(int fd);
+#else // __FreeBSD__
 extern int __weak posix_memalign(void **ptr, size_t align, size_t size);
+#endif
+
 extern int __weak posix_fallocate(int fd, off_t offset, off_t len);
 extern int __weak inet_aton(const char *cp, struct in_addr *inp);
 

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2010-02-11 10:19 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-02-10  6:55 Patch to fix FreeBSD support Josh Aune
2010-02-10  8:29 ` Jens Axboe
2010-02-11  8:16   ` Josh Aune
2010-02-11 10:19     ` Jens Axboe

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox