LLDB mainline
windows/PosixApi.h
Go to the documentation of this file.
1//===-- windows/PosixApi.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
9#ifndef liblldb_Host_windows_PosixApi_h
10#define liblldb_Host_windows_PosixApi_h
11
12#include "lldb/Host/Config.h"
13#include "llvm/Support/Compiler.h"
14#if !defined(_WIN32)
15#error "windows/PosixApi.h being #included on non Windows system!"
16#endif
17
18// va_start, va_end, etc macros.
19#include <cstdarg>
20
21// time_t, timespec, etc.
22#include <ctime>
23
24#ifndef PATH_MAX
25#define PATH_MAX 32768
26#endif
27
28#define O_NOCTTY 0
29#define O_NONBLOCK 0
30#define SIGTRAP 5
31#define SIGKILL 9
32#define SIGSTOP 20
33
34#ifndef S_IRUSR
35#define S_IRUSR S_IREAD /* read, user */
36#define S_IWUSR S_IWRITE /* write, user */
37#define S_IXUSR 0 /* execute, user */
38#endif
39#ifndef S_IRGRP
40#define S_IRGRP 0 /* read, group */
41#define S_IWGRP 0 /* write, group */
42#define S_IXGRP 0 /* execute, group */
43#endif
44#ifndef S_IROTH
45#define S_IROTH 0 /* read, others */
46#define S_IWOTH 0 /* write, others */
47#define S_IXOTH 0 /* execute, others */
48#endif
49#ifndef S_IRWXU
50#define S_IRWXU 0
51#endif
52#ifndef S_IRWXG
53#define S_IRWXG 0
54#endif
55#ifndef S_IRWXO
56#define S_IRWXO 0
57#endif
58
59// pyconfig.h typedefs this. We require python headers to be included before
60// any LLDB headers, but there's no way to prevent python's pid_t definition
61// from leaking, so this is the best option.
62#ifndef NO_PID_T
63#include <sys/types.h>
64#endif
65
66#ifdef _MSC_VER
67
68// PRIxxx format macros for printf()
69#include <cinttypes>
70
71// open(), close(), creat(), etc.
72#include <io.h>
73
74typedef unsigned short mode_t;
75
76// pyconfig.h typedefs this. We require python headers to be included before
77// any LLDB headers, but there's no way to prevent python's pid_t definition
78// from leaking, so this is the best option.
79#ifndef NO_PID_T
80typedef uint32_t pid_t;
81#endif
82
83#define STDIN_FILENO 0
84#define STDOUT_FILENO 1
85#define STDERR_FILENO 2
86
87#endif // _MSC_VER
88
89// empty functions
90inline int posix_openpt(int flag) { LLVM_BUILTIN_UNREACHABLE; }
91
92inline int unlockpt(int fd) { LLVM_BUILTIN_UNREACHABLE; }
93inline int grantpt(int fd) { LLVM_BUILTIN_UNREACHABLE; }
94inline char *ptsname(int fd) { LLVM_BUILTIN_UNREACHABLE; }
95
96inline pid_t fork(void) { LLVM_BUILTIN_UNREACHABLE; }
97inline pid_t setsid(void) { LLVM_BUILTIN_UNREACHABLE; }
98
99#endif
char * ptsname(int fd)
int grantpt(int fd)
pid_t setsid(void)
int posix_openpt(int flag)
pid_t fork(void)
int unlockpt(int fd)