Path: blob/main/contrib/llvm-project/lldb/tools/driver/Platform.h
34879 views
//===-- Platform.h ----------------------------------------------*- 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#ifndef LLDB_TOOLS_DRIVER_PLATFORM_H9#define LLDB_TOOLS_DRIVER_PLATFORM_H1011#if defined(_WIN32)1213#include <io.h>14#if defined(_MSC_VER)15#include <csignal>16#endif1718#include "lldb/Host/windows/windows.h"19#include <cinttypes>20#include <sys/types.h>2122struct winsize {23long ws_col;24};2526typedef unsigned char cc_t;27typedef unsigned int speed_t;28typedef unsigned int tcflag_t;2930// fcntl.h31#define O_NOCTTY 04003233// ioctls.h34#define TIOCGWINSZ 0x54133536// signal.h37#define SIGPIPE 1338#define SIGCONT 1839#define SIGTSTP 2040#define SIGWINCH 284142// tcsetattr arguments43#define TCSANOW 04445#define NCCS 3246struct termios {47tcflag_t c_iflag; // input mode flags48tcflag_t c_oflag; // output mode flags49tcflag_t c_cflag; // control mode flags50tcflag_t c_lflag; // local mode flags51cc_t c_line; // line discipline52cc_t c_cc[NCCS]; // control characters53speed_t c_ispeed; // input speed54speed_t c_ospeed; // output speed55};5657#ifdef _MSC_VER58struct timeval {59long tv_sec;60long tv_usec;61};62typedef long pid_t;63#define PATH_MAX MAX_PATH64#endif6566#define STDIN_FILENO 06768extern int ioctl(int d, int request, ...);69extern int kill(pid_t pid, int sig);70extern int tcsetattr(int fd, int optional_actions,71const struct termios *termios_p);72extern int tcgetattr(int fildes, struct termios *termios_p);7374#else75#include <cinttypes>7677#include <libgen.h>78#include <sys/ioctl.h>79#include <termios.h>80#include <unistd.h>8182#include <pthread.h>83#include <sys/time.h>84#endif8586#endif // LLDB_TOOLS_DRIVER_PLATFORM_H878889