]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - contrib/llvm/tools/lldb/tools/lldb-mi/Platform.h
MFV: r339981
[FreeBSD/FreeBSD.git] / contrib / llvm / tools / lldb / tools / lldb-mi / Platform.h
1 //===-- Platform.h ----------------------------------------------*- C++ -*-===//
2 //
3 //                     The LLVM Compiler Infrastructure
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9 #pragma once
10
11 #if defined(_MSC_VER)
12
13 #include <inttypes.h>
14 #include <io.h>
15 #include <signal.h>
16
17 #include "lldb/Host/HostGetOpt.h"
18 #include "lldb/Host/windows/windows.h"
19
20 struct winsize {
21   long ws_col;
22 };
23
24 typedef unsigned char cc_t;
25 typedef unsigned int speed_t;
26 typedef unsigned int tcflag_t;
27
28 // fcntl.h // This is not used by MI
29 #define O_NOCTTY 0400
30
31 // ioctls.h
32 #define TIOCGWINSZ 0x5413
33
34 // tcsetattr arguments
35 #define TCSANOW 0
36
37 #define NCCS 32
38 struct termios {
39   tcflag_t c_iflag; // input mode flags
40   tcflag_t c_oflag; // output mode flags
41   tcflag_t c_cflag; // control mode flags
42   tcflag_t c_lflag; // local mode flags
43   cc_t c_line;      // line discipline
44   cc_t c_cc[NCCS];  // control characters
45   speed_t c_ispeed; // input speed
46   speed_t c_ospeed; // output speed
47 };
48
49 typedef long pid_t;
50
51 #define STDIN_FILENO 0
52 #define PATH_MAX 32768
53 #define snprintf _snprintf
54
55 extern int ioctl(int d, int request, ...);
56 extern int kill(pid_t pid, int sig);
57 extern int tcsetattr(int fd, int optional_actions,
58                      const struct termios *termios_p);
59 extern int tcgetattr(int fildes, struct termios *termios_p);
60
61 // signal handler function pointer type
62 typedef void (*sighandler_t)(int);
63
64 // CODETAG_IOR_SIGNALS
65 // signal.h
66 #define SIGQUIT 3   // Terminal quit signal
67 #define SIGKILL 9   // Kill (cannot be caught or ignored)
68 #define SIGPIPE 13  // Write on a pipe with no one to read it
69 #define SIGCONT 18  // Continue executing, if stopped.
70 #define SIGTSTP 20  // Terminal stop signal
71 #define SIGSTOP 23  // Stop executing (cannot be caught or ignored)
72 #define SIGWINCH 28 // (== SIGVTALRM)
73
74 #else
75
76 #include <inttypes.h>
77 #include <limits.h>
78
79 #include <getopt.h>
80 #include <libgen.h>
81 #include <sys/ioctl.h>
82 #include <termios.h>
83 #include <unistd.h>
84
85 #include <pthread.h>
86 #include <sys/time.h>
87
88 #endif