26 static void Initialize();
29 static CPUType GetCPUType();
30 static CPUSubType GetCPUSubType();
31 static Endian GetEndian();
32 static size_t GetPointerSize();
33 static size_t GetPageSize();
36 static char const *GetHostName(
bool fqdn =
false);
39 static char const *GetOSTypeName();
40 static char const *GetOSVendorName();
41 static char const *GetOSVersion();
42 static char const *GetOSBuild();
43 static char const *GetOSKernelVersion();
46 static bool GetUserName(UserId
const &uid, std::string &name);
47 static bool GetGroupName(GroupId
const &gid, std::string &name);
50 static int OpenFile(std::string
const &path, uint32_t flags, uint32_t mode);
51 static bool CloseFile(
int fd);
52 static bool IsFilePresent(std::string
const &path);
53 static std::string GetWorkingDirectory();
54 static bool SetWorkingDirectory(std::string
const &directory);
57 static ProcessId GetCurrentProcessId();
58 static const char *GetSelfExecutablePath();
59 static bool GetCurrentEnvironment(EnvironmentBlock &env);
63 static ErrorCode TranslateError(
int error);
64#elif defined(OS_WIN32)
65 static ErrorCode TranslateError(DWORD error);
67 static ErrorCode TranslateError();
69 static ErrorCode TranslateKernError(kern_return_t kret);
73 static bool GetProcessInfo(ProcessId pid,
ProcessInfo &info);
75 EnumerateProcesses(
bool allUsers, UserId
const &uid,
76 std::function<
void(
ProcessInfo const &info)>
const &cb);
77 static bool TerminateProcess(ProcessId pid);
80 static std::string GetThreadName(ProcessId pid, ThreadId tid);
83 static bool GetExecutableFileBuildID(std::string
const &path, ByteVector &buildId);