Commit bb3e873f authored by yonghong-song's avatar yonghong-song Committed by GitHub

Merge pull request #1504 from samofatov/master

CentOS 6 support
parents b44d7056 c5308e96
......@@ -11,6 +11,11 @@
#include "libbpf.h"
// TODO: Remove this when CentOS 6 support is not needed anymore
#ifndef CLOCK_BOOTTIME
#define CLOCK_BOOTTIME 7
#endif
static const char * const prog_type_strings[] = {
[BPF_PROG_TYPE_UNSPEC] = "unspec",
[BPF_PROG_TYPE_SOCKET_FILTER] = "socket filter",
......
......@@ -48,6 +48,9 @@
#include "libbpf.h"
#include "perf_reader.h"
// TODO: Remove this when CentOS 6 support is not needed anymore
#include "setns.h"
// TODO: remove these defines when linux-libc-dev exports them properly
#ifndef __NR_bpf
......@@ -74,6 +77,11 @@
#define PERF_FLAG_FD_CLOEXEC (1UL << 3)
#endif
// TODO: Remove this when CentOS 6 support is not needed anymore
#ifndef AF_ALG
#define AF_ALG 38
#endif
#define min(x, y) ((x) < (y) ? (x) : (y))
static int probe_perf_reader_page_cnt = 8;
......
......@@ -21,6 +21,9 @@
#include "ns_guard.h"
// TODO: Remove this when CentOS 6 support is not needed anymore
#include "setns.h"
ProcMountNS::ProcMountNS(int pid) : target_ino_(0) {
if (pid < 0)
return;
......
// This file is only needed to support build for CentOS 6
// Remove it when no longer needed.
// File is trivial and therefore is in public domain.
#ifndef _GNU_SOURCE
#define _GNU_SOURCE
#endif
#include <unistd.h>
#include <sys/syscall.h>
#define setns(FD, NSTYPE) syscall(__NR_setns, (int)(FD), (int)(NSTYPE))
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment