Sun Microsystems, Inc.
spacerspacer
spacer   www.sun.com docs.sun.com | | |  
spacer
black dot
   
A   B   C   D   E   F   G   H   I   J   K   L   M   N   O   P   Q   R   S   T   U   V   W   X   Y   Z
    
 
Standard C Library Functionsperror(3C)


NAME

 perror, errno - print system error messages

SYNOPSIS

 
#include <stdio.h>
void perror(const char *s,
#include <errno.h>
int errno;

DESCRIPTION

 

The perror() function produces a message on the standard error output (file descriptor 2) describing the last error encountered during a call to a system or library function. The argument string s is printed, followed by a colon and a blank, followed by the message and a NEWLINE character. If s is a null pointer or points to a null string, the colon is not printed. The argument string should include the name of the program that incurred the error. The error number is taken from the external variable errno, which is set when errors occur but not cleared when non-erroneous calls are made. See intro(2).

USAGE

 

If the application is linked with -lintl, then messages printed from this function are in the native language specified by the LC_MESSAGES locale category. See setlocale(3C).

ATTRIBUTES

 

See attributes(5) for descriptions of the following attributes:

ATTRIBUTE TYPEATTRIBUTE VALUE
MT-LevelMT-Safe

SEE ALSO

 

intro(2), fmtmsg(3C), gettext(3C), setlocale(3C), strerror(3C), attributes(5)


SunOS 5.9Go To TopLast Changed 29 Dec 1996

 
      
      
Copyright 2002 Sun Microsystems, Inc. All rights reserved. Use is subject to license terms.