1
#if !defined(__linux__)
2
#error "Linux platform file is part of non-Linux build."
3
#endif
4

            
5
#include "source/common/api/os_sys_calls_impl_linux.h"
6

            
7
#include <sched.h>
8

            
9
#include <cerrno>
10

            
11
namespace Envoy {
12
namespace Api {
13

            
14
SysCallIntResult LinuxOsSysCallsImpl::sched_getaffinity(pid_t pid, size_t cpusetsize,
15
10
                                                        cpu_set_t* mask) {
16
10
  const int rc = ::sched_getaffinity(pid, cpusetsize, mask);
17
10
  return {rc, errno};
18
10
}
19

            
20
SysCallIntResult LinuxOsSysCallsImpl::setns(int fd, int nstype) const {
21
  const int rc = ::setns(fd, nstype);
22
  return {rc, errno};
23
}
24

            
25
} // namespace Api
26
} // namespace Envoy