]> Git Repo - linux.git/blob - tools/perf/util/get_current_dir_name.c
Merge branch 'x86-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel...
[linux.git] / tools / perf / util / get_current_dir_name.c
1 // SPDX-License-Identifier: GPL-2.0
2 // Copyright (C) 2018, Red Hat Inc, Arnaldo Carvalho de Melo <[email protected]>
3 //
4 #ifndef HAVE_GET_CURRENT_DIR_NAME
5 #include "util.h"
6 #include <unistd.h>
7 #include <stdlib.h>
8 #include <stdlib.h>
9
10 /* Android's 'bionic' library, for one, doesn't have this */
11
12 char *get_current_dir_name(void)
13 {
14         char pwd[PATH_MAX];
15
16         return getcwd(pwd, sizeof(pwd)) == NULL ? NULL : strdup(pwd);
17 }
18 #endif // HAVE_GET_CURRENT_DIR_NAME
This page took 0.035015 seconds and 4 git commands to generate.