Alternate Entry Name: __PERR
B: .perror(s);
C: void __perror(const char *s); /* TWO leading underscores */
.PERROR prints out an error message based on the current value of the external variable ERRNO. It calls the function .STRERROR to obtain the text of the appropriate error message. The message obtained will be the message most recently posted by .EPOST, provided that the current value of ERRNO matches the error number specified when the message was posted; otherwise, .PERROR prints out the default message associated with the current value of ERRNO.
Note that there is a similar function PERROR which calls STRERROR instead of .STRERROR. In general, you should use .PERROR instead of PERROR, because the value of ERRNO doesn't already reflect the error that caused the posted message. For example, if the user presses BREAK between the time the error message is posted and the time you call PERROR, ERRNO changes to reflect the user interrupt rather than the original error. If you use .PERROR instead of PERROR, you get the posted message describing the original error.
Copyright © 1996, Thinkage Ltd.