diff options
| author | Martin Ridgers <[email protected]> | 2021-09-15 09:04:40 +0200 |
|---|---|---|
| committer | Martin Ridgers <[email protected]> | 2021-09-15 09:04:40 +0200 |
| commit | a7d242dceb340a51e7095d80c4b0f8fba8c7f3ae (patch) | |
| tree | d0e0efce7957b0a507c0906370982231a447a1af /zencore/thread.cpp | |
| parent | Implemented RwLock on non-Windows platforms using std::shared_mutex (diff) | |
| download | zen-a7d242dceb340a51e7095d80c4b0f8fba8c7f3ae.tar.xz zen-a7d242dceb340a51e7095d80c4b0f8fba8c7f3ae.zip | |
GetCurrentProcess() for non-Windows
Diffstat (limited to 'zencore/thread.cpp')
| -rw-r--r-- | zencore/thread.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/zencore/thread.cpp b/zencore/thread.cpp index ffc17f79a..ef04ce8a4 100644 --- a/zencore/thread.cpp +++ b/zencore/thread.cpp @@ -8,6 +8,8 @@ #if ZEN_PLATFORM_WINDOWS # include <zencore/windows.h> +#elif ZEN_PLATFORM_LINUX +# include <unistd.h> #endif namespace zen { @@ -271,7 +273,11 @@ IsProcessRunning(int pid) int GetCurrentProcessId() { +#if ZEN_PLATFORM_WINDOWS return ::GetCurrentProcessId(); +#else + return getpid(); +#endif } void |