Mercurial > minori
comparison dep/animia/src/fd/bsd.cc @ 144:e6668085e24d
dep/animia: fix many bugs in the linux code
author | Paper <mrpapersonic@gmail.com> |
---|---|
date | Sun, 12 Nov 2023 18:35:49 -0500 |
parents | 4e750f6545cf |
children | d8a61e7e2a36 |
comparison
equal
deleted
inserted
replaced
143:4e750f6545cf | 144:e6668085e24d |
---|---|
49 } | 49 } |
50 | 50 |
51 /* add pids to our vector */ | 51 /* add pids to our vector */ |
52 pids.reserve(length / sizeof(*result)); | 52 pids.reserve(length / sizeof(*result)); |
53 for (int i = 0; i < length / sizeof(*result); i++) | 53 for (int i = 0; i < length / sizeof(*result); i++) |
54 pids.push_back(result[i].kp_proc.p_pid); | 54 pids.insert(result[i].kp_proc.p_pid); |
55 } | 55 } |
56 | 56 |
57 bool UnixFdTools::GetProcessName(pid_t pid, std::string& result) { | 57 bool UnixFdTools::GetProcessName(pid_t pid, std::string& result) { |
58 #ifdef __FreeBSD__ | 58 #ifdef __FreeBSD__ |
59 struct kinfo_proc* proc = kinfo_getproc(pid); | 59 struct kinfo_proc* proc = kinfo_getproc(pid); |