LLDB mainline
HostInfoPosix.h
Go to the documentation of this file.
1//===-- HostInfoPosix.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 LLDB_HOST_POSIX_HOSTINFOPOSIX_H
10#define LLDB_HOST_POSIX_HOSTINFOPOSIX_H
11
14#include <optional>
15#include <string>
16
17namespace lldb_private {
18
19class UserIDResolver;
20
22 friend class HostInfoBase;
23
24public:
25 static size_t GetPageSize();
26 static bool GetHostname(std::string &s);
27 static std::optional<std::string> GetOSKernelDescription();
28
29 static uint32_t GetUserID();
30 static uint32_t GetGroupID();
31 static uint32_t GetEffectiveUserID();
32 static uint32_t GetEffectiveGroupID();
33
35
36 static bool GetEnvironmentVar(const std::string &var_name, std::string &var);
37
39 static llvm::VersionTuple GetOSVersion();
40 static std::optional<std::string> GetOSBuildString();
41
42protected:
43 static bool ComputeSupportExeDirectory(FileSpec &file_spec);
44 static bool ComputeHeaderDirectory(FileSpec &file_spec);
45 static bool ComputeSystemPluginsDirectory(FileSpec &file_spec);
46 static bool ComputeUserPluginsDirectory(FileSpec &file_spec);
47};
48} // namespace lldb_private
49
50#endif
A file utility class.
Definition: FileSpec.h:56
static std::optional< std::string > GetOSBuildString()
static bool ComputeSupportExeDirectory(FileSpec &file_spec)
static bool GetHostname(std::string &s)
static bool ComputeSystemPluginsDirectory(FileSpec &file_spec)
static std::optional< std::string > GetOSKernelDescription()
static FileSpec GetDefaultShell()
static uint32_t GetEffectiveUserID()
static llvm::VersionTuple GetOSVersion()
static bool GetEnvironmentVar(const std::string &var_name, std::string &var)
static uint32_t GetGroupID()
static bool ComputeUserPluginsDirectory(FileSpec &file_spec)
static uint32_t GetEffectiveGroupID()
static UserIDResolver & GetUserIDResolver()
static bool ComputeHeaderDirectory(FileSpec &file_spec)
An abstract interface for things that know how to map numeric user/group IDs into names.
A class that represents a running process on the host machine.