16 using namespace Linux;
20 _fd =
open(path, O_RDONLY|O_NOCTTY|O_NONBLOCK|O_NDELAY|O_CLOEXEC);
34 struct termios options;
36 tcgetattr(
_fd, &options);
38 cfsetispeed(&options, B115200);
39 cfsetospeed(&options, B115200);
41 options.c_cflag &= ~(PARENB|CSTOPB|CSIZE);
42 options.c_cflag |= CS8;
44 options.c_lflag &= ~(ICANON|ECHO|ECHOE|ISIG);
45 options.c_iflag &= ~(IXON|IXOFF|IXANY);
46 options.c_oflag &= ~OPOST;
48 if (tcsetattr(
_fd, TCSANOW, &options) != 0) {
53 tcflush(
_fd, TCIOFLUSH);
75 uint16_t magic =
MAGIC;
int open(const char *pathname, int flags)
POSIX Open a file with integer mode flags.
char * strerror(int errnum)
POSIX strerror() - convert POSIX errno to text with user message.
int close(int fileno)
POSIX Close a file with fileno handel.
int errno
Note: fdevopen assigns stdin,stdout,stderr.
void panic(const char *errormsg,...) FMT_PRINTF(1