[klibc] [PATCH 1/4] include sys/types.h in more places

Greg Thelen gthelen at google.com
Sun Feb 25 23:16:32 PST 2018


Include sys/types.h to avoid compilation warnings:

  In file included from $LINUX/usr/include/linux/byteorder/little_endian.h:12:0,
                   from $LINUX/usr/include/asm/byteorder.h:5,
                   from $KLIBC/usr/klibc/../include/klibc/endian.h:11,
                   from $KLIBC/usr/klibc/../include/endian.h:8,
                   from $KLIBC/usr/klibc/pread.c:7:
  $LINUX/usr/include/linux/types.h:22:0: warning: "__bitwise" redefined

  In file included from $KLIBC/usr/klibc/../include/klibc/endian.h:10:0,
                   from $KLIBC/usr/klibc/../include/endian.h:8,
                   from $KLIBC/usr/klibc/pread.c:7:
  $KLIBC/usr/klibc/../include/klibc/compiler.h:144:0: note: this is the location of the previous definition

  In file included from $LINUX/usr/include/linux/byteorder/little_endian.h:12:0,
                   from $LINUX/usr/include/asm/byteorder.h:5,
                   from $KLIBC/usr/klibc/../include/klibc/endian.h:11,
                   from $KLIBC/usr/klibc/../include/endian.h:8,
                   from $KLIBC/usr/klibc/pwrite.c:7:
  $LINUX/usr/include/linux/types.h:22:0: warning: "__bitwise" redefined

  In file included from $KLIBC/usr/klibc/../include/klibc/endian.h:10:0,
                   from $KLIBC/usr/klibc/../include/endian.h:8,
                   from $KLIBC/usr/klibc/pwrite.c:7:
  $KLIBC/usr/klibc/../include/klibc/compiler.h:144:0: note: this is the location of the previous definition

Signed-off-by: Greg Thelen <gthelen at google.com>
---
 usr/klibc/pread.c  | 1 +
 usr/klibc/pwrite.c | 1 +
 2 files changed, 2 insertions(+)

diff --git a/usr/klibc/pread.c b/usr/klibc/pread.c
index 0d8c3b13f4fc..1ac30756c32d 100644
--- a/usr/klibc/pread.c
+++ b/usr/klibc/pread.c
@@ -4,6 +4,7 @@
  * Some architectures need to wrap the system call
  */
 
+#include <sys/types.h>
 #include <endian.h>
 #include <sys/syscall.h>
 
diff --git a/usr/klibc/pwrite.c b/usr/klibc/pwrite.c
index 691d0e4a1a74..19b219f163fc 100644
--- a/usr/klibc/pwrite.c
+++ b/usr/klibc/pwrite.c
@@ -4,6 +4,7 @@
  * Some architectures need to wrap the system call
  */
 
+#include <sys/types.h>
 #include <endian.h>
 #include <sys/syscall.h>
 
-- 
2.16.1.291.g4437f3f132-goog



More information about the klibc mailing list