13 #ifndef __STOUT_WINDOWS_HPP__ 14 #define __STOUT_WINDOWS_HPP__ 38 #include <type_traits> 40 #include <glog/logging.h> 43 #if !defined(_UNICODE) || !defined(UNICODE) 68 #error "Mesos must be built with `_UNICODE` and `UNICODE` defined." 69 #endif // !defined(_UNICODE) || !defined(UNICODE) 74 static_assert(std::is_same<HANDLE, void*>::value,
75 "Expected `HANDLE` to be of type `void*`.");
86 template <
typename Deleter>
88 :
std::shared_ptr<void>(handle, deleter) {}
130 inline BOOL GetMessageWindows(
136 return GetMessage(lpMsg, hWnd, wMsgFilterMin, wMsgFilterMax);
139 inline BOOL GetMessage(
145 return GetMessageWindows(lpMsg, hWnd, wMsgFilterMin, wMsgFilterMax);
153 #define STDIN_FILENO 0 154 #define STDOUT_FILENO 1 155 #define STDERR_FILENO 2 159 #define X_OK 0x0 // No such permission on Windows. 162 #define MAXHOSTNAMELEN NI_MAXHOST 164 #define PATH_MAX _MAX_PATH 202 return (mode & S_IFMT) == S_IFDIR;
208 return (mode & S_IFMT) == S_IFREG;
214 return (mode & S_IFMT) == S_IFCHR;
220 return (mode & S_IFMT) == _S_IFIFO;
337 inline auto strerror_r(
int errnum,
char* buffer,
size_t length) ->
338 decltype(strerror_s(buffer, length, errnum))
340 return strerror_s(buffer, length, errnum);
349 static const char UNKNOWN_STRSIGNAL[] =
"Unknown signal";
350 return UNKNOWN_STRSIGNAL;
362 #define WIFEXITED(x) true 368 #define WEXITSTATUS(x) static_cast<DWORD>(x) 369 #endif // WEXITSTATUS 376 #define WIFSIGNALED(x) false 377 #endif // WIFSIGNALED 385 #endif // __STOUT_WINDOWS_HPP__ SharedHandle(HANDLE handle, Deleter deleter)
Definition: windows.hpp:87
SSIZE_T ssize_t
Definition: windows.hpp:186
const mode_t S_IXOTH
Definition: windows.hpp:323
const mode_t S_IRGRP
Definition: windows.hpp:313
UINT uid_t
Definition: windows.hpp:183
bool S_ISDIR(const int mode)
Definition: windows.hpp:200
HANDLE get_handle() const
Definition: windows.hpp:90
Definition: windows.hpp:72
const mode_t SIGKILL
Definition: windows.hpp:335
const mode_t S_IWUSR
Definition: windows.hpp:306
const char * strsignal(int signum)
Definition: windows.hpp:347
bool S_ISSOCK(const int mode)
Definition: windows.hpp:230
Definition: type_utils.hpp:619
bool S_ISREG(const int mode)
Definition: windows.hpp:206
constexpr int SHUT_RDWR
Definition: windows.hpp:193
const mode_t S_IRUSR
Definition: windows.hpp:305
bool S_ISFIFO(const int mode)
Definition: windows.hpp:218
const int NAME_MAX
Definition: windows.hpp:171
const mode_t S_IRWXO
Definition: windows.hpp:324
const mode_t S_ISVTX
Definition: windows.hpp:330
DWORD pid_t
Definition: windows.hpp:181
int mode_t
Definition: windows.hpp:177
const mode_t S_IXGRP
Definition: windows.hpp:315
constexpr Handle HANDLE
Definition: ingress.hpp:37
auto strerror_r(int errnum, char *buffer, size_t length) -> decltype(strerror_s(buffer, length, errnum))
Definition: windows.hpp:337
const mode_t S_IXUSR
Definition: windows.hpp:307
#define PATH_MAX
Definition: windows.hpp:164
bool S_ISBLK(const int mode)
Definition: windows.hpp:224
const mode_t S_IRWXU
Definition: windows.hpp:308
const mode_t S_IWGRP
Definition: windows.hpp:314
const mode_t S_ISUID
Definition: windows.hpp:328
const mode_t S_IRWXG
Definition: windows.hpp:316
constexpr int MSG_NOSIGNAL
Definition: windows.hpp:194
bool S_ISLNK(const int mode)
Definition: windows.hpp:236
Try< mode_t > mode(const std::string &path, const FollowSymlink follow=FollowSymlink::FOLLOW_SYMLINK)
Definition: stat.hpp:168
const mode_t S_IWOTH
Definition: windows.hpp:322
constexpr int SHUT_RD
Definition: windows.hpp:191
const mode_t S_ISGID
Definition: windows.hpp:329
bool S_ISCHR(const int mode)
Definition: windows.hpp:212
const mode_t S_IROTH
Definition: windows.hpp:321
constexpr int SHUT_WR
Definition: windows.hpp:192
UINT gid_t
Definition: windows.hpp:184