Path: blob/main/contrib/llvm-project/lldb/tools/driver/Platform.cpp
34879 views
//===-- Platform.cpp --------------------------------------------*- C++ -*-===//1//2// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.3// See https://llvm.org/LICENSE.txt for license information.4// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception5//6//===----------------------------------------------------------------------===//78// this file is only relevant for Visual C++9#if defined(_WIN32)1011#include <cassert>12#include <cstdlib>13#include <process.h>1415#include "Platform.h"16#include "llvm/Support/ErrorHandling.h"1718int ioctl(int d, int request, ...) {19switch (request) {20// request the console windows size21case (TIOCGWINSZ): {22va_list vl;23va_start(vl, request);24// locate the window size structure on stack25winsize *ws = va_arg(vl, winsize *);26// get screen buffer information27CONSOLE_SCREEN_BUFFER_INFO info;28if (GetConsoleScreenBufferInfo(GetStdHandle(STD_OUTPUT_HANDLE), &info) ==29TRUE)30// fill in the columns31ws->ws_col = info.dwMaximumWindowSize.X;32va_end(vl);33return 0;34} break;35default:36llvm_unreachable("Not implemented!");37}38}3940int kill(pid_t pid, int sig) {41// is the app trying to kill itself42if (pid == getpid())43exit(sig);44//45llvm_unreachable("Not implemented!");46}4748int tcsetattr(int fd, int optional_actions, const struct termios *termios_p) {49llvm_unreachable("Not implemented!");50}5152int tcgetattr(int fildes, struct termios *termios_p) {53// assert( !"Not implemented!" );54// error return value (0=success)55return -1;56}5758#endif596061