[Lldb-commits] [lldb] [lldb][AIX] get host info for AIX (cont..) (PR #138687)
Pavel Labath via lldb-commits
lldb-commits at lists.llvm.org
Wed May 7 00:18:17 PDT 2025
================
@@ -133,7 +142,45 @@ static bool GetProcessAndStatInfo(::pid_t pid,
uint32_t Host::FindProcessesImpl(const ProcessInstanceInfoMatch &match_info,
ProcessInstanceInfoList &process_infos) {
- return 0;
+ static const char procdir[] = "/proc/";
+
+ DIR *dirproc = opendir(procdir);
+ if (dirproc) {
+ struct dirent *direntry = nullptr;
+ const uid_t our_uid = getuid();
+ const lldb::pid_t our_pid = getpid();
+ bool all_users = match_info.GetMatchAllUsers();
+
+ while ((direntry = readdir(dirproc)) != nullptr) {
+ if (!IsDirNumeric(direntry->d_name))
+ continue;
+
+ lldb::pid_t pid = atoi(direntry->d_name);
----------------
labath wrote:
```suggestion
lldb::pid_t pid;
if (!llvm::to_integer(direntry->d_name, pid))
continue;
```
.. and then delete IsDirNumeric
https://github.com/llvm/llvm-project/pull/138687
More information about the lldb-commits
mailing list