18 #ifndef _BOILERPLATE_ANCILLARIES_H 19 #define _BOILERPLATE_ANCILLARIES_H 29 #define ONE_BILLION 1000000000 31 void __namecpy_requires_character_array_as_destination(
void);
33 #define namecpy(__dst, __src) \ 35 if (!__builtin_types_compatible_p(typeof(__dst), char[])) \ 36 __namecpy_requires_character_array_as_destination(); \ 37 strncpy((__dst), __src, sizeof(__dst)); \ 38 __dst[sizeof(__dst) - 1] = '\0'; \ 42 #define early_panic(__fmt, __args...) \ 43 __early_panic(__func__, __fmt, ##__args) 45 #define panic(__fmt, __args...) \ 46 __panic(__func__, __fmt, ##__args) 52 void __printout(
const char *name,
54 const char *fmt, va_list ap);
56 void __noreturn __early_panic(
const char *fn,
57 const char *fmt, ...);
59 void __noreturn ___panic(
const char *fn,
61 const char *fmt, va_list ap);
63 void __noreturn __panic(
const char *fn,
64 const char *fmt, ...);
66 void __warning(
const char *name,
67 const char *fmt, va_list ap);
69 void early_warning(
const char *fmt, ...);
71 void warning(
const char *fmt, ...);
73 void __notice(
const char *name,
74 const char *fmt, va_list ap);
76 void early_notice(
const char *fmt, ...);
78 void notice(
const char *fmt, ...);
80 void __boilerplate_init(
void);
82 const char *symerror(
int errnum);
84 void error_hook(
struct error_frame *ef);
86 int get_static_cpu_count(
void);
88 int get_online_cpu_set(cpu_set_t *cpuset);
90 int get_realtime_cpu_set(cpu_set_t *cpuset);
92 int get_current_cpu(
void);
94 pid_t get_thread_pid(
void);
96 char *lookup_command(
const char *cmd);
98 size_t get_mem_size(
const char *arg);
100 extern const char *config_strings[];
102 extern pthread_mutex_t __printlock;