xfs
[Top] [All Lists]

[PATCH 1/2 V2] xfs_io: include headers for preadv/pwritev

To: Eric Sandeen <sandeen@xxxxxxxxxx>
Subject: [PATCH 1/2 V2] xfs_io: include headers for preadv/pwritev
From: Eric Sandeen <sandeen@xxxxxxxxxxx>
Date: Tue, 09 Oct 2012 22:37:25 -0500
Cc: xfs-oss <xfs@xxxxxxxxxxx>
In-reply-to: <50749EE2.6070408@xxxxxxxxxx>
References: <50749EE2.6070408@xxxxxxxxxx>
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:15.0) Gecko/20120907 Thunderbird/15.0.1
We need to include uio.h to avoid:

    [CC]     pread.o
pread.c: In function ‘do_pread’:
pread.c:198: warning: implicit declaration of function ‘preadv’
    [CC]     pwrite.o
pwrite.c: In function ‘do_pwrite’:
pwrite.c:85: warning: implicit declaration of function ‘pwritev’

Signed-off-by: Eric Sandeen <sandeen@xxxxxxxxxx>
---

V2: Move _BSD_SOURCE to PCFLAGS intead of in source files
per Dave's suggestion.

diff --git a/include/builddefs.in b/include/builddefs.in
index 81ebfcd..04590d2 100644
--- a/include/builddefs.in
+++ b/include/builddefs.in
@@ -106,7 +106,7 @@ GCCFLAGS = -funsigned-char -fno-strict-aliasing -Wall
 #         -Wbitwise -Wno-transparent-union -Wno-old-initializer -Wno-decl
 
 ifeq ($(PKG_PLATFORM),linux)
-PCFLAGS = -D_GNU_SOURCE -D_XOPEN_SOURCE=500 -D_FILE_OFFSET_BITS=64 $(GCCFLAGS)
+PCFLAGS = -D_GNU_SOURCE -D_BSD_SOURCE -D_XOPEN_SOURCE=500 
-D_FILE_OFFSET_BITS=64 $(GCCFLAGS)
 DEPENDFLAGS = -D__linux__
 endif
 ifeq ($(PKG_PLATFORM),gnukfreebsd)
diff --git a/io/pread.c b/io/pread.c
index 0b9454b..7e2ed7d 100644
--- a/io/pread.c
+++ b/io/pread.c
@@ -16,6 +16,7 @@
  * Inc.,  51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  */
 
+#include <sys/uio.h>
 #include <xfs/xfs.h>
 #include <xfs/command.h>
 #include <xfs/input.h>
diff --git a/io/pwrite.c b/io/pwrite.c
index 3689960..73acbac 100644
--- a/io/pwrite.c
+++ b/io/pwrite.c
@@ -16,6 +16,7 @@
  * Inc.,  51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  */
 
+#include <sys/uio.h>
 #include <xfs/xfs.h>
 #include <xfs/command.h>
 #include <xfs/input.h>

<Prev in Thread] Current Thread [Next in Thread>