|
|
1.1 root 1: .\" Copyright (c) 1980 Regents of the University of California.
2: .\" All rights reserved. The Berkeley software License Agreement
3: .\" specifies the terms and conditions for redistribution.
4: .\"
5: .\" @(#)perror.3 6.2 (Berkeley) 9/10/87
6: .\"
7: .TH PERROR 3 "September 10, 1987"
8: .UC 4
9: .SH NAME
10: perror, sys_errlist, sys_nerr \- system error messages
11: .SH SYNOPSIS
12: .nf
13: .B perror(string)
14: .B char *string;
15: .PP
16: .B int sys_nerr;
17: .B char *sys_errlist[];
18: .fi
19: .SH DESCRIPTION
20: .I Perror
21: produces a short error message on the standard error file
22: describing the last error encountered during a call
23: to the system from a C program. If \fIstring\fP is non-NULL,
24: it is printed, followed by a colon, followed by a space,
25: followed by the message and a new-line. Otherwise, just the
26: message and the new-line are printed. Most usefully, the argument
27: string is the name of the program which incurred the error.
28: The error number is taken from the external variable
29: .I errno
30: (see
31: .IR intro (2)),
32: which is set when errors occur but not cleared when
33: non-erroneous calls are made.
34: .PP
35: To simplify variant formatting of messages, the vector of message strings
36: .I sys_errlist
37: is provided;
38: .I errno
39: can be used as an index in this table to get the
40: message string without the newline.
41: .I Sys_nerr
42: is the number of messages provided for in the table;
43: it should be checked because new error codes may be added to the system before
44: they are added to the table.
45: .SH "SEE ALSO"
46: intro(2),
47: psignal(3)
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.