/system/tools/aidl/ |
H A D | import_resolver.cpp | 36 for (string path : import_paths) { 37 if (path.empty()) { 38 path = "."; 40 if (path[path.size() - 1] != OS_PATH_SEPARATOR) { 41 path += OS_PATH_SEPARATOR; 43 import_paths_.push_back(std::move(path)); 49 // Convert the canonical name to a relative file path. 58 // Look for that relative path at each of our import roots. 59 for (string path [all...] |
/system/core/include/cutils/ |
H A D | android_get_control_file.h | 28 * descriptor of our init-managed file. `path' is the filename path as 31 int android_get_control_file(const char* path);
|
H A D | fs.h | 46 extern int fs_prepare_dir(const char* path, mode_t mode, uid_t uid, gid_t gid); 52 extern int fs_prepare_dir_strict(const char* path, mode_t mode, uid_t uid, gid_t gid); 58 extern int fs_prepare_file_strict(const char* path, mode_t mode, uid_t uid, gid_t gid); 65 extern int fs_read_atomic_int(const char* path, int* value); 71 extern int fs_write_atomic_int(const char* path, int value); 74 * Ensure that all directories along given path exist, creating parent 75 * directories as needed. Validates that given path is absolute and that 76 * it contains no relative "." or ".." paths or symlinks. Last path segment 77 * is treated as filename and ignored, unless the path ends with "/". 79 extern int fs_mkdirs(const char* path, mode_ [all...] |
/system/core/libcutils/include/cutils/ |
H A D | android_get_control_file.h | 28 * descriptor of our init-managed file. `path' is the filename path as 31 int android_get_control_file(const char* path);
|
H A D | fs.h | 46 extern int fs_prepare_dir(const char* path, mode_t mode, uid_t uid, gid_t gid); 52 extern int fs_prepare_dir_strict(const char* path, mode_t mode, uid_t uid, gid_t gid); 58 extern int fs_prepare_file_strict(const char* path, mode_t mode, uid_t uid, gid_t gid); 65 extern int fs_read_atomic_int(const char* path, int* value); 71 extern int fs_write_atomic_int(const char* path, int value); 74 * Ensure that all directories along given path exist, creating parent 75 * directories as needed. Validates that given path is absolute and that 76 * it contains no relative "." or ".." paths or symlinks. Last path segment 77 * is treated as filename and ignored, unless the path ends with "/". 79 extern int fs_mkdirs(const char* path, mode_ [all...] |
/system/core/libcutils/include_vndk/cutils/ |
H A D | android_get_control_file.h | 28 * descriptor of our init-managed file. `path' is the filename path as 31 int android_get_control_file(const char* path);
|
H A D | fs.h | 46 extern int fs_prepare_dir(const char* path, mode_t mode, uid_t uid, gid_t gid); 52 extern int fs_prepare_dir_strict(const char* path, mode_t mode, uid_t uid, gid_t gid); 58 extern int fs_prepare_file_strict(const char* path, mode_t mode, uid_t uid, gid_t gid); 65 extern int fs_read_atomic_int(const char* path, int* value); 71 extern int fs_write_atomic_int(const char* path, int value); 74 * Ensure that all directories along given path exist, creating parent 75 * directories as needed. Validates that given path is absolute and that 76 * it contains no relative "." or ".." paths or symlinks. Last path segment 77 * is treated as filename and ignored, unless the path ends with "/". 79 extern int fs_mkdirs(const char* path, mode_ [all...] |
/system/vold/ |
H A D | Process.h | 24 static int killProcessesWithOpenFiles(const char *path, int signal); 26 static int checkSymLink(int pid, const char *path, const char *name); 27 static int checkFileMaps(int pid, const char *path); 28 static int checkFileMaps(int pid, const char *path, char *openFilename, size_t max); 33 static int readSymLink(const char *path, char *link, size_t max); 34 static int pathMatchesMountPoint(const char *path, const char *mountPoint); 39 void vold_killProcessesWithOpenFiles(const char *path, int signal);
|
H A D | Process.cpp | 42 int Process::readSymLink(const char *path, char *link, size_t max) { argument 46 if (lstat(path, &s) < 0) 52 length = readlink(path, link, max- 1); 59 int Process::pathMatchesMountPoint(const char* path, const char* mountPoint) { argument 61 if (length > 1 && strncmp(path, mountPoint, length) == 0) { 66 // there is one in the path to avoid partial matches. 67 return (path[length] == 0 || path[length] == '/'); 86 // compute path to process's directory of open files 87 char path[PATH_MA local 139 const char* path = strchr(buffer, '/'); local 155 char path[PATH_MAX]; local 173 vold_killProcessesWithOpenFiles(const char *path, int signal) argument 180 killProcessesWithOpenFiles(const char *path, int signal) argument [all...] |
H A D | FileDeviceUtils.h | 26 // Given a file path, look for the corresponding block device in /proc/mount 27 std::string BlockDeviceForPath(const std::string &path); 30 std::unique_ptr<struct fiemap> PathFiemap(const std::string &path, uint32_t extent_count);
|
/system/update_engine/payload_consumer/ |
H A D | file_writer_unittest.cc | 41 string path; local 42 ASSERT_TRUE(utils::MakeTempFile("FileWriterTest-XXXXXX", &path, nullptr)); 43 ScopedPathUnlinker path_unlinker(path); 46 EXPECT_EQ(0, file_writer.Open(path.c_str(), 51 EXPECT_TRUE(utils::ReadFile(path, &actual_data)); 59 const string path("/tmp/ENOENT/FileWriterTest"); 60 EXPECT_EQ(-ENOENT, file_writer.Open(path.c_str(), 66 string path; local 67 ASSERT_TRUE(utils::MakeTempFile("FileWriterTest-XXXXXX", &path, nullptr)); 68 ScopedPathUnlinker path_unlinker(path); [all...] |
/system/extras/simpleperf/ |
H A D | cmd_report_sample_test.cpp | 37 {"-i", GetTestData(PERF_DATA_WITH_SYMBOLS), "-o", tmpfile.path})); 43 "-o", tmpfile.path, "--show-callchain"})); 50 "-o", tmpfile.path, "--protobuf"})); 52 {"--dump-protobuf-report", tmpfile.path, "-o", tmpfile2.path})); 54 ASSERT_TRUE(android::base::ReadFileToString(tmpfile2.path, &data)); 62 "-o", tmpfile.path, "--protobuf"})); 63 ASSERT_TRUE(ReportSampleCmd()->Run({"--dump-protobuf-report", tmpfile.path, "-o", 64 tmpfile2.path})); 65 // If wrong ips in callchain are omitted, "unknown" file path wil [all...] |
/system/tools/hidl/c2hal/test/ |
H A D | build_all.py | 20 from os.path import isfile, join as path_join 29 path = args.path 32 success, failure = genFiles(path, is_open_gl) 43 parser.add_argument("path", help="location of headers to parse", type=str) 48 def genFiles(path, is_open_gl): 52 for header in sorted(headers(path)): 62 command += [path_join(path, header)] 73 def headers(path): 75 for item in listdir(path) [all...] |
/system/tpm/tpm_manager/server/ |
H A D | local_data_store_impl.cc | 40 FilePath path(kTpmLocalDataFile); 41 if (!base::PathExists(path)) { 46 if (base::GetPosixFilePermissions(path, &permissions) && 48 base::SetPosixFilePermissions(path, kLocalDataPermissions); 51 if (!ReadFileToString(path, &file_data)) { 68 FilePath path(kTpmLocalDataFile); 69 if (!base::CreateDirectory(path.DirName())) { 70 LOG(ERROR) << "Cannot create directory: " << path.DirName().value(); 73 if (!base::ImportantFileWriter::WriteFileAtomically(path, file_data)) { 74 LOG(ERROR) << "Failed to write file: " << path [all...] |
/system/core/base/ |
H A D | file.cpp | 70 bool ReadFileToString(const std::string& path, std::string* content, bool follow_symlinks) { argument 74 android::base::unique_fd fd(TEMP_FAILURE_RETRY(open(path.c_str(), flags))); 95 static bool CleanUpAfterFailedWrite(const std::string& path) { argument 98 unlink(path.c_str()); 104 bool WriteStringToFile(const std::string& content, const std::string& path, argument 109 android::base::unique_fd fd(TEMP_FAILURE_RETRY(open(path.c_str(), flags, mode))); 119 return CleanUpAfterFailedWrite(path); 123 return CleanUpAfterFailedWrite(path); 127 return CleanUpAfterFailedWrite(path); 133 bool WriteStringToFile(const std::string& content, const std::string& path, argument 168 RemoveFileIfExists(const std::string& path, std::string* err) argument 196 Readlink(const std::string& path, std::string* result) argument 220 Realpath(const std::string& path, std::string* result) argument 235 std::string path; local 263 Basename(const std::string& path) argument 288 Dirname(const std::string& path) argument [all...] |
H A D | file_test.cpp | 40 ASSERT_TRUE(android::base::WriteStringToFile("abc", tf.path)) 43 ASSERT_TRUE(android::base::ReadFileToString(tf.path, &s)) 52 ASSERT_EQ(0, unlink(link.path)); 53 ASSERT_EQ(0, symlink(target.path, link.path)); 54 ASSERT_FALSE(android::base::WriteStringToFile("foo", link.path, false)); 56 ASSERT_TRUE(android::base::WriteStringToFile("foo", link.path, true)); 59 ASSERT_FALSE(android::base::ReadFileToString(link.path, &s)); 61 ASSERT_TRUE(android::base::ReadFileToString(link.path, &s, true)); 72 ASSERT_TRUE(android::base::WriteStringToFile("abc", tf.path, 066 170 std::string path = dir_name + "/../" + base_dir_name + "/" + basename; local 177 std::string path = std::string(td.path) + "/.."; local 185 std::string path = std::string(td.path) + "/foo.noent"; local 195 std::string path = android::base::GetExecutableDirectory(); local 197 ASSERT_NE(android::base::GetExecutablePath(), path); local [all...] |
/system/tools/hidl/ |
H A D | Hash.cpp | 30 const Hash &Hash::getHash(const std::string &path) { argument 33 auto it = hashes.find(path); 35 if (hashes.find(path) == hashes.end()) { 36 it = hashes.insert(it, {path, Hash(path)}); 42 static std::vector<uint8_t> sha256File(const std::string &path) { argument 43 std::ifstream stream(path); 56 Hash::Hash(const std::string &path) argument 57 : mPath(path), 58 mHash(sha256File(path)) {} 93 parse(const std::string &path, std::string *err) argument 115 readHashFile(const std::string &path, std::string *err) argument 155 std::string path; member in struct:android::HashFile 159 lookupHash(const std::string &path, const std::string &interfaceName, std::string *err) argument [all...] |
/system/core/init/ |
H A D | util_test.cpp | 47 EXPECT_TRUE(WriteFile(tf.path, s, &err)) << strerror(errno); 49 EXPECT_NE(-1, fchmodat(AT_FDCWD, tf.path, 0620, AT_SYMLINK_NOFOLLOW)) << strerror(errno); 50 EXPECT_FALSE(ReadFile(tf.path, &s, &err)) << strerror(errno); 51 EXPECT_EQ("Skipping insecure file '"s + tf.path + "'", err); 60 EXPECT_TRUE(WriteFile(tf.path, s, &err)) << strerror(errno); 62 EXPECT_NE(-1, fchmodat(AT_FDCWD, tf.path, 0602, AT_SYMLINK_NOFOLLOW)) << strerror(errno); 63 EXPECT_FALSE(ReadFile(tf.path, &s, &err)) << strerror(errno); 64 EXPECT_EQ("Skipping insecure file '"s + tf.path + "'", err); 100 EXPECT_TRUE(WriteFile(tf.path, contents, &err)) << strerror(errno); 104 EXPECT_TRUE(ReadFile(tf.path, 114 std::string path = android::base::StringPrintf("%s/does-not-exist", test_dir.path); local 172 std::string path = android::base::StringPrintf("%s/three/directories/deep", test_dir.path); local 184 std::string path = android::base::StringPrintf("%s/three////directories/deep//", test_dir.path); local [all...] |
H A D | devices.cpp | 50 /* Given a path that may start with a PCI device, populate the supplied buffer 53 static bool FindPciDevicePrefix(const std::string& path, std::string* result) { argument 56 if (!StartsWith(path, "/devices/pci")) return false; 61 /* End of the prefix is two path '/' later, capturing the domain/bus number 63 auto end = path.find('/', start); 66 end = path.find('/', end + 1); 76 *result = path.substr(start, length); 80 /* Given a path that may start with a virtual block device, populate 84 static bool FindVbdDevicePrefix(const std::string& path, std::string* result) { argument 87 if (!StartsWith(path, "/device 134 MatchWithSubsystem(const std::string& path, const std::string& subsystem) const argument 163 FindPlatformDevice(std::string path, std::string* platform_device_path) const argument 195 std::string path = "/sys" + upath; local 209 GetDevicePermissions( const std::string& path, const std::vector<std::string>& links) const argument 222 MakeDevice(const std::string& path, bool block, int major, int minor, const std::vector<std::string>& links) const argument 248 PLOG(ERROR) << "setegid(" << gid << ") for " << path << " device failed"; local 265 PLOG(ERROR) << "Cannot set '" << secontext << "' SELinux label on '" << path local [all...] |
/system/core/libcutils/ |
H A D | canned_fs_config.c | 30 const char* path; member in struct:__anon1538 42 return strcmp(((Path*)a)->path, ((Path*)b)->path); 68 p->path = strdup(rootdir ? "" : strtok(line, " ")); 95 void canned_fs_config(const char* path, int dir, const char* target_out_path, argument 99 key.path = path; 100 if (path[0] == '/') key.path++; // canned paths lack the leading '/' 103 fprintf(stderr, "failed to find [%s] in canned fs_config\n", path); [all...] |
H A D | fs.c | 41 static int fs_prepare_path_impl(const char* path, mode_t mode, uid_t uid, gid_t gid, argument 43 // Check if path needs to be created 46 if (TEMP_FAILURE_RETRY(lstat(path, &sb)) == -1) { 50 ALOGE("Failed to lstat(%s): %s", path, strerror(errno)); 58 ALOGE("Not a %s: %s", (prepare_as_dir ? "directory" : "regular file"), path); 70 ALOGE("Expected path %s with owner %d:%d but found %d:%d", 71 path, uid, gid, sb.st_uid, sb.st_gid); 74 ALOGW("Expected path %s with mode %o but found %o", 75 path, mode, (sb.st_mode & ALL_PERMS)); 82 ? TEMP_FAILURE_RETRY(mkdir(path, mod 109 fs_prepare_dir(const char* path, mode_t mode, uid_t uid, gid_t gid) argument 113 fs_prepare_dir_strict(const char* path, mode_t mode, uid_t uid, gid_t gid) argument 117 fs_prepare_file_strict(const char* path, mode_t mode, uid_t uid, gid_t gid) argument 121 fs_read_atomic_int(const char* path, int* out_value) argument 146 fs_write_atomic_int(const char* path, int value) argument 190 fs_mkdirs(const char* path, mode_t mode) argument [all...] |
/system/core/healthd/ |
H A D | BatteryMonitor.cpp | 135 int BatteryMonitor::readFromFile(const String8& path, std::string* buf) { argument 136 if (android::base::ReadFileToString(path.c_str(), buf)) { 142 BatteryMonitor::PowerSupplyType BatteryMonitor::readPowerSupplyType(const String8& path) { argument 162 if (readFromFile(path, &buf) <= 0) 174 bool BatteryMonitor::getBooleanField(const String8& path) { argument 178 if (readFromFile(path, &buf) > 0) 185 int BatteryMonitor::getIntField(const String8& path) { argument 189 if (readFromFile(path, &buf) > 0) 250 String8 path; local 251 path 475 String8 path; local [all...] |
/system/core/base/include/android-base/ |
H A D | file.h | 31 bool ReadFileToString(const std::string& path, std::string* content, 34 bool WriteStringToFile(const std::string& content, const std::string& path, 39 bool WriteStringToFile(const std::string& content, const std::string& path, 47 bool RemoveFileIfExists(const std::string& path, std::string* err = nullptr); 50 bool Realpath(const std::string& path, std::string* result); 51 bool Readlink(const std::string& path, std::string* result); 59 std::string Basename(const std::string& path); 60 std::string Dirname(const std::string& path);
|
/system/core/libprocessgroup/ |
H A D | processgroup.cpp | 104 static int convertUidToPath(char *path, size_t size, uid_t uid) argument 106 return snprintf(path, size, "%s/%s%d", 112 static int convertUidPidToPath(char *path, size_t size, uid_t uid, int pid) argument 114 return snprintf(path, size, "%s/%s%d/%s%d", 123 char path[PROCESSGROUP_MAX_PATH_LEN] = {0}; local 124 convertUidPidToPath(path, sizeof(path), uid, pid); 125 strlcat(path, PROCESSGROUP_CGROUP_PROCS_FILE, sizeof(path)); 127 int fd = open(path, O_RDONL 188 char path[PROCESSGROUP_MAX_PATH_LEN] = {0}; local 205 char path[PROCESSGROUP_MAX_PATH_LEN]; local 232 char path[PROCESSGROUP_MAX_PATH_LEN]; local 372 mkdirAndChown(const char *path, mode_t mode, uid_t uid, gid_t gid) argument 390 char path[PROCESSGROUP_MAX_PATH_LEN] = {0}; local 411 PLOG(ERROR) << "Failed to write '" << initialPid << "' to " << path; local 418 char path[PROCESSGROUP_MAX_PATH_LEN] = {0}; local 428 PLOG(ERROR) << "Failed to write '" << value << "' to " << path; local [all...] |
/system/update_engine/ |
H A D | fake_shill_proxy.cc | 32 const dbus::ObjectPath& path) { 33 auto it = service_proxy_mocks_.find(path.value()); 35 << path.value(); 42 const dbus::ObjectPath& path, 44 service_proxy_mocks_[path.value()] = std::move(service_proxy); 31 GetServiceForPath( const dbus::ObjectPath& path) argument 41 SetServiceForPath( const dbus::ObjectPath& path, std::unique_ptr<ServiceProxyInterface> service_proxy) argument
|