lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Thu, 12 Sep 2013 15:08:49 +0200
From:	Ingo Molnar <mingo@...nel.org>
To:	David Ahern <dsahern@...il.com>
Cc:	linux-kernel@...r.kernel.org, acme@...stprotocols.net,
	fweisbec@...il.com, peterz@...radead.org, jolsa@...hat.com,
	namhyung@...nel.org, xiaoguangrong@...ux.vnet.ibm.com,
	runzhen@...ux.vnet.ibm.com, Runzhen Wang <icycoder@...il.com>
Subject: Re: [PATCH 14/16] perf kvm: reuse some code of
 perf_kvm__timerfd_create()


btw., I tried to build perf on a really old distro that has no timerfd.h, 
and got:

builtin-kvm.c:22:25: error: sys/timerfd.h: No such file or directory
cc1: warnings being treated as errors
builtin-kvm.c: In function ‘perf_kvm__timerfd_create’:
builtin-kvm.c:967: warning: implicit declaration of function ‘timerfd_create’
builtin-kvm.c:967: warning: nested extern declaration of ‘timerfd_create’
builtin-kvm.c:967: error: ‘TFD_NONBLOCK’ undeclared (first use in this function)
builtin-kvm.c:967: error: (Each undeclared identifier is reported only once
builtin-kvm.c:967: error: for each function it appears in.)
builtin-kvm.c:978: warning: implicit declaration of function ‘timerfd_settime’
builtin-kvm.c:978: warning: nested extern declaration of ‘timerfd_settime’
make: *** [builtin-kvm.o] Error 1
make: *** Waiting for unfinished jobs....

The quick patch below made it build - but it's incomplete, I have not 
filled in the config/* details to generate HAVE_TIMERFD, I only made 
builtin-kvm.o build.

Thanks,

	Ingo

diff --git a/tools/perf/builtin-kvm.c b/tools/perf/builtin-kvm.c
index 935d522..5cae8f2 100644
--- a/tools/perf/builtin-kvm.c
+++ b/tools/perf/builtin-kvm.c
@@ -19,7 +19,22 @@
 #include "util/top.h"
 
 #include <sys/prctl.h>
-#include <sys/timerfd.h>
+#ifdef HAVE_TIMERFD
+# include <sys/timerfd.h>
+#else
+# define TFD_NONBLOCK -1
+static int timerfd_create(clockid_t __clock_id __maybe_unused, int __flags __maybe_unused)
+{
+	return -1;
+}
+static int timerfd_settime(int __ufd __maybe_unused, int __flags __maybe_unused,
+			const struct itimerspec *__utmr __maybe_unused,
+			struct itimerspec *__otmr __maybe_unused)
+{
+	return -1;
+}
+
+#endif
 
 #include <termios.h>
 #include <semaphore.h>

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ