01.01.2013 Views

AT&T UNIX™PC Unix System V Users Manual - tenox

AT&T UNIX™PC Unix System V Users Manual - tenox

AT&T UNIX™PC Unix System V Users Manual - tenox

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

PERROR (3C) PERROR (3C)<br />

NAME<br />

perror, errno, sys_errlist, sys_nerr - system error messages<br />

SYNOPSIS<br />

void perror (s)<br />

char •s;<br />

extern int errno;<br />

extern char •sys_errlist[ ];<br />

extern in t sys_nerr;<br />

DESCRIPTION<br />

Perror produces a message on the standard error output, describing<br />

the last error encountered during a call to a system or library<br />

function. The argument string s is printed first, then a colon and<br />

a blank, then the message and a new-line. To be of most use, the<br />

argument string should include the name of the program that<br />

incurred the error. The error number is taken from the external<br />

variable errno, which is set when errors occur but not cleared<br />

when non-erroneous calls are made.<br />

To simplify variant formatting of messages, the array of message<br />

strings sys_errlist is provided; errno can be used as an index in<br />

this table to get the message string without the new-line.<br />

Sys_nerr is the largest message number provided for in the table;<br />

it should be checked because new error codes may be added to the<br />

system before they are added to the table.<br />

SEE ALSO<br />

intro(2).<br />

- 1 -

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!