summaryrefslogtreecommitdiff
path: root/lib/sys_uio.in.h
diff options
context:
space:
mode:
authorEric Blake <eblake@redhat.com>2011-04-21 08:51:12 -0600
committerEric Blake <eblake@redhat.com>2011-04-21 10:43:09 -0600
commit753425d56eedab92c361cae9d6baa701d893fbc9 (patch)
treed7934c92274da17e85477212387ef07cb7e50be1 /lib/sys_uio.in.h
parent67ce653056298965788199437efe1e0f6c06eec5 (diff)
downloadgnulib-753425d56eedab92c361cae9d6baa701d893fbc9.tar.gz
sys_uio: new module
For now, just provide the types used by sys/socket. We could add readv() and writev() later, if desired. * modules/sys_uio: New module. * modules/sys_uio-tests: Likewise. * lib/sys_uio.in.h: New file. * m4/sys_uio_h.m4: Likewise. * tests/test-sys_uio.c: Likewise. * doc/posix-headers/sys_uio.texi (sys/uio.h): Document it. * MODULES.html.sh (systems lacking POSIX:2008): Likewise. Signed-off-by: Eric Blake <eblake@redhat.com>
Diffstat (limited to 'lib/sys_uio.in.h')
-rw-r--r--lib/sys_uio.in.h49
1 files changed, 49 insertions, 0 deletions
diff --git a/lib/sys_uio.in.h b/lib/sys_uio.in.h
new file mode 100644
index 0000000000..175ee0fb6d
--- /dev/null
+++ b/lib/sys_uio.in.h
@@ -0,0 +1,49 @@
+/* Substitute for <sys/uio.h>.
+ Copyright (C) 2011 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2, or (at your option)
+ any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software Foundation,
+ Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
+
+# if __GNUC__ >= 3
+@PRAGMA_SYSTEM_HEADER@
+# endif
+@PRAGMA_COLUMNS@
+
+#ifndef _GL_SYS_UIO_H
+
+#if @HAVE_SYS_UIO_H@
+
+/* The include_next requires a split double-inclusion guard. */
+# @INCLUDE_NEXT@ @NEXT_SYS_UIO_H@
+
+#endif
+
+#ifndef _GL_SYS_UIO_H
+#define _GL_SYS_UIO_H
+
+#if !@HAVE_SYS_UIO_H@
+/* A platform that lacks <sys/uio.h>. */
+/* Get 'ssize_t'. */
+# include <sys/types.h>
+
+/* All known platforms that lack <sys/uio.h> also lack any declaration
+ of struct iovec in any other header. */
+struct iovec {
+ void *iov_base;
+ size_t iov_len;
+};
+#endif
+
+#endif /* _GL_SYS_UIO_H */
+#endif /* _GL_SYS_UIO_H */