error_tail (int status, int errnum, const char *message, va_list args)
{
# if HAVE_VPRINTF || _LIBC
-# ifdef _LIBC
+# if _LIBC && USE_IN_LIBIO
if (_IO_fwide (stderr, 0) > 0)
{
# define ALLOCA_LIMIT 2000
#if defined HAVE_STRERROR_R || _LIBC
char errbuf[1024];
char *s = __strerror_r (errnum, errbuf, sizeof errbuf);
-# ifdef _LIBC
+# if _LIBC && USE_IN_LIBIO
if (_IO_fwide (stderr, 0) > 0)
__fwprintf (stderr, L": %s", s);
else
fprintf (stderr, ": %s", strerror (errnum));
#endif
}
-#ifdef _LIBC
+#if _LIBC && USE_IN_LIBIO
if (_IO_fwide (stderr, 0) > 0)
putwc (L'\n', stderr);
else
(*error_print_progname) ();
else
{
-#ifdef _LIBC
+#if _LIBC && USE_IN_LIBIO
if (_IO_fwide (stderr, 0) > 0)
__fwprintf (stderr, L"%s: ", program_name);
else
(*error_print_progname) ();
else
{
-#ifdef _LIBC
+#if _LIBC && USE_IN_LIBIO
if (_IO_fwide (stderr, 0) > 0)
__fwprintf (stderr, L"%s: ", program_name);
else
if (file_name != NULL)
{
-#ifdef _LIBC
+#if _LIBC && USE_IN_LIBIO
if (_IO_fwide (stderr, 0) > 0)
__fwprintf (stderr, L"%s:%d: ", file_name, line_number);
else
void
perror (const char *s)
{
+#ifdef USE_IN_LIBIO
FILE *fp;
int fd = -1;
+
/* The standard says that 'perror' must not change the orientation
of the stream. What is supposed to happen when the stream isn't
oriented yet? In this case we'll create a new stream which is
((_IO_FILE *) stderr)->_offset = _IO_pos_BAD;
}
+#else
+ perror_internal (stderr, s);
+#endif
}