Home
last modified time | relevance | path

Searched refs:path (Results 1 – 25 of 422) sorted by relevance

12345678910>>...17

/system/core/libprocessgroup/
Dprocessgroup.cpp87 static int convertUidToPath(char *path, size_t size, uid_t uid) in convertUidToPath() argument
89 return snprintf(path, size, "%s/%s%d", in convertUidToPath()
95 static int convertUidPidToPath(char *path, size_t size, uid_t uid, int pid) in convertUidPidToPath() argument
97 return snprintf(path, size, "%s/%s%d/%s%d", in convertUidPidToPath()
108 char path[PROCESSGROUP_MAX_PATH_LEN] = {0}; in initCtx() local
109 convertUidPidToPath(path, sizeof(path), uid, pid); in initCtx()
110 strlcat(path, PROCESSGROUP_CGROUP_PROCS_FILE, sizeof(path)); in initCtx()
112 int fd = open(path, O_RDONLY); in initCtx()
115 SLOGW("failed to open %s: %s", path, strerror(errno)); in initCtx()
124 SLOGV("Initialized context for %s", path); in initCtx()
[all …]
/system/core/healthd/
DBatteryMonitor.cpp127 int BatteryMonitor::readFromFile(const String8& path, char* buf, size_t size) { in readFromFile() argument
130 if (path.isEmpty()) in readFromFile()
132 int fd = open(path.string(), O_RDONLY, 0); in readFromFile()
134 KLOG_ERROR(LOG_TAG, "Could not open '%s'\n", path.string()); in readFromFile()
151 BatteryMonitor::PowerSupplyType BatteryMonitor::readPowerSupplyType(const String8& path) { in readPowerSupplyType() argument
154 int length = readFromFile(path, buf, SIZE); in readPowerSupplyType()
185 bool BatteryMonitor::getBooleanField(const String8& path) { in getBooleanField() argument
190 if (readFromFile(path, buf, SIZE) > 0) { in getBooleanField()
199 int BatteryMonitor::getIntField(const String8& path) { in getIntField() argument
204 if (readFromFile(path, buf, SIZE) > 0) { in getIntField()
[all …]
/system/vold/
DProcess.cpp35 int Process::readSymLink(const char *path, char *link, size_t max) { in readSymLink() argument
39 if (lstat(path, &s) < 0) in readSymLink()
45 length = readlink(path, link, max- 1); in readSymLink()
52 int Process::pathMatchesMountPoint(const char* path, const char* mountPoint) { in pathMatchesMountPoint() argument
54 if (length > 1 && strncmp(path, mountPoint, length) == 0) { in pathMatchesMountPoint()
60 return (path[length] == 0 || path[length] == '/'); in pathMatchesMountPoint()
87 char path[PATH_MAX]; in checkFileDescriptorSymLinks() local
88 sprintf(path, "/proc/%d/fd", pid); in checkFileDescriptorSymLinks()
89 DIR *dir = opendir(path); in checkFileDescriptorSymLinks()
94 int parent_length = strlen(path); in checkFileDescriptorSymLinks()
[all …]
Dsecdiscard.cpp46 int secdiscard_path(const std::string &path);
47 std::unique_ptr<struct fiemap> path_fiemap(const std::string &path, uint32_t extent_count);
48 bool check_fiemap(const struct fiemap &fiemap, const std::string &path);
50 std::string block_device_for_path(const std::string &path);
98 int secdiscard_path(const std::string &path) { in secdiscard_path() argument
99 auto fiemap = path_fiemap(path, max_extents); in secdiscard_path()
100 if (!fiemap || !check_fiemap(*fiemap, path)) { in secdiscard_path()
103 auto block_device = block_device_for_path(path); in secdiscard_path()
117 PLOG(ERROR) << "Unable to BLKSECDISCARD " << path; in secdiscard_path()
125 std::unique_ptr<struct fiemap> path_fiemap(const std::string &path, uint32_t extent_count) in path_fiemap() argument
[all …]
DProcess.h24 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);
/system/tools/aidl/
Dimport_resolver.cpp36 for (string path : import_paths) { in ImportResolver() local
37 if (path.empty()) { in ImportResolver()
38 path = "."; in ImportResolver()
40 if (path[path.size() - 1] != OS_PATH_SEPARATOR) { in ImportResolver()
41 path += OS_PATH_SEPARATOR; in ImportResolver()
43 import_paths_.push_back(std::move(path)); in ImportResolver()
59 for (string path : import_paths_) { in FindImportFile() local
60 path = path + relative_path; in FindImportFile()
61 if (io_delegate_.FileIsReadable(path)) { in FindImportFile()
62 return path; in FindImportFile()
Dio_delegate.cpp44 bool IoDelegate::GetAbsolutePath(const string& path, string* absolute_path) { in GetAbsolutePath() argument
48 DWORD path_len = GetFullPathName(path.c_str(), sizeof(buf), buf, nullptr); in GetAbsolutePath()
50 LOG(ERROR) << "Failed to GetFullPathName(" << path << ")"; in GetAbsolutePath()
59 if (path.empty()) { in GetAbsolutePath()
64 if (path[0] == OS_PATH_SEPARATOR) { in GetAbsolutePath()
65 *absolute_path = path; in GetAbsolutePath()
78 *absolute_path += path; in GetAbsolutePath()
110 bool IoDelegate::FileIsReadable(const string& path) const { in FileIsReadable()
113 return (0 == _access(path.c_str(), 0)) && // mode 0=exist in FileIsReadable()
114 (0 == _access(path.c_str(), 4)); // mode 4=readable in FileIsReadable()
[all …]
/system/core/libcutils/
Dfs.c40 static int fs_prepare_path_impl(const char* path, mode_t mode, uid_t uid, gid_t gid, in fs_prepare_path_impl() argument
45 if (TEMP_FAILURE_RETRY(lstat(path, &sb)) == -1) { in fs_prepare_path_impl()
49 ALOGE("Failed to lstat(%s): %s", path, strerror(errno)); in fs_prepare_path_impl()
57 ALOGE("Not a %s: %s", (prepare_as_dir ? "directory" : "regular file"), path); in fs_prepare_path_impl()
70 path, uid, gid, sb.st_uid, sb.st_gid); in fs_prepare_path_impl()
74 path, mode, (sb.st_mode & ALL_PERMS)); in fs_prepare_path_impl()
81 ? TEMP_FAILURE_RETRY(mkdir(path, mode)) in fs_prepare_path_impl()
82 : TEMP_FAILURE_RETRY(open(path, O_CREAT | O_CLOEXEC | O_NOFOLLOW | O_RDONLY)); in fs_prepare_path_impl()
86 (prepare_as_dir ? "mkdir" : "open"), path, strerror(errno)); in fs_prepare_path_impl()
92 ALOGW("Failed to close file after create %s: %s", path, strerror(errno)); in fs_prepare_path_impl()
[all …]
Dcanned_fs_config.c28 const char* path; member
40 return strcmp(((Path*)a)->path, ((Path*)b)->path); in path_compare()
57 p->path = strdup(strtok(line, " ")); in load_canned_fs_config()
85 void canned_fs_config(const char* path, int dir, const char* target_out_path, in canned_fs_config() argument
88 key.path = path; in canned_fs_config()
89 if (path[0] == '/') in canned_fs_config()
90 key.path++; // canned paths lack the leading '/' in canned_fs_config()
93 fprintf(stderr, "failed to find [%s] in canned fs_config\n", path); in canned_fs_config()
106 fs_config(path, dir, target_out_path, &c_uid, &c_gid, &c_mode, &c_capabilities); in canned_fs_config()
108 if (c_uid != *uid) printf("%s uid %d %d\n", path, *uid, c_uid); in canned_fs_config()
[all …]
/system/connectivity/shill/cellular/
Dmodem_manager.cc37 const string& path, in ModemManager() argument
41 path_(path), in ModemManager()
68 bool ModemManager::ModemExists(const std::string& path) const { in ModemExists()
70 if (ContainsKey(modems_, path)) { in ModemExists()
71 LOG(INFO) << "ModemExists: " << path << " already exists."; in ModemExists()
79 modems_[modem->path()] = modem; in RecordAddedModem()
82 void ModemManager::RemoveModem(const string& path) { in RemoveModem() argument
83 LOG(INFO) << "Remove modem: " << path; in RemoveModem()
85 modems_.erase(path); in RemoveModem()
98 const string& path, in ModemManagerClassic() argument
[all …]
/system/connectivity/shill/dbus/
Dchromeos_dbus_control.cc282 const string& path, in CreateDBusPropertiesProxy() argument
284 return new ChromeosDBusPropertiesProxy(proxy_bus_, path, service); in CreateDBusPropertiesProxy()
289 const string& path, in CreateDBusObjectManagerProxy() argument
295 path, in CreateDBusObjectManagerProxy()
304 const string& path, in CreateModemManagerProxy() argument
311 path, in CreateModemManagerProxy()
318 const string& path, in CreateModemProxy() argument
320 return new ChromeosModemProxy(proxy_bus_, path, service); in CreateModemProxy()
324 const string& path, in CreateModemSimpleProxy() argument
326 return new ChromeosModemSimpleProxy(proxy_bus_, path, service); in CreateModemSimpleProxy()
[all …]
Dchromeos_dbus_control.h91 const std::string& path,
95 const std::string& path,
102 const std::string& path,
107 ModemProxyInterface* CreateModemProxy(const std::string& path,
111 const std::string& path,
115 const std::string& path,
119 const std::string& path,
123 const std::string& path,
127 const std::string& path,
132 const std::string& path,
[all …]
/system/media/audio_route/
Daudio_route.c82 struct mixer_path *path; member
127 static void path_print(struct audio_route *ar, struct mixer_path *path)
132 ALOGE("Path: %s, length: %d", path->name, path->length);
133 for (i = 0; i < path->length; i++) {
134 struct mixer_ctl *ctl = index_to_ctl(ar, path->setting[i].ctl_index);
138 for (j = 0; j < path->setting[i].num_values; j++)
139 ALOGE(" id=%d value=0x%02x", j, path->setting[i].value.bytes[j]);
141 for (j = 0; j < path->setting[i].num_values; j++)
142 ALOGE(" id=%d value=%d", j, path->setting[i].value.enumerated[j]);
144 for (j = 0; j < path->setting[i].num_values; j++)
[all …]
/system/tpm/tpm_manager/server/
Dlocal_data_store_impl.cc36 FilePath path(kTpmLocalDataFile); in Read() local
37 if (!base::PathExists(path)) { in Read()
42 if (base::GetPosixFilePermissions(path, &permissions) && in Read()
44 base::SetPosixFilePermissions(path, kLocalDataPermissions); in Read()
47 if (!ReadFileToString(path, &file_data)) { in Read()
64 FilePath path(kTpmLocalDataFile); in Write() local
65 if (!base::CreateDirectory(path.DirName())) { in Write()
66 LOG(ERROR) << "Cannot create directory: " << path.DirName().value(); in Write()
69 if (!base::ImportantFileWriter::WriteFileAtomically(path, file_data)) { in Write()
70 LOG(ERROR) << "Failed to write file: " << path.value(); in Write()
[all …]
/system/update_engine/payload_consumer/
Dfile_writer_unittest.cc41 string path; in TEST() local
42 ASSERT_TRUE(utils::MakeTempFile("FileWriterTest-XXXXXX", &path, nullptr)); in TEST()
43 ScopedPathUnlinker path_unlinker(path); in TEST()
46 EXPECT_EQ(0, file_writer.Open(path.c_str(), in TEST()
51 EXPECT_TRUE(utils::ReadFile(path, &actual_data)); in TEST()
59 const string path("/tmp/ENOENT/FileWriterTest"); in TEST() local
60 EXPECT_EQ(-ENOENT, file_writer.Open(path.c_str(), in TEST()
66 string path; in TEST() local
67 ASSERT_TRUE(utils::MakeTempFile("FileWriterTest-XXXXXX", &path, nullptr)); in TEST()
68 ScopedPathUnlinker path_unlinker(path); in TEST()
[all …]
/system/connectivity/shill/
Dfile_reader_unittest.cc35 void VerifyReadLines(const FilePath& path, const vector<string>& lines) { in VerifyReadLines() argument
38 EXPECT_TRUE(reader_.Open(path)); in VerifyReadLines()
59 FilePath path; in TEST_F() local
60 ASSERT_TRUE(base::CreateTemporaryFileInDir(temp_dir.path(), &path)); in TEST_F()
62 EXPECT_TRUE(reader_.Open(path)); in TEST_F()
78 FilePath path; in TEST_F() local
79 ASSERT_TRUE(base::CreateTemporaryFileInDir(temp_dir.path(), &path)); in TEST_F()
83 base::WriteFile(path, content.c_str(), content.size())); in TEST_F()
84 VerifyReadLines(path, lines); in TEST_F()
89 base::WriteFile(path, content.c_str(), content.size())); in TEST_F()
[all …]
Dnice_mock_control.h93 DBusPropertiesProxyInterface*(const std::string& path,
98 const std::string& path,
105 const std::string& path,
110 ModemProxyInterface*(const std::string& path,
113 ModemSimpleProxyInterface*(const std::string& path,
117 ModemCDMAProxyInterface*(const std::string& path,
120 ModemGSMCardProxyInterface*(const std::string& path,
123 ModemGSMNetworkProxyInterface*(const std::string& path,
126 ModemGobiProxyInterface*(const std::string& path,
129 mm1::ModemModem3gppProxyInterface*(const std::string& path,
[all …]
Dmock_control.h93 DBusPropertiesProxyInterface*(const std::string& path,
98 const std::string& path,
105 const std::string& path,
110 ModemProxyInterface*(const std::string& path,
113 ModemSimpleProxyInterface*(const std::string& path,
117 ModemCDMAProxyInterface*(const std::string& path,
120 ModemGSMCardProxyInterface*(const std::string& path,
123 ModemGSMNetworkProxyInterface*(const std::string& path,
126 ModemGobiProxyInterface*(const std::string& path,
129 mm1::ModemModem3gppProxyInterface*(const std::string& path,
[all …]
/system/core/init/
Dinit_parser.cpp95 bool Parser::ParseConfigFile(const std::string& path) { in ParseConfigFile() argument
96 INFO("Parsing file %s...\n", path.c_str()); in ParseConfigFile()
99 if (!read_file(path.c_str(), &data)) { in ParseConfigFile()
104 ParseData(path, data); in ParseConfigFile()
106 sp.second->EndFile(path); in ParseConfigFile()
113 NOTICE("(Parsing %s took %.2fs.)\n", path.c_str(), t.duration()); in ParseConfigFile()
117 bool Parser::ParseConfigDir(const std::string& path) { in ParseConfigDir() argument
118 INFO("Parsing directory %s...\n", path.c_str()); in ParseConfigDir()
119 std::unique_ptr<DIR, int(*)(DIR*)> config_dir(opendir(path.c_str()), closedir); in ParseConfigDir()
121 ERROR("Could not import directory '%s'\n", path.c_str()); in ParseConfigDir()
[all …]
Ddevices.cpp63 const char *path; member
90 char *path; member
174 static bool perm_path_matches(const char *path, struct perms_ *dp) in perm_path_matches() argument
177 if (strncmp(path, dp->name, strlen(dp->name)) == 0) in perm_path_matches()
180 if (fnmatch(dp->name, path, FNM_PATHNAME) == 0) in perm_path_matches()
183 if (strcmp(path, dp->name) == 0) in perm_path_matches()
190 static mode_t get_device_perm(const char *path, const char **links, in get_device_perm() argument
206 if (perm_path_matches(path, dp)) { in get_device_perm()
232 static void make_device(const char *path, in make_device() argument
243 mode = get_device_perm(path, links, &uid, &gid) | (block ? S_IFBLK : S_IFCHR); in make_device()
[all …]
/system/core/adb/
Dfile_sync_service.cpp43 static bool should_use_fs_config(const std::string& path) { in should_use_fs_config() argument
45 return android::base::StartsWith(path, "/system/") || in should_use_fs_config()
46 android::base::StartsWith(path, "/vendor/") || in should_use_fs_config()
47 android::base::StartsWith(path, "/oem/"); in should_use_fs_config()
50 static bool secure_mkdirs(const std::string& path) { in secure_mkdirs() argument
56 if (path[0] != '/') return false; in secure_mkdirs()
58 std::vector<std::string> path_components = android::base::Split(path, "/"); in secure_mkdirs()
82 static bool do_stat(int s, const char* path) { in do_stat() argument
89 lstat(path, &st); in do_stat()
97 static bool do_list(int s, const char* path) { in do_list() argument
[all …]
Dadb_auth_host.cpp151 char path[PATH_MAX], info[MAX_PAYLOAD_V1]; in write_public_keyfile() local
156 if (snprintf(path, sizeof(path), "%s.pub", private_key_path) >= in write_public_keyfile()
157 (int)sizeof(path)) { in write_public_keyfile()
167 outfile = fopen(path, "w"); in write_public_keyfile()
169 D("Failed to open '%s'", path); in write_public_keyfile()
173 D("Writing public key to '%s'", path); in write_public_keyfile()
313 char path[PATH_MAX]; in get_user_key() local
316 ret = get_user_keyfilepath(path, sizeof(path)); in get_user_key()
317 if (ret < 0 || ret >= (signed)sizeof(path)) { in get_user_key()
322 D("user key '%s'", path); in get_user_key()
[all …]
Dadb_utils.cpp73 bool directory_exists(const std::string& path) { in directory_exists() argument
75 return lstat(path.c_str(), &sb) != -1 && S_ISDIR(sb.st_mode); in directory_exists()
99 std::string adb_basename(const std::string& path) { in adb_basename() argument
101 std::string result(path); in adb_basename()
122 std::string adb_dirname(const std::string& path) { in adb_dirname() argument
124 std::string result(path); in adb_dirname()
147 bool mkdirs(const std::string& path) { in mkdirs() argument
166 if (stat(path.c_str(), &sb) != -1 && S_ISDIR(sb.st_mode)) { in mkdirs()
170 const std::string parent(adb_dirname(path)); in mkdirs()
176 if (parent == path) { in mkdirs()
[all …]
/system/core/base/
Dfile.cpp49 bool ReadFileToString(const std::string& path, std::string* content) { in ReadFileToString() argument
52 int fd = TEMP_FAILURE_RETRY(open(path.c_str(), O_RDONLY | O_CLOEXEC | O_NOFOLLOW | O_BINARY)); in ReadFileToString()
75 static bool CleanUpAfterFailedWrite(const std::string& path) { in CleanUpAfterFailedWrite() argument
78 unlink(path.c_str()); in CleanUpAfterFailedWrite()
84 bool WriteStringToFile(const std::string& content, const std::string& path, in WriteStringToFile() argument
87 int fd = TEMP_FAILURE_RETRY(open(path.c_str(), flags, mode)); in WriteStringToFile()
97 return CleanUpAfterFailedWrite(path); in WriteStringToFile()
101 return CleanUpAfterFailedWrite(path); in WriteStringToFile()
105 return CleanUpAfterFailedWrite(path); in WriteStringToFile()
112 bool WriteStringToFile(const std::string& content, const std::string& path) { in WriteStringToFile() argument
[all …]
/system/update_engine/
Dp2p_manager.cc164 bool DeleteP2PFile(const FilePath& path, const string& reason);
318 bool P2PManagerImpl::DeleteP2PFile(const FilePath& path, in DeleteP2PFile() argument
320 LOG(INFO) << "Deleting p2p file " << path.value() in DeleteP2PFile()
322 if (unlink(path.value().c_str()) != 0) { in DeleteP2PFile()
323 PLOG(ERROR) << "Error deleting p2p file " << path.value(); in DeleteP2PFile()
504 FilePath path = FileGetPath(file_id); in FileShare() local
505 if (!path.empty()) { in FileShare()
510 LOG(ERROR) << "Existing p2p file " << path.value() in FileShare()
540 path = GetPath(file_id, kNonVisible); in FileShare()
541 int fd = open(path.value().c_str(), O_CREAT | O_RDWR, 0644); in FileShare()
[all …]

12345678910>>...17