-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy patherror_functions.h
34 lines (22 loc) · 1015 Bytes
/
error_functions.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
/* ------------------------------------------------------------------------------
* Listing 3-2: Declarations for common error-handling functions
* p.52, "Linux Progamming Interface"
* --------------------------------------------------------------------------- */
#ifndef ERROR_FUNCTIONS_H
#define ERROR_FUNCTIONS_H /* Prevent accidental double inclusion */
void errMsg(const char *format, ...);
#ifdef __GNUC__
/* This macro stops 'gcc -Wall' complaining that "control reaches
end of non-void function" if we use the following functions to
terminate main() or some other non-void function. */
#define NORETURN __attribute__ ((__noreturn__))
#else
#define NORETURN
#endif
void errExit(const char *format, ...) NORETURN;
void err_exit(const char *format, ...) NORETURN;
void errExitEN(int errnum, const char *format, ...) NORETURN;
void fatal(const char *format, ...) NORETURN;
void usageErr(const char *format, ...) NORETURN;
void cmdLineErr(const char *format, ...) NORETURN;
#endif