1
#pragma once
2

            
3
#include <memory>
4
#include <string>
5

            
6
#include "envoy/common/platform.h"
7

            
8
namespace Envoy {
9
namespace Api {
10
/**
11
 * SysCallResult holds the rc and errno values resulting from a system call.
12
 */
13
template <typename T> struct SysCallResult {
14

            
15
  /**
16
   * The return code from the system call.
17
   */
18
  T return_value_;
19

            
20
  /**
21
   * The errno value as captured after the system call.
22
   */
23
  int errno_;
24
};
25

            
26
using SysCallIntResult = SysCallResult<int>;
27
using SysCallSizeResult = SysCallResult<ssize_t>;
28
using SysCallPtrResult = SysCallResult<void*>;
29
using SysCallStringResult = SysCallResult<std::string>;
30
using SysCallBoolResult = SysCallResult<bool>;
31
using SysCallSocketResult = SysCallResult<os_fd_t>;
32

            
33
} // namespace Api
34
} // namespace Envoy