/bionic/libc/bionic/ |
D | libgen.cpp | 39 static int __basename_r(const char* path, char* buffer, size_t buffer_size) { in __basename_r() argument 46 if (path == nullptr || *path == '\0') { in __basename_r() 53 endp = path + strlen(path) - 1; in __basename_r() 54 while (endp > path && *endp == '/') { in __basename_r() 59 if (endp == path && *endp == '/') { in __basename_r() 67 while (startp > path && *(startp - 1) != '/') { in __basename_r() 92 __LIBC32_LEGACY_PUBLIC__ int basename_r(const char* path, char* buffer, size_t buffer_size) { in basename_r() argument 93 return __basename_r(path, buffer, buffer_size); in basename_r() 96 static int __dirname_r(const char* path, char* buffer, size_t buffer_size) { in __dirname_r() argument 102 if (path == nullptr || *path == '\0') { in __dirname_r() [all …]
|
D | lfs64_support.cpp | 23 int mkstemp64(char* path) { in mkstemp64() argument 24 return mkstemp(path); in mkstemp64() 26 int mkostemp64(char* path, int flags) { in mkostemp64() argument 27 return mkostemp(path, flags); in mkostemp64() 29 int mkstemps64(char* path, int suffix_length) { in mkstemps64() argument 30 return mkstemps(path, suffix_length); in mkstemps64() 32 int mkostemps64(char* path, int suffix_length, int flags) { in mkostemps64() argument 33 return mkostemps(path, suffix_length, flags); in mkostemps64()
|
D | sys_time.cpp | 37 static int futimesat(int fd, const char* path, const timeval tv[2], int flags) { in futimesat() argument 43 return utimensat(fd, path, tv ? ts : nullptr, flags); in futimesat() 46 int utimes(const char* path, const timeval tv[2]) { in utimes() argument 47 return futimesat(AT_FDCWD, path, tv, 0); in utimes() 50 int lutimes(const char* path, const timeval tv[2]) { in lutimes() argument 51 return futimesat(AT_FDCWD, path, tv, AT_SYMLINK_NOFOLLOW); in lutimes() 54 int futimesat(int fd, const char* path, const timeval tv[2]) { in futimesat() argument 55 return futimesat(fd, path, tv, 0); in futimesat()
|
D | spawn.cpp | 55 char* path; member 61 fd = open(path, flags, mode); in Do() 137 const char* path, in posix_spawn() argument 142 int exec_fn(const char* path, char* const argv[], char* const env[])) { in posix_spawn() argument 159 exec_fn(path, argv, env ? env : environ); in posix_spawn() 168 int posix_spawn(pid_t* pid, const char* path, const posix_spawn_file_actions_t* actions, in posix_spawn() argument 170 return posix_spawn(pid, path, actions, attr, argv, env, execve); in posix_spawn() 284 free(last->path); in posix_spawn_file_actions_destroy() 296 const char* path, in posix_spawn_add_file_action() argument 304 if (path != nullptr) { in posix_spawn_add_file_action() [all …]
|
D | tmpfile.cpp | 54 char* path = nullptr; in __tmpfile_dir_legacy() local 55 if (asprintf(&path, "%s/tmp.XXXXXXXXXX", tmp_dir) == -1) { in __tmpfile_dir_legacy() 59 int fd = mkstemp(path); in __tmpfile_dir_legacy() 61 free(path); in __tmpfile_dir_legacy() 66 unlink(path); in __tmpfile_dir_legacy() 67 free(path); in __tmpfile_dir_legacy()
|
D | mkfifo.cpp | 33 int mkfifo(const char* path, mode_t mode) { in mkfifo() argument 34 return mkfifoat(AT_FDCWD, path, mode); in mkfifo() 37 int mkfifoat(int fd, const char* path, mode_t mode) { in mkfifoat() argument 38 return mknodat(fd, path, (mode & ~S_IFMT) | S_IFIFO, 0); in mkfifoat()
|
D | ftw.cpp | 30 static int do_nftw(const char* path, in do_nftw() argument 51 char* const paths[2] = { const_cast<char*>(path), nullptr }; in do_nftw() 118 int ftw(const char* path, int (*ftw_fn)(const char*, const struct stat*, int), int nfds) { in ftw() argument 119 return do_nftw(path, ftw_fn, nullptr, nfds, 0); in ftw() 122 int nftw(const char* path, int (*nftw_fn)(const char*, const struct stat*, int, FTW*), in nftw() argument 124 return do_nftw(path, nullptr, nftw_fn, nfds, nftw_flags); in nftw()
|
D | sys_statfs.cpp | 26 # define __statfs64(path,size,buf) __statfs(path,buf) argument 47 int statfs(const char* path, struct statfs* result) { in statfs() argument 48 int rc = __statfs64(path, sizeof(*result), result); in statfs()
|
/bionic/tests/ |
D | ftw_test.cpp | 32 char path[PATH_MAX]; in MakeTree() local 34 snprintf(path, sizeof(path), "%s/dir", root); in MakeTree() 35 ASSERT_EQ(0, mkdir(path, 0755)) << path; in MakeTree() 36 snprintf(path, sizeof(path), "%s/dir/sub", root); in MakeTree() 37 ASSERT_EQ(0, mkdir(path, 0555)) << path; in MakeTree() 38 snprintf(path, sizeof(path), "%s/unreadable-dir", root); in MakeTree() 39 ASSERT_EQ(0, mkdir(path, 0000)) << path; in MakeTree() 41 snprintf(path, sizeof(path), "%s/dangler", root); in MakeTree() 42 ASSERT_EQ(0, symlink("/does-not-exist", path)); in MakeTree() 43 snprintf(path, sizeof(path), "%s/symlink", root); in MakeTree() [all …]
|
D | sys_time_test.cpp | 29 ASSERT_EQ(0, utimes(tf.path, nullptr)); in TEST() 38 ASSERT_EQ(-1, utimes(tf.path, tv)); in TEST() 41 ASSERT_EQ(-1, utimes(tf.path, tv)); in TEST() 47 ASSERT_EQ(-1, utimes(tf.path, tv)); in TEST() 50 ASSERT_EQ(-1, utimes(tf.path, tv)); in TEST() 83 ASSERT_EQ(0, futimesat(AT_FDCWD, tf.path, nullptr)); in TEST() 92 ASSERT_EQ(-1, futimesat(AT_FDCWD, tf.path, tv)); in TEST() 95 ASSERT_EQ(-1, futimesat(AT_FDCWD, tf.path, tv)); in TEST() 101 ASSERT_EQ(-1, futimesat(AT_FDCWD, tf.path, tv)); in TEST() 104 ASSERT_EQ(-1, futimesat(AT_FDCWD, tf.path, tv)); in TEST() [all …]
|
D | sys_stat_test.cpp | 80 std::string path; in TEST() local 83 path = tf.path; in TEST() 86 ASSERT_EQ(0, mkfifo(path.c_str(), 0666)); in TEST() 88 ASSERT_EQ(0, stat(path.c_str(), &sb)); in TEST() 90 unlink(path.c_str()); in TEST() 175 ASSERT_EQ(0, fchmodat(AT_FDCWD, tf.path, 0751, 0)); in TEST() 176 AssertFileModeEquals(0751, tf.path); in TEST() 182 int result = fchmodat(AT_FDCWD, tf.path, 0751, AT_SYMLINK_NOFOLLOW); in TEST() 187 AssertFileModeEquals(0751, tf.path); in TEST() 200 snprintf(linkname, sizeof(linkname), "%s.link", tf.path); in TEST() [all …]
|
/bionic/libc/upstream-openbsd/lib/libc/stdio/ |
D | mktemp.c | 45 mktemp_internal(char *path, int slen, int mode, int flags) in mktemp_internal() argument 54 len = strlen(path); in mktemp_internal() 59 ep = path + len - slen; in mktemp_internal() 61 for (start = ep; start > path && start[-1] == 'X'; start--) in mktemp_internal() 92 if (lstat(path, &sb) != 0) in mktemp_internal() 96 fd = open(path, flags, S_IRUSR|S_IWUSR); in mktemp_internal() 101 if (mkdir(path, S_IRUSR|S_IWUSR|S_IXUSR) == 0) in mktemp_internal() 114 _mktemp(char *path) in _mktemp() argument 116 if (mktemp_internal(path, 0, MKTEMP_NAME, 0) == -1) in _mktemp() 118 return(path); in _mktemp() [all …]
|
/bionic/libc/kernel/tools/ |
D | kernel.py | 7 import sys, cpp, re, os.path, string, time 89 hdr_dir = os.path.realpath(os.path.dirname(from_file)) 90 hdr_dir = hdr_dir.replace("%s/" % os.path.realpath(kernel_root), 106 def parseFile(self, path, arch=None, kernel_root=None): argument 108 if not os.path.exists(path): 115 f = open(path, "rt") 117 print "!!! can't read '%s'" % path 128 if verboseSearch: print "::: " + path 131 if verboseSearch: print "*** " + path 133 list = cpp.BlockParser().parseFile(path) [all …]
|
D | update_all.py | 24 """ % { "progname" : os.path.basename(sys.argv[0]) } 29 update_dir = os.path.join(get_kernel_dir(), update_rel_dir) 33 src_dir = os.path.normpath(os.path.join(original_dir, src_rel_dir)) 35 mod_src_dir = os.path.join(modified_dir, src_rel_dir) 36 update_dir = os.path.join(get_kernel_dir(), update_rel_dir) 41 _, ext = os.path.splitext(file) 44 src_file = os.path.normpath(os.path.join(root, file)) 47 if os.path.exists(os.path.join(mod_src_dir, rel_path)): 48 src_file = os.path.join(mod_src_dir, rel_path) 49 src_str = os.path.join("<modified>", src_rel_dir, rel_path) [all …]
|
D | clean_header.py | 87 if not os.path.exists(src_file): 91 if not os.path.isfile(src_file): 145 """ % os.path.basename(sys.argv[0]) 181 for path in args: 182 dst_file = os.path.join(dst_dir, path) 183 src_file = os.path.join(src_dir, path) 184 new_data = cleanupFile(dst_file, src_file, path) 198 for path in args: 199 dst_file = os.path.join(dst_dir, path) 200 src_file = os.path.join(src_dir, path) [all …]
|
D | utils.py | 11 sys.stderr.write(os.path.basename(sys.argv[0]) + ": error: ") 17 return os.path.join(get_android_root(), "external/kernel-headers") 21 return os.path.join(get_kernel_headers_dir(), "original") 25 return os.path.join(get_kernel_headers_dir(), "modified") 29 return os.path.join(get_android_root(), "bionic/libc/kernel") 56 def create_file_path(path): argument 59 parent = os.path.dirname(path) 64 path = parent 69 if os.path.isdir(dir): 81 def readFile(self,path): argument [all …]
|
/bionic/libc/tools/ |
D | generate-NOTICE.py | 24 def is_interesting(path): argument 25 path = path.lower() 36 if os.path.splitext(path)[1] in uninteresting_extensions: 38 if path.endswith("/notice") or path.endswith("/readme") or path.endswith("/pylintrc"): 121 def do_file(path): argument 122 with open(path, "r") as the_file: 124 content = open(path, "r").read().decode("utf-8") 126 warn("bad UTF-8 in %s" % path) 127 content = open(path, "r").read().decode("iso-8859-1") 132 warn_verbose("ignoring short file %s" % path) [all …]
|
D | symbols.py | 59 lib_dir = os.path.join(out_dir, 'obj') 63 static_lib_dir = os.path.join( 66 '{}_intermediates'.format(os.path.splitext(f)[0])) 68 os.path.join(static_lib_dir, f), 75 lib_dir = os.path.join(out_dir, 'system/lib64') 76 if not os.path.isdir(lib_dir): 77 lib_dir = os.path.join(out_dir, 'system/lib') 81 results |= GetFromElf(os.path.join(lib_dir, f)) 89 results |= GetFromElf(glob.glob(os.path.join(lib_dir, f))[-1])
|
/bionic/linker/ |
D | linker_utils.cpp | 63 std::string dirname(const char* path) { in dirname() argument 64 const char* last_slash = strrchr(path, '/'); in dirname() 66 if (last_slash == path) { in dirname() 71 return std::string(path, last_slash - path); in dirname() 75 bool normalize_path(const char* path, std::string* normalized_path) { in normalize_path() argument 77 if (path[0] != '/') { in normalize_path() 78 PRINT("normalize_path - invalid input: \"%s\", the input path should be absolute", path); in normalize_path() 82 const size_t len = strlen(path) + 1; in normalize_path() 85 const char* in_ptr = path; in normalize_path() 146 const char* const path = normalized_path.c_str(); in parse_zip_path() local [all …]
|
D | linker_main.cpp | 130 static void parse_path(const char* path, const char* delimiters, in parse_path() argument 133 split_path(path, delimiters, &paths); in parse_path() 137 static void parse_LD_LIBRARY_PATH(const char* path) { in parse_LD_LIBRARY_PATH() argument 139 parse_path(path, ":", &ld_libary_paths); in parse_LD_LIBRARY_PATH() 143 static void parse_LD_PRELOAD(const char* path) { in parse_LD_PRELOAD() argument 145 if (path != nullptr) { in parse_LD_PRELOAD() 147 g_ld_preload_names = android::base::Split(path, " :"); in parse_LD_PRELOAD() 194 std::string path; member 210 char path[PATH_MAX]; in get_executable_info() local 211 ssize_t path_len = readlink("/init", path, sizeof(path)); in get_executable_info() [all …]
|
D | linker_config_test.cpp | 97 static bool write_version(const std::string& path, uint32_t version) { in write_version() argument 99 return android::base::WriteStringToFile(content, path); in write_version() 133 android::base::WriteStringToFile(config_str, tmp_file.path); in run_linker_config_smoke_test() 137 std::string executable_path = std::string(tmp_dir.path) + "/some-binary"; in run_linker_config_smoke_test() 138 std::string version_file = std::string(tmp_dir.path) + "/.version"; in run_linker_config_smoke_test() 148 ASSERT_TRUE(Config::read_binary_config(tmp_file.path, in run_linker_config_smoke_test() 249 android::base::WriteStringToFile(config_str, tmp_file.path); in TEST() 253 std::string executable_path = std::string(tmp_dir.path) + "/some-binary"; in TEST() 257 ASSERT_FALSE(Config::read_binary_config(tmp_file.path, in TEST() 263 ASSERT_EQ(std::string(tmp_file.path) + ":6: " in TEST() [all …]
|
/bionic/libc/tzcode/ |
D | bionic.cpp | 81 char* path; in make_path() local 82 if (asprintf(&path, "%s/%s", path_prefix, path_suffix) == -1) { in make_path() 86 return path; in make_path() 112 static int __bionic_open_tzdata_path(const char* path, in __bionic_open_tzdata_path() argument 115 int fd = TEMP_FAILURE_RETRY(open(path, O_RDONLY | O_CLOEXEC)); in __bionic_open_tzdata_path() 126 __FUNCTION__, path, (bytes_read == -1) ? strerror(errno) : "short read"); in __bionic_open_tzdata_path() 132 … fprintf(stderr, "%s: bad magic in \"%s\": \"%.6s\"\n", __FUNCTION__, path, header.tzdata_version); in __bionic_open_tzdata_path() 138 …fprintf(stderr, "%s: couldn't seek to index in \"%s\": %s\n", __FUNCTION__, path, strerror(errno)); in __bionic_open_tzdata_path() 145 __FUNCTION__, path, ntohl(header.data_offset), ntohl(header.index_offset)); in __bionic_open_tzdata_path() 151 fprintf(stderr, "%s: invalid index size in \"%s\": %zd\n", __FUNCTION__, path, index_size); in __bionic_open_tzdata_path() [all …]
|
/bionic/benchmarks/linker_relocation/regen/ |
D | dump_relocs.py | 67 def get_elf_soname(path: Path) -> str: 68 if path in g_path_to_soname_cache: return g_path_to_soname_cache[path] 69 out = do_readelf_query(['-d', str(path)]) 76 result = os.path.basename(path) 77 g_path_to_soname_cache[path] = result 81 def get_elf_needed(path: Path) -> List[str]: 83 out = do_readelf_query(['-d', str(path)]) 105 def get_dyn_symbols(path: Path) -> DynSymbols: 115 out = do_readelf_query(['--dyn-syms', str(path)]) 152 def scan_relocations(path: Path, syms: DynSymbols) -> Relocations: [all …]
|
/bionic/tools/versioner/ |
D | run_tests.py | 21 def run_test(test_name, path): argument 22 os.chdir(path) 27 if os.path.exists("expected_fail"): 63 root_dir = os.path.dirname(os.path.realpath(__file__)) 64 test_dir = os.path.join(root_dir, "tests") 79 path = os.path.join(test_dir, test) variable 80 if not os.path.isdir(path): 82 if not run_test(test, path):
|
/bionic/tools/versioner/src/ |
D | Utils.h | 34 static inline std::string dirname(const std::string& path) { in dirname() argument 35 std::unique_ptr<char, decltype(&free)> path_copy(strdup(path.c_str()), free); in dirname() 39 static inline bool is_directory(const std::string& path) { in is_directory() argument 41 if (stat(path.c_str(), &st) == 0 && S_ISDIR(st.st_mode)) { in is_directory() 47 static inline bool mkdirs(const std::string& path) { in mkdirs() argument 48 if (is_directory(path)) { in mkdirs() 52 std::string parent = dirname(path); in mkdirs() 53 if (parent == path) { in mkdirs() 61 if (mkdir(path.c_str(), 0700) != 0) { in mkdirs() 65 return is_directory(path); in mkdirs()
|