1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
#include <termios.h> #include "_termios.h" int tcgetattr(int fildes, struct termios *termios_p) { int ret = -1; struct kernel_termios kt; utok(kt, *termios_p); ret = ioctl(fildes, TCGETS, &kt); ktou(*termios_p, kt); return ret; } /* POSIX(1) */