Now I think all major Linux distro provides openat() functions in libc as
it's specified in POSIX.1-2008.  Maybe we could add a config check to
detect them later if somebody don't.

Also remove the old code to undefine the macro unconditionally.

Signed-off-by: Namhyung Kim <namhy...@google.com>
---
 lib/Makefile                | 1 +
 lib/pfmlib_perf_event_pmu.c | 7 -------
 2 files changed, 1 insertion(+), 7 deletions(-)

diff --git a/lib/Makefile b/lib/Makefile
index 5ca71e3..aae64a1 100644
--- a/lib/Makefile
+++ b/lib/Makefile
@@ -33,6 +33,7 @@ include $(TOPDIR)/rules.mk
 SRCS=pfmlib_common.c
 
 ifeq ($(SYS),Linux)
+CFLAGS += -DHAS_OPENAT
 SRCS += pfmlib_perf_event_pmu.c pfmlib_perf_event.c pfmlib_perf_event_raw.c
 endif
 
diff --git a/lib/pfmlib_perf_event_pmu.c b/lib/pfmlib_perf_event_pmu.c
index 637c5b1..718815d 100644
--- a/lib/pfmlib_perf_event_pmu.c
+++ b/lib/pfmlib_perf_event_pmu.c
@@ -34,13 +34,6 @@
 #include <sys/param.h>
 #endif
 
-/*
- * looks like several distributions do not have
- * the latest libc with openat support, so disable
- * for now
- */
-#undef HAS_OPENAT
-
 #include "pfmlib_priv.h"
 #include "pfmlib_perf_event_priv.h"
 
-- 
2.40.0.348.gf938b09366-goog



_______________________________________________
perfmon2-devel mailing list
perfmon2-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/perfmon2-devel

Reply via email to