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