#if defined(_WIN32)
#include <cassert>
#include <cstdlib>
#include <process.h>
#include "Platform.h"
#include "llvm/Support/ErrorHandling.h"
int ioctl(int d, int request, ...) {
switch (request) {
case (TIOCGWINSZ): {
va_list vl;
va_start(vl, request);
winsize *ws = va_arg(vl, winsize *);
CONSOLE_SCREEN_BUFFER_INFO info;
if (GetConsoleScreenBufferInfo(GetStdHandle(STD_OUTPUT_HANDLE), &info) ==
TRUE)
ws->ws_col = info.dwMaximumWindowSize.X;
va_end(vl);
return 0;
} break;
default:
llvm_unreachable("Not implemented!");
}
}
int kill(pid_t pid, int sig) {
if (pid == getpid())
exit(sig);
llvm_unreachable("Not implemented!");
}
int tcsetattr(int fd, int optional_actions, const struct termios *termios_p) {
llvm_unreachable("Not implemented!");
}
int tcgetattr(int fildes, struct termios *termios_p) {
return -1;
}
#endif