0001-Include-time.h-for-nanosleep.patch 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. From c5b93c33a81d7c52dc6089387e415f2d653f758f Mon Sep 17 00:00:00 2001
  2. From: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
  3. Date: Mon, 29 Dec 2014 11:43:51 +0100
  4. Subject: [PATCH] Include <time.h> for nanosleep()
  5. The nanosleep() function prototype is in <time.h>, so this header file
  6. should be included whenever nanosleep() is used. Not including it
  7. causes some issues when building OProfile against a non-thread capable
  8. version of the uClibc C library, probably because in such situation,
  9. <time.h> does not get included by another header.
  10. Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
  11. ---
  12. pe_counting/ocount.cpp | 1 +
  13. pe_profiling/operf.cpp | 1 +
  14. 2 files changed, 2 insertions(+)
  15. diff --git a/pe_counting/ocount.cpp b/pe_counting/ocount.cpp
  16. index 07dfd0c..fba29eb 100644
  17. --- a/pe_counting/ocount.cpp
  18. +++ b/pe_counting/ocount.cpp
  19. @@ -28,6 +28,7 @@
  20. #include <getopt.h>
  21. #include <sys/time.h>
  22. #include <math.h>
  23. +#include <time.h>
  24. #include "op_pe_utils.h"
  25. #include "ocount_counter.h"
  26. diff --git a/pe_profiling/operf.cpp b/pe_profiling/operf.cpp
  27. index 04a25d9..4238754 100644
  28. --- a/pe_profiling/operf.cpp
  29. +++ b/pe_profiling/operf.cpp
  30. @@ -33,6 +33,7 @@
  31. #include <sys/wait.h>
  32. #include <ftw.h>
  33. #include <getopt.h>
  34. +#include <time.h>
  35. #include <iostream>
  36. #include "operf_utils.h"
  37. #include "op_pe_utils.h"
  38. --
  39. 2.1.0