diff options
Diffstat (limited to 'source/core')
| -rw-r--r-- | source/core/slang-process.h | 2 | ||||
| -rw-r--r-- | source/core/unix/slang-unix-process.cpp | 5 | ||||
| -rw-r--r-- | source/core/windows/slang-win-process.cpp | 6 |
3 files changed, 13 insertions, 0 deletions
diff --git a/source/core/slang-process.h b/source/core/slang-process.h index 0beb78c06..c36064ac3 100644 --- a/source/core/slang-process.h +++ b/source/core/slang-process.h @@ -73,6 +73,8 @@ public: /// Get the clock tick. static uint64_t getClockTick(); + static uint32_t getId(); + protected: int32_t m_returnValue = 0; ///< Value returned if process terminated RefPtr<Stream> m_streams[Index(StdStreamType::CountOf)]; ///< Streams to communicate with the process diff --git a/source/core/unix/slang-unix-process.cpp b/source/core/unix/slang-unix-process.cpp index 428bef874..3ab113d83 100644 --- a/source/core/unix/slang-unix-process.cpp +++ b/source/core/unix/slang-unix-process.cpp @@ -649,4 +649,9 @@ closePipes: return SLANG_OK; } +uint32_t Process::getId() +{ + return getpid(); +} + } // namespace Slang diff --git a/source/core/windows/slang-win-process.cpp b/source/core/windows/slang-win-process.cpp index e577da0fa..38f733015 100644 --- a/source/core/windows/slang-win-process.cpp +++ b/source/core/windows/slang-win-process.cpp @@ -561,4 +561,10 @@ static const uint64_t g_frequency = _getClockFrequency(); return counter.QuadPart; } +uint32_t Process::getId() +{ + return _getpid(); +} + + } // namespace Slang |
