MCPcopy Create free account
hub / github.com/MJx0/KittyMemoryEx / wait

Method wait

KittyMemoryEx/KittyTrace.cpp:155–179  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

153}
154
155pid_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
181bool KittyTraceMgr::waitSyscall() const
182{

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected