3 ms·
> The example is still relevant, say if your program has no OS. Not only does it seem unlikely your program would have a terminal output and standard streams w
by masklinn 5y ago
> The example is still relevant, say if your program has no OS.
Not only does it seem unlikely your program would have a terminal output and standard streams without having an OS, bestline still requires a libc. Just open `bestline.c` and you'll find:
#include <termios.h>
#include <unistd.h>
#include <stdlib.h>
#include <stdio.h>
#include <errno.h>
#include <string.h>
#include <stdlib.h>
#include <ctype.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <sys/ioctl.h>
#include <sys/mman.h>
#include <unistd.h>
#include <setjmp.h>
#include <poll.h>
#include <assert.h>
#include <signal.h>
#include <fcntl.h>
#include <limits.h>
- R0b0t1 5y agoYou've never used a microcontroller. They are usually shipped with a partial libc that binds fd 0/1 to a USART. Sometimes POSIX threads can be mapped to FreeRTOS calls. Most of the defines can have a null implementation and the core will still work. They just need to be defined.
- masklinn 5y agoYou’re not making any sense. If the system provides a libc stub then printf and whatever are not concerns, they’ll just go through the stub. And the message I quoted says literally nothing about µc.