| 153 | } |
| 154 | |
| 155 | pid_t KittyTraceMgr::wait(int *status, int options, int timeout_ms) const |
| 156 | { |
| 157 | if (!_attached) |
| 158 | return -1; |
| 159 | |
| 160 | if (timeout_ms <= 0) |
| 161 | return waitpid(_pid, status, options); |
| 162 | |
| 163 | int elapsed = 0; |
| 164 | pid_t res; |
| 165 | if (!(options & WNOHANG)) |
| 166 | options |= WNOHANG; |
| 167 | |
| 168 | while (elapsed < timeout_ms) |
| 169 | { |
| 170 | res = waitpid(_pid, status, options); |
| 171 | if (res != 0) |
| 172 | return res; |
| 173 | |
| 174 | usleep(25000); |
| 175 | elapsed += 25; |
| 176 | } |
| 177 | |
| 178 | return res; |
| 179 | } |
| 180 | |
| 181 | bool KittyTraceMgr::waitSyscall() const |
| 182 | { |
nothing calls this directly
no outgoing calls
no test coverage detected