Joedb 9.5.0
The Journal-Only Embedded Database
Loading...
Searching...
No Matches
get_pid.h
Go to the documentation of this file.
1#ifndef joedb_get_pid_declared
2#define joedb_get_pid_declared
3
5
6/////////////////////////////////////////////////////////////////////////////
7#ifdef JOEDB_FILE_IS_PORTABLE_FILE
8/////////////////////////////////////////////////////////////////////////////
9namespace joedb
10{
11 /// @ingroup joedb
12 inline int get_pid()
13 {
14 return 0;
15 }
16}
17
18/////////////////////////////////////////////////////////////////////////////
19#elif defined(JOEDB_FILE_IS_WINDOWS_FILE)
20/////////////////////////////////////////////////////////////////////////////
21#include <processthreadsapi.h>
22
23namespace joedb
24{
25 /// @ingroup joedb
26 inline DWORD get_pid()
27 {
28 return GetCurrentProcessId();
29 }
30}
31
32/////////////////////////////////////////////////////////////////////////////
33#elif defined(JOEDB_FILE_IS_POSIX_FILE)
34/////////////////////////////////////////////////////////////////////////////
35#include <unistd.h>
36
37namespace joedb
38{
39 /// @ingroup joedb
40 inline int get_pid()
41 {
42 return ::getpid();
43 }
44}
45
46#endif
47
48#endif
Definition Blob.h:7