summaryrefslogtreecommitdiffstats
path: root/library/cpp/yt/system/process_id.h
blob: 4dcc89b13abe09c2ddfe065932cd08e2dbc8c0d5 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#pragma once

#include <util/system/getpid.h>

namespace NYT {

////////////////////////////////////////////////////////////////////////////////

constexpr TProcessId InvalidProcessId = TProcessId(-1);

//! Returns the OS process id (|getpid|).
//! The value is cached process-wide, so only the first call hits the kernel.
//! The cache is reset in the child after |fork|.
TProcessId GetProcessId();

////////////////////////////////////////////////////////////////////////////////

} // namespace NYT

#define PROCESS_ID_INL_H_
#include "process_id-inl.h"
#undef PROCESS_ID_INL_H_