1PERROR(3)                  Library Functions Manual                  PERROR(3)
2
3
4

NAME

6       perror, sys_errlist, sys_nerr - system error messages
7

SYNOPSIS

9       perror(s)
10       char *s;
11
12       int sys_nerr;
13       char *sys_errlist[];
14

DESCRIPTION

16       Perror  produces  a  short  error  message  on  the standard error file
17       describing the last error encountered during a call to the system  from
18       a  C  program.   First  the argument string s is printed, then a colon,
19       then the message and a new-line.  Most usefully, the argument string is
20       the  name of the program which incurred the error.  The error number is
21       taken from the external variable errno (see  intro(2)),  which  is  set
22       when errors occur but not cleared when non-erroneous calls are made.
23
24       To  simplify  variant  formatting  of  messages,  the vector of message
25       strings sys_errlist is provided; errno can be used as an index in  this
26       table  to  get the message string without the newline.  Sys_nerr is the
27       number of messages provided for in the  table;  it  should  be  checked
28       because  new  error  codes  may  be added to the system before they are
29       added to the table.
30

SEE ALSO

32       intro(2)
33
34
35
36                                                                     PERROR(3)
Impressum