Back to index

glibc  2.9
strerror.c File Reference
#include <libintl.h>
#include <stdio.h>
#include <string.h>
#include <errno.h>

Go to the source code of this file.


 libc_freeres_ptr (static char *buf)
char * strerror (int errnum)

Function Documentation

libc_freeres_ptr ( static char *  buf)
char* strerror ( int  errnum)

Definition at line 30 of file strerror.c.

  char *ret = __strerror_r (errnum, NULL, 0);
  int saved_errno;

  if (__builtin_expect (ret != NULL, 1))
    return ret;
  saved_errno = errno;
  if (buf == NULL)
    buf = malloc (1024);
  __set_errno (saved_errno);
  if (buf == NULL)
    return _("Unknown error");
  return __strerror_r (errnum, buf, 1024);

Here is the caller graph for this function: