]> granicus.if.org Git - strace/commitdiff
Include <sys/uio.h> unconditionally
authorDmitry V. Levin <ldv@altlinux.org>
Fri, 21 Nov 2014 20:46:16 +0000 (20:46 +0000)
committerDmitry V. Levin <ldv@altlinux.org>
Fri, 21 Nov 2014 20:46:16 +0000 (20:46 +0000)
Since <sys/uio.h> is standardized by POSIX and is present in all
available versions of glibc, it's safe to assume that any usable
libc implementation provides this header file.

* configure.ac (AC_CHECK_HEADERS): Remove sys/uio.h.
* io.c: Include <sys/uio.h> unconditionally.
(tprint_iov_upto, tprint_iov, sys_readv, sys_writev,
print_llu_from_low_high_val, sys_preadv, sys_pwritev): Define
unconditionally.
* net.c: Include <sys/uio.h> unconditionally.
* util.c: Include <sys/uio.h> unconditionally.
(dumpiov): Define unconditionally.

configure.ac
io.c
net.c
util.c

index f55af46f7e3868f9692f536e0cc6ede2ea2aea81..f9b056d51da6c91ec1fa9f13a7e790a818f006de 100644 (file)
@@ -250,7 +250,6 @@ AC_CHECK_HEADERS(m4_normalize([
        sys/poll.h
        sys/ptrace.h
        sys/reg.h
-       sys/uio.h
        sys/vfs.h
 ]))
 AC_CHECK_HEADERS([linux/icmp.h linux/in6.h linux/netlink.h linux/if_packet.h],
diff --git a/io.c b/io.c
index 7238a8fabb548c95e0c29b12cf71436c2afa19bc..87bdbba8c842cf2c0a266612dfcb71011d69ccd4 100644 (file)
--- a/io.c
+++ b/io.c
@@ -30,9 +30,7 @@
 
 #include "defs.h"
 #include <fcntl.h>
-#if HAVE_SYS_UIO_H
-# include <sys/uio.h>
-#endif
+#include <sys/uio.h>
 
 int
 sys_read(struct tcb *tcp)
@@ -62,7 +60,6 @@ sys_write(struct tcb *tcp)
        return 0;
 }
 
-#if HAVE_SYS_UIO_H
 /*
  * data_size limits the cumulative size of printed data.
  * Example: recvmsg returing a short read.
@@ -174,7 +171,6 @@ sys_writev(struct tcb *tcp)
        }
        return 0;
 }
-#endif
 
 /* The SH4 ABI does allow long longs in odd-numbered registers, but
    does not allow them to be split between registers and memory - and
@@ -217,8 +213,6 @@ sys_pwrite(struct tcb *tcp)
        return 0;
 }
 
-#if HAVE_SYS_UIO_H
-
 static void
 print_llu_from_low_high_val(struct tcb *tcp, int arg)
 {
@@ -268,7 +262,6 @@ sys_pwritev(struct tcb *tcp)
        }
        return 0;
 }
-#endif /* HAVE_SYS_UIO_H */
 
 static void
 print_off_t(struct tcb *tcp, long addr)
diff --git a/net.c b/net.c
index f3f102e402e1f7c1e9cda474425abe8975595e5c..3bf0a9b4ebc359e13329f7fe7ef780aa246a77c9 100644 (file)
--- a/net.c
+++ b/net.c
@@ -31,6 +31,7 @@
 #include "defs.h"
 #include <sys/stat.h>
 #include <sys/socket.h>
+#include <sys/uio.h>
 #include <sys/un.h>
 #if defined(HAVE_SIN6_SCOPE_ID_LINUX)
 # define in6_addr in6_addr_libc
@@ -78,9 +79,6 @@
 # endif
 #endif
 
-#if defined(HAVE_SYS_UIO_H)
-# include <sys/uio.h>
-#endif
 #if defined(HAVE_LINUX_NETLINK_H)
 # include <linux/netlink.h>
 #endif
diff --git a/util.c b/util.c
index b13f3dc61e3f1476de89a4455e96c696f9209873..e05efcd80cbc16f4add6e3c636a0986cbddf76ef 100644 (file)
--- a/util.c
+++ b/util.c
@@ -35,9 +35,7 @@
 #include <sys/user.h>
 #include <sys/param.h>
 #include <fcntl.h>
-#if HAVE_SYS_UIO_H
-# include <sys/uio.h>
-#endif
+#include <sys/uio.h>
 
 #if defined(IA64)
 # include <asm/ptrace_offsets.h>
@@ -699,7 +697,6 @@ printstr(struct tcb *tcp, long addr, long len)
                tprints("...");
 }
 
-#if HAVE_SYS_UIO_H
 void
 dumpiov(struct tcb *tcp, int len, long addr)
 {
@@ -747,7 +744,6 @@ dumpiov(struct tcb *tcp, int len, long addr)
 #undef iov_iov_len
 #undef iov
 }
-#endif
 
 void
 dumpstr(struct tcb *tcp, long addr, int len)