MCPcopy Create free account
hub / github.com/FirebirdSQL/firebird / ISC_check_process_existence

Function ISC_check_process_existence

src/common/isc.cpp:203–231  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

201
202
203bool ISC_check_process_existence(SLONG pid)
204{
205/**************************************
206 *
207 * I S C _ c h e c k _ p r o c e s s _ e x i s t e n c e
208 *
209 **************************************
210 *
211 * Functional description
212 * Return true if the indicated process
213 * exists; false otherwise.
214 *
215 **************************************/
216
217#ifdef WIN_NT
218 const HANDLE handle = OpenProcess(SYNCHRONIZE, FALSE, (DWORD) pid);
219
220 if (!handle)
221 {
222 return (GetLastError() == ERROR_ACCESS_DENIED);
223 }
224
225 const bool alive = (WaitForSingleObject(handle, 0) != WAIT_OBJECT_0);
226 CloseHandle(handle);
227 return alive;
228#else
229 return (kill((int) pid, 0) == -1 && errno == ESRCH) ? false : true;
230#endif
231}
232
233
234#if defined(SOLARIS)

Callers 10

probe_processesMethod · 0.85
prt_ownerFunction · 0.85
initClientMethod · 0.85
probe_processesMethod · 0.85
clearCacheMethod · 0.85
setupMethod · 0.85
linkSelfMethod · 0.85
compactMethod · 0.85
enterFastMutexFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected