+2008-09-14 Bruno Haible <bruno@clisp.org>
+
+ New module 'perror'.
+ * lib/stdio.in.h (perror): New declaration.
+ * lib/perror.c: New file.
+ * m4/perror.m4: New file.
+ * modules/perror: New file.
+ * MODULES.html.sh (Support for systems lacking POSIX:2001): Add perror.
+ * doc/posix-functions/perror.texi: Mention the perror module.
+ * m4/stdio_h.m4 (gl_STDIO_H_DEFAULTS): Initialize GNULIB_PERROR,
+ REPLACE_PERROR.
+ * modules/stdio (Makefile.am): Substitute GNULIB_PERROR,
+ REPLACE_PERROR.
+
2008-09-14 Bruno Haible <bruno@clisp.org>
* modules/stdio (Makefile.am): Reorder to match the order in
func_module mkstemp
func_module netinet_in
func_module open
+ func_module perror
func_module poll
func_module printf-posix
func_module readlink
POSIX specification: @url{http://www.opengroup.org/susv3xsh/perror.html}
-Gnulib module: ---
+Gnulib module: perror
Portability problems fixed by Gnulib:
@itemize
+@item
+This function does not support the error values that are specified by POSIX
+but not defined by the system, on some platforms:
+OpenBSD 4.0, OSF/1 5.1, mingw.
@end itemize
Portability problems not fixed by Gnulib:
getline (l, s, f))
#endif
+#if @GNULIB_PERROR@
+# if @REPLACE_PERROR@
+# define perror rpl_perror
+/* Print a message to standard error, describing the value of ERRNO,
+ (if STRING is not NULL and not empty) prefixed with STRING and ": ",
+ and terminated with a newline. */
+extern void perror (const char *string);
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef perror
+# define perror(s) \
+ (GL_LINK_WARNING ("perror is not always POSIX compliant - " \
+ "use gnulib module perror for portability"), \
+ perror (s))
+#endif
+
#ifdef __cplusplus
}
#endif
GNULIB_FFLUSH=0; AC_SUBST([GNULIB_FFLUSH])
GNULIB_GETDELIM=0; AC_SUBST([GNULIB_GETDELIM])
GNULIB_GETLINE=0; AC_SUBST([GNULIB_GETLINE])
+ GNULIB_PERROR=0; AC_SUBST([GNULIB_PERROR])
dnl Assume proper GNU behavior unless another module says otherwise.
REPLACE_FPRINTF=0; AC_SUBST([REPLACE_FPRINTF])
REPLACE_VFPRINTF=0; AC_SUBST([REPLACE_VFPRINTF])
HAVE_DECL_GETDELIM=1; AC_SUBST([HAVE_DECL_GETDELIM])
HAVE_DECL_GETLINE=1; AC_SUBST([HAVE_DECL_GETLINE])
REPLACE_GETLINE=0; AC_SUBST([REPLACE_GETLINE])
+ REPLACE_PERROR=0; AC_SUBST([REPLACE_PERROR])
])
dnl Code shared by fseeko and ftello. Determine if large files are supported,
-e 's|@''GNULIB_FFLUSH''@|$(GNULIB_FFLUSH)|g' \
-e 's|@''GNULIB_GETDELIM''@|$(GNULIB_GETDELIM)|g' \
-e 's|@''GNULIB_GETLINE''@|$(GNULIB_GETLINE)|g' \
+ -e 's|@''GNULIB_PERROR''@|$(GNULIB_PERROR)|g' \
-e 's|@''REPLACE_FPRINTF''@|$(REPLACE_FPRINTF)|g' \
-e 's|@''REPLACE_VFPRINTF''@|$(REPLACE_VFPRINTF)|g' \
-e 's|@''REPLACE_PRINTF''@|$(REPLACE_PRINTF)|g' \
-e 's|@''HAVE_DECL_GETDELIM''@|$(HAVE_DECL_GETDELIM)|g' \
-e 's|@''HAVE_DECL_GETLINE''@|$(HAVE_DECL_GETLINE)|g' \
-e 's|@''REPLACE_GETLINE''@|$(REPLACE_GETLINE)|g' \
+ -e 's|@''REPLACE_PERROR''@|$(REPLACE_PERROR)|g' \
-e '/definition of GL_LINK_WARNING/r $(LINK_WARNING_H)' \
< $(srcdir)/stdio.in.h; \
} > $@-t