2018-11-11 15:36:40 +01:00
|
|
|
#include <assert.h>
|
2018-11-11 10:38:33 +01:00
|
|
|
#include <errno.h>
|
|
|
|
#include <termios.h>
|
2018-11-16 15:41:48 +01:00
|
|
|
#include <sys/ioctl.h>
|
2018-11-11 10:38:33 +01:00
|
|
|
#include <Kernel/Syscall.h>
|
|
|
|
|
|
|
|
extern "C" {
|
|
|
|
|
|
|
|
int tcgetattr(int fd, struct termios* t)
|
|
|
|
{
|
2018-11-16 15:41:48 +01:00
|
|
|
return ioctl(fd, TCGETS, t);
|
2018-11-11 10:38:33 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
int tcsetattr(int fd, int optional_actions, const struct termios* t)
|
|
|
|
{
|
2018-11-16 15:41:48 +01:00
|
|
|
switch (optional_actions) {
|
|
|
|
case TCSANOW:
|
|
|
|
return ioctl(fd, TCSETS, t);
|
|
|
|
case TCSADRAIN:
|
|
|
|
return ioctl(fd, TCSETSW, t);
|
|
|
|
case TCSAFLUSH:
|
|
|
|
return ioctl(fd, TCSETSF, t);
|
|
|
|
}
|
2018-11-16 16:10:59 +01:00
|
|
|
errno = EINVAL;
|
|
|
|
return -1;
|
2018-11-11 10:38:33 +01:00
|
|
|
}
|
|
|
|
|
2018-11-11 15:36:40 +01:00
|
|
|
int tcflow(int fd, int action)
|
|
|
|
{
|
|
|
|
(void) fd;
|
|
|
|
(void) action;
|
|
|
|
assert(false);
|
|
|
|
}
|
|
|
|
|
2018-11-11 10:38:33 +01:00
|
|
|
}
|
|
|
|
|