perf trace: Fix the build on older distros

Such as RHEL5, where CLOEXEC, NONBLOCK flags are not present, use a
ifdef+define approach instead to make it build on all distros.

Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Borislav Petkov <bp@suse.de>
Cc: David Ahern <dsahern@gmail.com>
Cc: Don Zickus <dzickus@redhat.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Stephane Eranian <eranian@google.com>
Cc: Vinson Lee <vlee@twitter.com>
Link: http://lkml.kernel.org/n/tip-pioazikk9d9oz5qdeor3eldu@git.kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
上级 b390d850
...@@ -16,7 +16,6 @@ ...@@ -16,7 +16,6 @@
#include <libaudit.h> #include <libaudit.h>
#include <stdlib.h> #include <stdlib.h>
#include <sys/eventfd.h>
#include <sys/mman.h> #include <sys/mman.h>
#include <linux/futex.h> #include <linux/futex.h>
...@@ -41,6 +40,34 @@ ...@@ -41,6 +40,34 @@
# define EFD_SEMAPHORE 1 # define EFD_SEMAPHORE 1
#endif #endif
#ifndef EFD_NONBLOCK
# define EFD_NONBLOCK 00004000
#endif
#ifndef EFD_CLOEXEC
# define EFD_CLOEXEC 02000000
#endif
#ifndef O_CLOEXEC
# define O_CLOEXEC 02000000
#endif
#ifndef SOCK_DCCP
# define SOCK_DCCP 6
#endif
#ifndef SOCK_CLOEXEC
# define SOCK_CLOEXEC 02000000
#endif
#ifndef SOCK_NONBLOCK
# define SOCK_NONBLOCK 00004000
#endif
#ifndef MSG_CMSG_CLOEXEC
# define MSG_CMSG_CLOEXEC 0x40000000
#endif
struct tp_field { struct tp_field {
int offset; int offset;
union { union {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册