Stroika Library 3.0d16
 
Loading...
Searching...
No Matches
Foundation/Execution/Process.h
1/*
2 * Copyright(c) Sophist Solutions, Inc. 1990-2025. All rights reserved
3 */
4#ifndef _Stroika_Foundation_Execution_Process_h_
5#define _Stroika_Foundation_Execution_Process_h_ 1
6
7#include "Stroika/Foundation/StroikaPreComp.h"
8
9#include <mutex>
10
11#if qStroika_Foundation_Common_Platform_POSIX
12#include <sys/types.h>
13#include <unistd.h>
14#elif qStroika_Foundation_Common_Platform_Windows
15#include <Windows.h>
16#include <process.h>
17#endif
18
19#include "Stroika/Foundation/Common/Common.h"
20
21#if !defined(qHas_pid_t)
22#error "qHas_pid_t must be defined in StroikaConfig.h"
23#endif
24
26
27 /// TODO - maybe move this to configuraiotn module???
28
29#if qHas_pid_t
30 using pid_t = ::pid_t;
31#else
32#if qStroika_Foundation_Common_Platform_Windows
33 using pid_t = DWORD;
34#else
35 using pid_t = int;
36#endif
37#endif
38
39 pid_t GetCurrentProcessID ();
40
41 /**
42 * Return true, if the pid can be verified to be running, false if verified not running.
43 * \note This obviously can be a race as processes can come and go quickly
44 */
45 bool IsProcessRunning (pid_t pid);
46
47}
48
49/*
50 ********************************************************************************
51 ***************************** Implementation Details ***************************
52 ********************************************************************************
53 */
54#include "Process.inl"
55
56#endif /*_Stroika_Foundation_Execution_Process_h_*/
int pid_t
TODO - maybe move this to configuraiotn module???
Definition Module.h:34