Skip to contentSkip to conversation

perf, android: fixup get_current_dir_name() compilation

PATCH Applied Alexey Dobriyan 3 participants 3 messages Aug 17, 2021 – Aug 19, 2021 perf events

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 perf, android: fixup get_current_dir_name() compilation

strdup() prototype doesn't live in stdlib.h .

Add limits.h for PATH_MAX definition as well.

---

 tools/perf/util/get_current_dir_name.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
tools/perf/util/get_current_dir_name.c +2 -1
@@ -3,8 +3,9 @@
 //
 #ifndef HAVE_GET_CURRENT_DIR_NAME
 #include "get_current_dir_name.h"
+#include <limits.h>
+#include <string.h>
 #include <unistd.h>
-#include <stdlib.h>
 
 /* Android's 'bionic' library, for one, doesn't have this */
 
Acked-by on v1 1/1
#1 lore raw

Hello,

Quoted 6 lines · Alexey Dobriyan

strdup() prototype doesn't live in stdlib.h .

Add limits.h for PATH_MAX definition as well.

Thanks,
Namhyung

Quoted 18 lines

---

 tools/perf/util/get_current_dir_name.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
tools/perf/util/get_current_dir_name.c +2 -1
@@ -3,8 +3,9 @@
 //
 #ifndef HAVE_GET_CURRENT_DIR_NAME
 #include "get_current_dir_name.h"
+#include <limits.h>
+#include <string.h>
 #include <unistd.h>
-#include <stdlib.h>
 
 /* Android's 'bionic' library, for one, doesn't have this */