FAT | RFS | XFS
perror()
PROTOTYPE
#include <stdio.h>
void perror(const char *s);
DESCRIPTION
perror() writes an error message-the same returned by strerror(errno)-to the open regular file identified by stderr. If s is not NULL, the string it references is written to stderr, followed by “: “, before the error message. A terminating newline character is written last.
The status change and data modification timestamps of stderr are updated.
ERROR CODES
| EBADF | stderr is not the handle of a file open in write or append mode. |
| ENOSPC | The volume is full. |
EXAMPLE
/*-------------------------------------------------------------*/
/* Open directory associated with path. */
/*-------------------------------------------------------------*/
cur_dir = opendir(path);
if (cur_dir == NULL)
perror("opendir() failed");