📄 perror.3
字号:
.\" SCCSID: @(#)perror.3 8.2 1/28/91.TH perror 3 .SH Nameperror, strerror, sys_errlist, sys_nerr \- system error messages.SH Syntax.nf.B void perror(\fIs).B char *\fIs;.PP.B int sys_nerr;.B char *sys_errlist[];.PP.B #include <string.h>.PP.B char *strerror(\fIerr).B int \fIerr;.fi.SH Description.NXR "perror subroutine (standard C)".NXR "sys_errlist subroutine".NXR "sys_nerr subroutine".NXR "error message (system)" "getting"The.PN perrorsubroutineproduces a short error message on the standard error filedescribing the last error encountered during a callto the system from a C program.First the argument string.I s ,if it is not a null pointer, is printed followed by a colon and aspace; then the message and a new line are printed.Most usefully, the argument string is the nameof the program which incurred the error.The error number is taken from the external variable.I errnowhich is set when errors occur but not cleared whennonerroneous calls are made.For further information, see .MS intro 2 ..PPTo simplify variantformatting of messages, the vector of message strings.I sys_errlistis provided;.I errnocan be used as an index in this table to get themessage string without the new line. The.I sys_nerris the number of messages provided for in the table;it should be checkedbecause new error codes may be added to the system beforethey are added to the table. The.PN strerrorfunction will also return a pointer to the message text for a givenerror number..SH See Alsointro(2), .MS errno 2 ,psignal(3)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -