aboutsummaryrefslogtreecommitdiffstats
path: root/library/cpp/yt/system/proc.h
blob: b1b65608e3ffa3fd39befa6119ff5ae1b0f53d0c (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#pragma once

#include <library/cpp/yt/misc/enum.h>

#include <errno.h>

namespace NYT {

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

//! NYT::TError::FromSystem adds this value to a system errno. The enum
//! below lists several errno's that are used in our code.
constexpr int LinuxErrorCodeBase = 4200;
constexpr int LinuxErrorCodeCount = 2000;

DEFINE_ENUM(ELinuxErrorCode,
    ((NOENT)              ((LinuxErrorCodeBase + ENOENT)))
    ((IO)                 ((LinuxErrorCodeBase + EIO)))
    ((ACCESS)             ((LinuxErrorCodeBase + EACCES)))
    ((NFILE)              ((LinuxErrorCodeBase + ENFILE)))
    ((MFILE)              ((LinuxErrorCodeBase + EMFILE)))
    ((NOSPC)              ((LinuxErrorCodeBase + ENOSPC)))
    ((PIPE)               ((LinuxErrorCodeBase + EPIPE)))
    ((CONNRESET)          ((LinuxErrorCodeBase + ECONNRESET)))
    ((TIMEDOUT)           ((LinuxErrorCodeBase + ETIMEDOUT)))
    ((CONNREFUSED)        ((LinuxErrorCodeBase + ECONNREFUSED)))
    ((DQUOT)              ((LinuxErrorCodeBase + EDQUOT)))
);

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

} // namespace NYT