smol-gilbraltar/nolibc/puts.c
2024-12-23 01:46:17 +01:00

17 lines
368 B
C

#include <string.h>
#include <unistd.h>
extern void gilbraltar_serial_write(const char *, size_t);
int puts(const char *s)
{
size_t len = strlen(s);
gilbraltar_serial_write(s, len);
return (int)(len); // We should never have a string length above MAX_INT, do we?
}
int putchar(int chr)
{
gilbraltar_serial_write((char *) &chr, 1);
return (1);
}