1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 04:28:13 +00:00
serenity/LibC/termios.cpp
2018-11-16 15:41:48 +01:00

34 lines
580 B
C++

#include <assert.h>
#include <errno.h>
#include <termios.h>
#include <sys/ioctl.h>
#include <Kernel/Syscall.h>
extern "C" {
int tcgetattr(int fd, struct termios* t)
{
return ioctl(fd, TCGETS, t);
}
int tcsetattr(int fd, int optional_actions, const struct termios* t)
{
switch (optional_actions) {
case TCSANOW:
return ioctl(fd, TCSETS, t);
case TCSADRAIN:
return ioctl(fd, TCSETSW, t);
case TCSAFLUSH:
return ioctl(fd, TCSETSF, t);
}
}
int tcflow(int fd, int action)
{
(void) fd;
(void) action;
assert(false);
}
}