Back to index

glibc  2.9
Defines | Functions | Variables
err.c File Reference
#include <stdarg.h>
#include <err.h>
#include <stdlib.h>
#include <errno.h>
#include <string.h>
#include <stdio.h>

Go to the source code of this file.

Defines

#define VA(call)

Functions

void vwarnx (const char *format, __gnuc_va_list ap)
 libc_hidden_def (vwarnx)
 libc_hidden_def (vwarn)
 libc_hidden_def (warn)
 libc_hidden_def (warnx)
 libc_hidden_def (verr)
 libc_hidden_def (verrx)
void errx (int status, const char *format,...)

Variables

char * __progname

Define Documentation

#define VA (   call)
Value:
{                                                                    \
  va_list ap;                                                        \
  va_start (ap, format);                                             \
  call;                                                                     \
  va_end (ap);                                                              \
}

Definition at line 35 of file err.c.


Function Documentation

void errx ( int  status,
const char *  format,
  ... 
)

Definition at line 185 of file err.c.

{
  VA (verrx (status, format, ap))
}

Here is the call graph for this function:

Definition at line 111 of file err.c.

{
  int error = errno;

  flockfile (stderr);
#ifdef USE_IN_LIBIO
  if (_IO_fwide (stderr, 0) > 0)
    {
      __fwprintf (stderr, L"%s: ", __progname);
      if (format)
       {
         convert_and_print (format, ap);
         fputws_unlocked (L": ", stderr);
       }
      __set_errno (error);
      __fwprintf (stderr, L"%m\n");
    }
  else
#endif
    {
      fprintf (stderr, "%s: ", __progname);
      if (format)
       {
         vfprintf (stderr, format, ap);
         fputs_unlocked (": ", stderr);
       }
      __set_errno (error);
      fprintf (stderr, "%m\n");
    }
  funlockfile (stderr);
}

Here is the call graph for this function:

Definition at line 145 of file err.c.

{
  VA (vwarn (format, ap))
}

Here is the call graph for this function:

Definition at line 153 of file err.c.

{
  VA (vwarnx (format, ap))
}

Here is the call graph for this function:

Definition at line 160 of file err.c.

{
  vwarn (format, ap);
  exit (status);
}

Here is the call graph for this function:

Definition at line 168 of file err.c.

{
  vwarnx (format, ap);
  exit (status);
}

Here is the call graph for this function:

Definition at line 176 of file err.c.

{
  VA (verr (status, format, ap))
}

Here is the call graph for this function:

void vwarnx ( const char *  format,
__gnuc_va_list  ap 
)

Definition at line 91 of file err.c.

{
  flockfile (stderr);
#ifdef USE_IN_LIBIO
  if (_IO_fwide (stderr, 0) > 0)
    {
      __fwprintf (stderr, L"%s: ", __progname);
      convert_and_print (format, ap);
      putwc_unlocked (L'\n', stderr);
    }
  else
#endif
    {
      fprintf (stderr, "%s: ", __progname);
      if (format)
       vfprintf (stderr, format, ap);
      putc_unlocked ('\n', stderr);
    }
  funlockfile (stderr);
}

Here is the call graph for this function:

Here is the caller graph for this function:


Variable Documentation

char* __progname

Definition at line 24 of file init-misc.c.