aboutsummaryrefslogtreecommitdiff
path: root/sys/sys/uio.h
diff options
context:
space:
mode:
authorPoul-Henning Kamp <phk@FreeBSD.org>2002-12-28 22:17:29 +0000
committerPoul-Henning Kamp <phk@FreeBSD.org>2002-12-28 22:17:29 +0000
commit5c648baca8186df6100ae1386605cd0963ed4e89 (patch)
tree72ebb1dbe30a70efcd5d6a884f0679fcac0125cd /sys/sys/uio.h
parentf53c6e5c9ab05c77929221c3880b5e3a1df635b9 (diff)
downloadsrc-5c648baca8186df6100ae1386605cd0963ed4e89.tar.gz
src-5c648baca8186df6100ae1386605cd0963ed4e89.zip
It is bad style to define the same structure in multiple header
files which might be included together. Things like debuggers and lint-like programs get their knickers in a twist (rightly so one might add) when they find different locations for the same named struct depending on which .h file were included first. This is a stellar example of Very Bad Thinking on the part of the standards dudes who wrote that both sys/uio.h and sys/socket.h should define struct iovec the same way. Fix this by putting struct iovec into its own miniature sys/_iovec.h file and #include that from sys/socket.h and sys/uio.h. Sensible people could just put iovec into sys/_types.h but there is probably some standard or other which will be violated if we did something that horrible.
Notes
Notes: svn path=/head/; revision=108366
Diffstat (limited to 'sys/sys/uio.h')
-rw-r--r--sys/sys/uio.h9
1 files changed, 1 insertions, 8 deletions
diff --git a/sys/sys/uio.h b/sys/sys/uio.h
index 8e4fd6f6a52c..e180356d87a7 100644
--- a/sys/sys/uio.h
+++ b/sys/sys/uio.h
@@ -39,6 +39,7 @@
#include <sys/cdefs.h>
#include <sys/_types.h>
+#include <sys/_iovec.h>
#ifndef _SIZE_T_DECLARED
typedef __size_t size_t;
@@ -50,14 +51,6 @@ typedef __ssize_t ssize_t;
#define _SSIZE_T_DECLARED
#endif
-#ifndef _STRUCT_IOVEC_DECLARED
-#define _STRUCT_IOVEC_DECLARED
-struct iovec {
- void *iov_base; /* Base address. */
- size_t iov_len; /* Length. */
-};
-#endif
-
#if __BSD_VISIBLE
enum uio_rw { UIO_READ, UIO_WRITE };