PatchworkOS
Loading...
Searching...
No Matches
perror.c
Go to the documentation of this file.
1#include <errno.h>
2#include <stdio.h>
3#include <string.h>
4
5void perror(const char* s)
6{
7 if ((s != NULL) && (s[0] != '\n'))
8 {
9 fprintf(stderr, "%s", s);
10 }
11
12 fprintf(stderr, " (%s)\n", strerror(errno));
13
14 return;
15}
#define errno
Error number variable.
Definition errno.h:27
#define NULL
Pointer error value.
Definition NULL.h:23
void perror(const char *s)
Definition perror.c:5
FILE * stderr
Definition std_streams.c:18
_PUBLIC int fprintf(FILE *_RESTRICT stream, const char *_RESTRICT format,...)
Definition fprintf.c:5
_PUBLIC char * strerror(int errnum)
Definition strerror.c:6