perf tools: Fixup get_current_dir_name() compilation
authorAlexey Dobriyan <adobriyan@gmail.com>
Tue, 17 Aug 2021 11:58:33 +0000 (14:58 +0300)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Mon, 30 Aug 2021 13:06:16 +0000 (10:06 -0300)
strdup() prototype doesn't live in stdlib.h .

Add limits.h for PATH_MAX definition as well.

This fixes the build on Android.

Signed-off-by: Alexey Dobriyan (SK hynix) <adobriyan@gmail.com>
Acked-by: Namhyung Kim <namhyung@kernel.org>
Link: http://lore.kernel.org/lkml/YRukaQbrgDWhiwGr@localhost.localdomain
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
tools/perf/util/get_current_dir_name.c

index b205d92..e68935e 100644 (file)
@@ -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 */