blob: 85a3801e3d93658df63170cc4ddb0cce2a5e3fb5 (
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
26
27
28
29
30
31
32
33
34
|
/* libmisc/intercept.c - Interceptable ("weak") functions
*
* Copyright (C) 2024-2025 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]]
int __lm_light_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();
}
|