getpid
This commit is contained in:
parent
79d70b8bae
commit
85fc57dea2
3 changed files with 16 additions and 0 deletions
|
@ -5,6 +5,9 @@
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
|
||||||
|
// not really connectiony, but need per-platform
|
||||||
|
int GetProcessId();
|
||||||
|
|
||||||
struct BaseConnection {
|
struct BaseConnection {
|
||||||
static BaseConnection* Create();
|
static BaseConnection* Create();
|
||||||
static void Destroy(BaseConnection*&);
|
static void Destroy(BaseConnection*&);
|
||||||
|
|
|
@ -1,5 +1,13 @@
|
||||||
#include "connection.h"
|
#include "connection.h"
|
||||||
|
|
||||||
|
#include <sys/types.h>
|
||||||
|
#include <unistd.h>
|
||||||
|
|
||||||
|
int GetProcessId()
|
||||||
|
{
|
||||||
|
return ::getpid();
|
||||||
|
}
|
||||||
|
|
||||||
const int RpcVersion = 1;
|
const int RpcVersion = 1;
|
||||||
const int NumFrames = 4;
|
const int NumFrames = 4;
|
||||||
|
|
||||||
|
|
|
@ -6,6 +6,11 @@
|
||||||
#define NOIME
|
#define NOIME
|
||||||
#include <windows.h>
|
#include <windows.h>
|
||||||
|
|
||||||
|
int GetProcessId()
|
||||||
|
{
|
||||||
|
return ::GetCurrentProcessId();
|
||||||
|
}
|
||||||
|
|
||||||
struct BaseConnectionWin : public BaseConnection {
|
struct BaseConnectionWin : public BaseConnection {
|
||||||
HANDLE pipe{INVALID_HANDLE_VALUE};
|
HANDLE pipe{INVALID_HANDLE_VALUE};
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in a new issue