Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-05-10 08:42:48

0001 //===-- windows/PosixApi.h --------------------------------------*- C++ -*-===//
0002 //
0003 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
0004 // See https://llvm.org/LICENSE.txt for license information.
0005 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
0006 //
0007 //===----------------------------------------------------------------------===//
0008 
0009 #ifndef liblldb_Host_windows_PosixApi_h
0010 #define liblldb_Host_windows_PosixApi_h
0011 
0012 #include "lldb/Host/Config.h"
0013 #include "llvm/Support/Compiler.h"
0014 #if !defined(_WIN32)
0015 #error "windows/PosixApi.h being #included on non Windows system!"
0016 #endif
0017 
0018 // va_start, va_end, etc macros.
0019 #include <cstdarg>
0020 
0021 // time_t, timespec, etc.
0022 #include <ctime>
0023 
0024 #ifndef PATH_MAX
0025 #define PATH_MAX 32768
0026 #endif
0027 
0028 #define O_NOCTTY 0
0029 #define O_NONBLOCK 0
0030 #define SIGTRAP 5
0031 #define SIGKILL 9
0032 #define SIGSTOP 20
0033 
0034 #ifndef S_IRUSR
0035 #define S_IRUSR S_IREAD  /* read, user */
0036 #define S_IWUSR S_IWRITE /* write, user */
0037 #define S_IXUSR 0        /* execute, user */
0038 #endif
0039 #ifndef S_IRGRP
0040 #define S_IRGRP 0 /* read, group */
0041 #define S_IWGRP 0 /* write, group */
0042 #define S_IXGRP 0 /* execute, group */
0043 #endif
0044 #ifndef S_IROTH
0045 #define S_IROTH 0 /* read, others */
0046 #define S_IWOTH 0 /* write, others */
0047 #define S_IXOTH 0 /* execute, others */
0048 #endif
0049 #ifndef S_IRWXU
0050 #define S_IRWXU 0
0051 #endif
0052 #ifndef S_IRWXG
0053 #define S_IRWXG 0
0054 #endif
0055 #ifndef S_IRWXO
0056 #define S_IRWXO 0
0057 #endif
0058 
0059 // pyconfig.h typedefs this.  We require python headers to be included before
0060 // any LLDB headers, but there's no way to prevent python's pid_t definition
0061 // from leaking, so this is the best option.
0062 #ifndef NO_PID_T
0063 #include <sys/types.h>
0064 #endif
0065 
0066 #ifdef _MSC_VER
0067 
0068 // PRIxxx format macros for printf()
0069 #include <cinttypes>
0070 
0071 // open(), close(), creat(), etc.
0072 #include <io.h>
0073 
0074 typedef unsigned short mode_t;
0075 
0076 // pyconfig.h typedefs this.  We require python headers to be included before
0077 // any LLDB headers, but there's no way to prevent python's pid_t definition
0078 // from leaking, so this is the best option.
0079 #ifndef NO_PID_T
0080 typedef uint32_t pid_t;
0081 #endif
0082 
0083 #define STDIN_FILENO 0
0084 #define STDOUT_FILENO 1
0085 #define STDERR_FILENO 2
0086 
0087 #endif // _MSC_VER
0088 
0089 // empty functions
0090 inline int posix_openpt(int flag) { LLVM_BUILTIN_UNREACHABLE; }
0091 
0092 inline int unlockpt(int fd) { LLVM_BUILTIN_UNREACHABLE; }
0093 inline int grantpt(int fd) { LLVM_BUILTIN_UNREACHABLE; }
0094 inline char *ptsname(int fd) { LLVM_BUILTIN_UNREACHABLE; }
0095 
0096 inline pid_t fork(void) { LLVM_BUILTIN_UNREACHABLE; }
0097 inline pid_t setsid(void) { LLVM_BUILTIN_UNREACHABLE; }
0098 
0099 #endif