Include <sys/uio.h> unconditionally

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.
This commit is contained in:
Дмитрий Левин 2014-11-21 20:46:16 +00:00
parent af534b8d7a
commit b2fa2beedc
4 changed files with 3 additions and 17 deletions

View 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],

9
io.c
View File

@ -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)

4
net.c
View File

@ -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

6
util.c
View File

@ -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)