Mercurial > minori
comparison dep/animone/src/fd.cc @ 266:1a6a5d3a94cd
dep/animone: make bsd.cc and x11.cc actually work
apparently I broke these, and even now the x11 code *still* doesn't want
to work correctly (at least on FreeBSD). half of the PID response codes
are just 0 or the PID for the X server itself... wtf?
maybe dwm just doesn't support the XRes extension, or I'm just stupid.
i don't know.
| author | Paper <paper@paper.us.eu.org> |
|---|---|
| date | Thu, 11 Apr 2024 22:05:41 -0400 |
| parents | 862d0d8619f6 |
| children | 246017a7907a |
comparison
equal
deleted
inserted
replaced
| 265:ff0b2052b234 | 266:1a6a5d3a94cd |
|---|---|
| 11 #ifdef MACOSX | 11 #ifdef MACOSX |
| 12 # include "animone/fd/xnu.h" | 12 # include "animone/fd/xnu.h" |
| 13 # include "animone/util/osx.h" | 13 # include "animone/util/osx.h" |
| 14 #endif | 14 #endif |
| 15 | 15 |
| 16 #ifdef LIBKVM | 16 #ifdef BSD |
| 17 # include "animone/fd/kvm.h" | 17 # include "animone/fd/bsd.h" |
| 18 #endif | 18 #endif |
| 19 | 19 |
| 20 namespace animone::internal { | 20 namespace animone::internal { |
| 21 | 21 |
| 22 bool EnumerateOpenFiles(const std::set<pid_t>& pids, open_file_proc_t open_file_proc) { | 22 bool EnumerateOpenFiles(const std::set<pid_t>& pids, open_file_proc_t open_file_proc) { |
| 32 | 32 |
| 33 #ifdef MACOSX | 33 #ifdef MACOSX |
| 34 success ^= xnu::EnumerateOpenFiles(pids, open_file_proc); | 34 success ^= xnu::EnumerateOpenFiles(pids, open_file_proc); |
| 35 #endif | 35 #endif |
| 36 | 36 |
| 37 #ifdef LIBKVM | 37 #ifdef BSD |
| 38 success ^= kvm::EnumerateOpenFiles(pids, open_file_proc); | 38 success ^= bsd::EnumerateOpenFiles(pids, open_file_proc); |
| 39 #endif | 39 #endif |
| 40 | 40 |
| 41 return success; | 41 return success; |
| 42 } | 42 } |
| 43 | 43 |
| 54 | 54 |
| 55 #ifdef MACOSX | 55 #ifdef MACOSX |
| 56 success ^= xnu::EnumerateOpenProcesses(process_proc); | 56 success ^= xnu::EnumerateOpenProcesses(process_proc); |
| 57 #endif | 57 #endif |
| 58 | 58 |
| 59 #ifdef LIBKVM | 59 #ifdef BSD |
| 60 success ^= kvm::EnumerateOpenProcesses(process_proc); | 60 success ^= bsd::EnumerateOpenProcesses(process_proc); |
| 61 #endif | 61 #endif |
| 62 | 62 |
| 63 return success; | 63 return success; |
| 64 } | 64 } |
| 65 | 65 |
| 76 | 76 |
| 77 #ifdef MACOSX | 77 #ifdef MACOSX |
| 78 success ^= osx::util::GetProcessName(pid, name); | 78 success ^= osx::util::GetProcessName(pid, name); |
| 79 #endif | 79 #endif |
| 80 | 80 |
| 81 #ifdef LIBKVM | 81 #ifdef BSD |
| 82 success ^= kvm::GetProcessName(pid, name); | 82 success ^= bsd::GetProcessName(pid, name); |
| 83 #endif | 83 #endif |
| 84 | 84 |
| 85 return success; | 85 return success; |
| 86 } | 86 } |
| 87 | 87 |
