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
5
void
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
}
errno.h
errno
#define errno
Error number variable.
Definition
errno.h:27
NULL
#define NULL
Pointer error value.
Definition
NULL.h:23
perror
void perror(const char *s)
Definition
perror.c:5
stdio.h
stderr
FILE * stderr
Definition
std_streams.c:18
fprintf
_PUBLIC int fprintf(FILE *_RESTRICT stream, const char *_RESTRICT format,...)
Definition
fprintf.c:5
string.h
strerror
_PUBLIC char * strerror(int errnum)
Definition
strerror.c:6
src
libstd
user
functions
stdio
perror.c
Generated by
1.9.8