DebugServer2
Loading...
Searching...
No Matches
LibProc.h
1//
2// Copyright (c) 2015, Jakub Klama <jakub@ixsystems.com>
3// All rights reserved.
4//
5// This source code is licensed under the University of Illinois/NCSA Open
6// Source License found in the LICENSE file in the root directory of this
7// source tree. An additional grant of patent rights can be found in the
8// PATENTS file in the same directory.
9//
10
11#pragma once
12
13#include "DebugServer2/Target/ThreadBase.h"
14#include "DebugServer2/Types.h"
15
16#include <cstdio>
17#include <dirent.h>
18#include <fcntl.h>
19#include <functional>
20#include <unistd.h>
21
22#include <sys/stat.h>
23
24namespace ds2 {
25namespace Host {
26namespace Darwin {
27
28class LibProc {
29public:
30 static bool GetProcessInfo(ProcessId pid, ProcessInfo &info);
31 static void
32 EnumerateProcesses(bool allUsers, UserId const &uid,
33 std::function<void(pid_t pid, uid_t uid)> const &cb);
34 static std::string GetThreadName(ProcessThreadId const &ptid);
35 static const char *GetExecutablePath(ProcessId pid);
36};
37} // namespace Darwin
38} // namespace Host
39} // namespace ds2
Definition LibProc.h:28
Definition Types.h:263
Definition Types.h:57