13 #ifndef __STOUT_WINDOWS_HPP__
14 #define __STOUT_WINDOWS_HPP__
46 #include <glog/logging.h>
49 #if !defined(_UNICODE) || !defined(UNICODE)
74 #error "Mesos must be built with `_UNICODE` and `UNICODE` defined."
75 #endif // !defined(_UNICODE) || !defined(UNICODE)
80 static_assert(std::is_same<HANDLE, void*>::value,
81 "Expected `HANDLE` to be of type `void*`.");
92 template <
typename Deleter>
94 : std::shared_ptr<void>(handle, deleter) {}
136 inline BOOL GetMessageWindows(
142 return GetMessage(lpMsg, hWnd, wMsgFilterMin, wMsgFilterMax);
145 inline BOOL GetMessage(
151 return GetMessageWindows(lpMsg, hWnd, wMsgFilterMin, wMsgFilterMax);
159 #define STDIN_FILENO 0
160 #define STDOUT_FILENO 1
161 #define STDERR_FILENO 2
165 #define X_OK 0x0 // No such permission on Windows.
168 #define MAXHOSTNAMELEN NI_MAXHOST
170 #define PATH_MAX _MAX_PATH
208 return (mode & S_IFMT) == S_IFDIR;
214 return (mode & S_IFMT) == S_IFREG;
220 return (mode & S_IFMT) == S_IFCHR;
226 return (mode & S_IFMT) == _S_IFIFO;
348 inline auto strerror_r(
int errnum,
char* buffer,
size_t length) ->
349 decltype(strerror_s(buffer, length, errnum))
351 return strerror_s(buffer, length, errnum);
360 static const char UNKNOWN_STRSIGNAL[] =
"Unknown signal";
361 return UNKNOWN_STRSIGNAL;
370 #define WIFEXITED(x) ((x) != -1)
376 #define WEXITSTATUS(x) static_cast<DWORD>(x)
377 #endif // WEXITSTATUS
380 #define WIFSIGNALED(x) ((x) != -1)
381 #endif // WIFSIGNALED
386 #define WTERMSIG(x) 0
391 #define WCOREDUMP(x) false
396 #define WIFSTOPPED(x) false
401 #define WSTOPSIG(x) 0
411 #define WUNTRACED 2 // Tell about stopped, untraced children.
414 #endif // __STOUT_WINDOWS_HPP__
SharedHandle(HANDLE handle, Deleter deleter)
Definition: windows.hpp:93
SSIZE_T ssize_t
Definition: windows.hpp:192
const mode_t S_IXOTH
Definition: windows.hpp:329
const mode_t S_IRGRP
Definition: windows.hpp:319
bool S_ISDIR(const int mode)
Definition: windows.hpp:206
HANDLE get_handle() const
Definition: windows.hpp:96
Definition: windows.hpp:78
const mode_t SIGKILL
Definition: windows.hpp:346
const mode_t S_IWUSR
Definition: windows.hpp:312
const char * strsignal(int signum)
Definition: windows.hpp:358
bool S_ISSOCK(const int mode)
Definition: windows.hpp:236
bool S_ISREG(const int mode)
Definition: windows.hpp:212
constexpr int SHUT_RDWR
Definition: windows.hpp:199
const mode_t S_IRUSR
Definition: windows.hpp:311
const mode_t O_SYNC
Definition: windows.hpp:340
bool S_ISFIFO(const int mode)
Definition: windows.hpp:224
const int NAME_MAX
Definition: windows.hpp:177
const mode_t S_IRWXO
Definition: windows.hpp:330
const mode_t S_ISVTX
Definition: windows.hpp:336
DWORD pid_t
Definition: windows.hpp:187
int mode_t
Definition: windows.hpp:183
const mode_t S_IXGRP
Definition: windows.hpp:321
constexpr Handle HANDLE
Definition: ingress.hpp:37
auto strerror_r(int errnum, char *buffer, size_t length) ->
Definition: windows.hpp:348
int uid_t
Definition: windows.hpp:189
const mode_t S_IXUSR
Definition: windows.hpp:313
#define PATH_MAX
Definition: windows.hpp:170
bool S_ISBLK(const int mode)
Definition: windows.hpp:230
const mode_t O_NONBLOCK
Definition: windows.hpp:341
const mode_t S_IRWXU
Definition: windows.hpp:314
const mode_t S_IWGRP
Definition: windows.hpp:320
const mode_t S_ISUID
Definition: windows.hpp:334
const mode_t S_IRWXG
Definition: windows.hpp:322
constexpr int MSG_NOSIGNAL
Definition: windows.hpp:200
bool S_ISLNK(const int mode)
Definition: windows.hpp:242
Try< mode_t > mode(const std::string &path, const FollowSymlink follow=FollowSymlink::FOLLOW_SYMLINK)
Definition: stat.hpp:126
const mode_t S_IWOTH
Definition: windows.hpp:328
constexpr int SHUT_RD
Definition: windows.hpp:197
int gid_t
Definition: windows.hpp:190
const mode_t S_ISGID
Definition: windows.hpp:335
bool S_ISCHR(const int mode)
Definition: windows.hpp:218
const mode_t S_IROTH
Definition: windows.hpp:327
constexpr int SHUT_WR
Definition: windows.hpp:198