41 if ((
self = fopen(
"/proc/self/status",
"r")) != NULL) {
42 while (fgets(line,
sizeof(line),
self)) {
43 if (!strncmp(line,
"Name:", 5)) {
44 strtok_r(line,
"\t\n", &sbuf);
45 p = strtok_r(NULL,
"\t\n", &sbuf);
62 env = getenv(
"PREINIT");
65 if (env && !strcmp(env,
"1"))
74 if (env && !strcmp(env,
"1"))
92 static
void ulog_kmsg(
int priority, const
char *fmt, va_list ap)
96 if ((kmsg = fopen(
"/dev/kmsg",
"r+")) != NULL) {
97 fprintf(kmsg,
"<%u>", priority);
102 vfprintf(kmsg, fmt, ap);
108 static
void ulog_stdio(
int priority, const
char *fmt, va_list ap)
115 vfprintf(out, fmt, ap);
119 static
void ulog_syslog(
int priority, const
char *fmt, va_list ap)
121 vsyslog(priority, fmt, ap);
129 void ulog_open(
int channels,
int facility,
const char *ident)
154 void ulog(
int priority,
const char *fmt, ...)
174 ulog_kmsg(priority, fmt, ap);
181 ulog_stdio(priority, fmt, ap);
188 ulog_syslog(priority, fmt, ap);
FILE(GLOB test_cases "test-*.c") MACRO(ADD_FUZZER_TEST name) ADD_EXECUTABLE($
void udebug_entry_add(struct udebug_buf *buf)
int udebug_entry_vprintf(struct udebug_buf *buf, const char *fmt, va_list ap)
static void udebug_entry_init(struct udebug_buf *buf)
static const char * ulog_default_ident(void)
static int _ulog_initialized
static int _ulog_facility
static struct udebug_buf * udb
static int _ulog_threshold
static int _ulog_channels
static void ulog_defaults(void)
void ulog_open(int channels, int facility, const char *ident)
void ulog_threshold(int threshold)
__attribute__((format(printf, 2, 0)))
static const char * _ulog_ident
void ulog(int priority, const char *fmt,...)
void ulog_udebug(struct udebug_buf *_udb)