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 12 #include "lldb/Host/HostInfoBase.h" 13 #include "lldb/Utility/FileSpec.h" 14 15 namespace lldb_private { 16 17 class UserIDResolver; 18 19 class HostInfoPosix : public HostInfoBase { 20 friend class HostInfoBase; 21 22 public: 23 static size_t GetPageSize(); 24 static bool GetHostname(std::string &s); 25 static llvm::Optional<std::string> GetOSKernelDescription(); 26 27 static uint32_t GetUserID(); 28 static uint32_t GetGroupID(); 29 static uint32_t GetEffectiveUserID(); 30 static uint32_t GetEffectiveGroupID(); 31 32 static FileSpec GetDefaultShell(); 33 34 static bool GetEnvironmentVar(const std::string &var_name, std::string &var); 35 36 static UserIDResolver &GetUserIDResolver(); 37 38 protected: 39 static bool ComputeSupportExeDirectory(FileSpec &file_spec); 40 static bool ComputeHeaderDirectory(FileSpec &file_spec); 41 }; 42 } 43 44 #endif 45