ladybird/LibC/termios.cpp
Andreas Kling cccc8d8aeb More compat work.
Move syscall to int 0x82 since using int 0x80 was kinda prone to fork bombs
when building things on Linux. :^)
2019-02-26 12:57:02 +01:00

48 lines
786 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);
}
errno = EINVAL;
return -1;
}
int tcflow(int fd, int action)
{
(void) fd;
(void) action;
assert(false);
}
int tcflush(int fd, int queue_selector)
{
(void)fd;
(void)queue_selector;
assert(false);
}
speed_t cfgetospeed(const struct termios*)
{
assert(false);
}
}