blob: dda8c09e687e814d5c3fb3873adb92bb41031eae (
plain)
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
|
/* libmisc/intercept.c - Interceptable ("weak") functions
*
* Copyright (C) 2024 Luke T. Shumaker <lukeshu@lukeshu.com>
* SPDX-License-Identifier: AGPL-3.0-or-later
*/
#include <stdarg.h> /* for va_list, va_start(), va_end() */
#include <stdio.h> /* for vprintf() */
#include <stdlib.h> /* for abort() */
#include <libmisc/_intercept.h>
[[gnu::weak]]
int __lm_printf(const char *format, ...) {
va_list va;
va_start(va, format);
int ret = vprintf(format, va);
va_end(va);
return ret;
}
[[gnu::weak]]
void __lm_abort(void) {
abort();
}
|