#include "weak_under_alias.h" #include #include extern ssize_t _bsp_write(int, const void*, size_t); int __wrap_puts(const char* s) { if(!s) return -1; const char* str = s; while(*str) ++str; if (_bsp_write(STDOUT_FILENO, s, str - s) != str - s) return -1; return _bsp_write(STDOUT_FILENO, "\n", 1) == 1 ? 0 : -1; } weak_under_alias(puts);