1 /* 2 * Copyright (c) 2021 Nordic Semiconductor ASA 3 * 4 * SPDX-License-Identifier: Apache-2.0 5 */ 6 7 #include <zephyr/kernel.h> 8 #include <stdio.h> 9 _stdout_hook_default(int c)10static int _stdout_hook_default(int c) 11 { 12 (void)(c); /* Prevent warning about unused argument */ 13 14 return EOF; 15 } 16 17 static int (*_stdout_hook)(int) = _stdout_hook_default; 18 __stdout_hook_install(int (* hook)(int))19void __stdout_hook_install(int (*hook)(int)) 20 { 21 _stdout_hook = hook; 22 } 23 __aeabi_errno_addr(void)24volatile int *__aeabi_errno_addr(void) 25 { 26 return &arch_current_thread()->errno_var; 27 } 28 fputc(int c,FILE * f)29int fputc(int c, FILE *f) 30 { 31 return (_stdout_hook)(c); 32 } 33