* modules/pipe-posix: New file.
* m4/unistd_h.m4 (gl_UNISTD_H_DEFAULTS): Set default.
(gl_UNISTD_H): Check for declaration.
* modules/unistd (Makefile.am): Substitute it.
* lib/unistd.in.h (pipe): Provide it for mingw.
* doc/posix-functions/pipe.texi (pipe): Update documentation.
* MODULES.html.sh (File descriptor based Input/Output): Likewise.
Signed-off-by: Eric Blake <eblake@redhat.com>
+2010-12-10 Eric Blake <eblake@redhat.com>
+
+ pipe-posix: new module
+ * modules/pipe-posix: New file.
+ * m4/unistd_h.m4 (gl_UNISTD_H_DEFAULTS): Set default.
+ (gl_UNISTD_H): Check for declaration.
+ * modules/unistd (Makefile.am): Substitute it.
+ * lib/unistd.in.h (pipe): Provide it for mingw.
+ * doc/posix-functions/pipe.texi (pipe): Update documentation.
+ * MODULES.html.sh (File descriptor based Input/Output): Likewise.
+
2010-12-07 Bruno Haible <bruno@clisp.org>
unistr/u8-strcmp: Avoid collision with libc function on Solaris 11.
func_module full-write
func_module binary-io
func_module isapipe
+ func_module pipe-posix
func_module pipe2
func_module pipe2-safer
func_end_table
POSIX specification:@* @url{http://www.opengroup.org/onlinepubs/9699919799/functions/pipe.html}
-Gnulib module: ---
+Gnulib module: pipe-posix
Portability problems fixed by Gnulib:
@itemize
+@item
+This function is missing on some platforms:
+mingw.
@end itemize
Portability problems not fixed by Gnulib:
@itemize
-@item
-This function is missing on some platforms:
-mingw.
@end itemize
# include <stdlib.h>
#endif
-/* mingw declares getcwd in <io.h>, not in <unistd.h>. */
-#if ((@GNULIB_GETCWD@ || defined GNULIB_POSIXCHECK) \
+/* mingw declares getcwd in <io.h>, not in <unistd.h>. It also provides
+ _pipe in <io.h>, but that requires _O_BINARY from <fcntl.h>. */
+#if ((@GNULIB_GETCWD@ || @GNULIB_PIPE@ || defined GNULIB_POSIXCHECK) \
&& ((defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__))
# include <io.h>
+# if @GNULIB_PIPE@
+# include <fcntl.h>
+# endif
#endif
/* AIX and OSF/1 5.1 declare getdomainname in <netdb.h>, not in <unistd.h>. */
#endif
+#if @GNULIB_PIPE@
+/* Create a pipe, defaulting to O_BINARY mode.
+ Store the read-end as fd[0] and the write-end as fd[1].
+ Return 0 upon success, or -1 with errno set upon failure. */
+# if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
+# define pipe(fd) _pipe (fd, 4096, _O_BINARY)
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef pipe
+# if HAVE_RAW_DECL_PIPE
+_GL_WARN_ON_USE (pipe, "pipe is unportable - "
+ "use gnulib module pipe for portability");
+# endif
+#endif
+
+
#if @GNULIB_PIPE2@
/* Create a pipe, applying the given flags when opening the read-end of the
pipe and the write-end of the pipe.
]], [chown dup2 dup3 environ euidaccess faccessat fchdir fchownat
fsync ftruncate getcwd getdomainname getdtablesize getgroups
gethostname getlogin getlogin_r getpagesize getusershell setusershell
- endusershell lchown link linkat lseek pipe2 pread pwrite readlink
+ endusershell lchown link linkat lseek pipe pipe2 pread pwrite readlink
readlinkat rmdir sleep symlink symlinkat ttyname_r unlink unlinkat
usleep])
])
GNULIB_LINK=0; AC_SUBST([GNULIB_LINK])
GNULIB_LINKAT=0; AC_SUBST([GNULIB_LINKAT])
GNULIB_LSEEK=0; AC_SUBST([GNULIB_LSEEK])
+ GNULIB_PIPE=0; AC_SUBST([GNULIB_PIPE])
GNULIB_PIPE2=0; AC_SUBST([GNULIB_PIPE2])
GNULIB_PREAD=0; AC_SUBST([GNULIB_PREAD])
GNULIB_PWRITE=0; AC_SUBST([GNULIB_PWRITE])
--- /dev/null
+Description:
+Creation of a pipe.
+
+Files:
+
+Depends-on:
+unistd
+
+configure.ac:
+AC_REQUIRE([gl_UNISTD_H_DEFAULTS])
+gl_UNISTD_MODULE_INDICATOR([pipe])
+
+Makefile.am:
+
+Include:
+<unistd.h>
+
+License:
+LGPLv2+
+
+Maintainer:
+Eric Blake
-e 's|@''GNULIB_LINK''@|$(GNULIB_LINK)|g' \
-e 's|@''GNULIB_LINKAT''@|$(GNULIB_LINKAT)|g' \
-e 's|@''GNULIB_LSEEK''@|$(GNULIB_LSEEK)|g' \
+ -e 's|@''GNULIB_PIPE''@|$(GNULIB_PIPE)|g' \
-e 's|@''GNULIB_PIPE2''@|$(GNULIB_PIPE2)|g' \
-e 's|@''GNULIB_PREAD''@|$(GNULIB_PREAD)|g' \
-e 's|@''GNULIB_PWRITE''@|$(GNULIB_PWRITE)|g' \