Home
last modified time | relevance | path

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

12345

/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 …]
DExt4Crypt.h7 int e4crypt_enable(const char* path);
9 int e4crypt_change_password(const char* path, int crypt_type,
11 int e4crypt_crypto_complete(const char* path);
12 int e4crypt_check_passwd(const char* path, const char* password);
13 int e4crypt_get_password_type(const char* path);
14 const char* e4crypt_get_password(const char* path);
15 void e4crypt_clear_password(const char* path);
16 int e4crypt_restart(const char* path);
17 int e4crypt_get_field(const char* path, const char* fieldname,
19 int e4crypt_set_field(const char* path, const char* fieldname,
DExt4Crypt.cpp156 static UnencryptedProperties GetProps(const char* path) in GetProps() argument
158 return UnencryptedProperties(path); in GetProps()
161 static UnencryptedProperties GetAltProps(const char* path) in GetAltProps() argument
163 return UnencryptedProperties((std::string() + path + "/tmp_mnt").c_str()); in GetAltProps()
166 static UnencryptedProperties GetPropsOrAltProps(const char* path) in GetPropsOrAltProps() argument
168 UnencryptedProperties props = GetProps(path); in GetPropsOrAltProps()
172 return GetAltProps(path); in GetPropsOrAltProps()
175 int e4crypt_enable(const char* path) in e4crypt_enable() argument
178 if (s_key_store.find(path) != s_key_store.end()) { in e4crypt_enable()
183 UnencryptedProperties key_props = GetProps(path).GetChild(properties::key); in e4crypt_enable()
[all …]
DProcess.h24 static void 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);
DUtils.cpp60 status_t CreateDeviceNode(const std::string& path, dev_t dev) { in CreateDeviceNode() argument
61 const char* cpath = path.c_str(); in CreateDeviceNode()
75 << ":" << minor(dev) << " at " << path; in CreateDeviceNode()
88 status_t DestroyDeviceNode(const std::string& path) { in DestroyDeviceNode() argument
89 const char* cpath = path.c_str(); in DestroyDeviceNode()
97 status_t PrepareDir(const std::string& path, mode_t mode, uid_t uid, gid_t gid) { in PrepareDir() argument
98 const char* cpath = path.c_str(); in PrepareDir()
121 status_t ForceUnmount(const std::string& path) { in ForceUnmount() argument
122 const char* cpath = path.c_str(); in ForceUnmount()
126 PLOG(WARNING) << "Failed to unmount " << path; in ForceUnmount()
[all …]
DTrimTask.cpp106 static void notifyResult(const std::string& path, int64_t bytes, int64_t delta) { in notifyResult() argument
107 std::string res(path in notifyResult()
117 for (auto path : mPaths) { in run() local
118 LOG(DEBUG) << "Starting trim of " << path; in run()
120 int fd = open(path.c_str(), O_RDONLY | O_DIRECTORY | O_CLOEXEC | O_NOFOLLOW); in run()
122 PLOG(WARNING) << "Failed to open " << path; in run()
132 PLOG(WARNING) << "Trim failed on " << path; in run()
133 notifyResult(path, -1, -1); in run()
136 LOG(INFO) << "Trimmed " << range.len << " bytes on " << path in run()
138 notifyResult(path, range.len, delta); in run()
[all …]
DUtils.h43 status_t CreateDeviceNode(const std::string& path, dev_t dev);
44 status_t DestroyDeviceNode(const std::string& path);
47 status_t PrepareDir(const std::string& path, mode_t mode, uid_t uid, gid_t gid);
50 status_t ForceUnmount(const std::string& path);
56 status_t ReadMetadata(const std::string& path, std::string& fsType,
60 status_t ReadMetadataUntrusted(const std::string& path, std::string& fsType,
83 uint64_t GetFreeBytes(const std::string& path);
84 uint64_t GetTreeBytes(const std::string& path);
89 status_t WipeBlockDevice(const std::string& path);
93 dev_t GetDevice(const std::string& path);
DBenchmark.cpp39 static void notifyResult(const std::string& path, int64_t create_d, in notifyResult() argument
41 std::string res(path + in notifyResult()
51 static nsecs_t benchmark(const std::string& path) { in benchmark() argument
79 if (chdir(path.c_str()) != 0) { in benchmark()
86 LOG(INFO) << "Benchmarking " << path; in benchmark()
130 notifyResult(path, create_d, drop_d, run_d, destroy_d); in benchmark()
135 nsecs_t BenchmarkPrivate(const std::string& path) { in BenchmarkPrivate() argument
136 std::string benchPath(path); in BenchmarkPrivate()
/system/core/libprocessgroup/
Dprocessgroup.cpp48 static int convertUidToPath(char *path, size_t size, uid_t uid) in convertUidToPath() argument
50 return snprintf(path, size, "%s/%s%d", in convertUidToPath()
56 static int convertUidPidToPath(char *path, size_t size, uid_t uid, int pid) in convertUidPidToPath() argument
58 return snprintf(path, size, "%s/%s%d/%s%d", in convertUidPidToPath()
69 char path[PROCESSGROUP_MAX_PATH_LEN] = {0}; in initCtx() local
70 convertUidPidToPath(path, sizeof(path), uid, pid); in initCtx()
71 strlcat(path, PROCESSGROUP_CGROUP_PROCS_FILE, sizeof(path)); in initCtx()
73 int fd = open(path, O_RDONLY); in initCtx()
76 SLOGW("failed to open %s: %s", path, strerror(errno)); in initCtx()
85 SLOGV("Initialized context for %s", path); in initCtx()
[all …]
/system/core/healthd/
DBatteryMonitor.cpp99 int BatteryMonitor::readFromFile(const String8& path, char* buf, size_t size) { in readFromFile() argument
102 if (path.isEmpty()) in readFromFile()
104 int fd = open(path.string(), O_RDONLY, 0); in readFromFile()
106 KLOG_ERROR(LOG_TAG, "Could not open '%s'\n", path.string()); in readFromFile()
123 BatteryMonitor::PowerSupplyType BatteryMonitor::readPowerSupplyType(const String8& path) { in readPowerSupplyType() argument
126 int length = readFromFile(path, buf, SIZE); in readPowerSupplyType()
151 bool BatteryMonitor::getBooleanField(const String8& path) { in getBooleanField() argument
156 if (readFromFile(path, buf, SIZE) > 0) { in getBooleanField()
165 int BatteryMonitor::getIntField(const String8& path) { in getIntField() argument
170 if (readFromFile(path, buf, SIZE) > 0) { in getIntField()
[all …]
/system/core/toolbox/
Dlsof.c54 char path[PATH_MAX]; member
77 strlcat(info->path, type, sizeof(info->path)); in print_type()
78 if ((link_dest_size = readlink(info->path, link_dest, sizeof(link_dest)-1)) < 0) { in print_type()
82 snprintf(link_dest, sizeof(link_dest), "%s (readlink: %s)", info->path, strerror(errno)); in print_type()
96 info->path[info->parent_length] = '\0'; in print_type()
108 strlcat(info->path, "maps", sizeof(info->path)); in print_maps()
110 maps = fopen(info->path, "r"); in print_maps()
128 info->path[info->parent_length] = '\0'; in print_maps()
135 strlcat(info->path, fd_path, sizeof(info->path)); in print_fds()
140 DIR *dir = opendir(info->path); in print_fds()
[all …]
/system/core/libcutils/
Dfs.c40 int fs_prepare_dir(const char* path, mode_t mode, uid_t uid, gid_t gid) { in fs_prepare_dir() argument
43 if (TEMP_FAILURE_RETRY(lstat(path, &sb)) == -1) { in fs_prepare_dir()
47 ALOGE("Failed to lstat(%s): %s", path, strerror(errno)); in fs_prepare_dir()
54 ALOGE("Not a directory: %s", path); in fs_prepare_dir()
64 if (TEMP_FAILURE_RETRY(mkdir(path, mode)) == -1) { in fs_prepare_dir()
66 ALOGE("Failed to mkdir(%s): %s", path, strerror(errno)); in fs_prepare_dir()
72 if (TEMP_FAILURE_RETRY(chmod(path, mode)) == -1) { in fs_prepare_dir()
73 ALOGE("Failed to chmod(%s, %d): %s", path, mode, strerror(errno)); in fs_prepare_dir()
76 if (TEMP_FAILURE_RETRY(chown(path, uid, gid)) == -1) { in fs_prepare_dir()
77 ALOGE("Failed to chown(%s, %d, %d): %s", path, uid, gid, strerror(errno)); in fs_prepare_dir()
[all …]
/system/media/audio_route/
Daudio_route.c74 struct mixer_path *path; member
98 static void path_print(struct audio_route *ar, struct mixer_path *path) in path_print() argument
103 ALOGE("Path: %s, length: %d", path->name, path->length); in path_print()
104 for (i = 0; i < path->length; i++) { in path_print()
105 struct mixer_ctl *ctl = index_to_ctl(ar, path->setting[i].ctl_index); in path_print()
108 for (j = 0; j < path->setting[i].num_values; j++) in path_print()
109 ALOGE(" id=%d value=%d", j, path->setting[i].value[j]); in path_print()
177 static int find_ctl_index_in_path(struct mixer_path *path, in find_ctl_index_in_path() argument
182 for (i = 0; i < path->length; i++) in find_ctl_index_in_path()
183 if (path->setting[i].ctl_index == ctl_index) in find_ctl_index_in_path()
[all …]
/system/core/adb/
Dsysdeps.h111 static __inline__ int adb_unlink(const char* path) in adb_unlink() argument
113 int rc = unlink(path); in adb_unlink()
118 rc = chmod(path, _S_IREAD|_S_IWRITE ); in adb_unlink()
120 rc = unlink(path); in adb_unlink()
127 static __inline__ int adb_mkdir(const char* path, int mode) in adb_mkdir() argument
129 return _mkdir(path); in adb_mkdir()
134 extern int adb_open(const char* path, int options);
135 extern int adb_creat(const char* path, int mode);
161 static __inline__ int adb_open_mode(const char* path, int options, int mode) in adb_open_mode() argument
163 return adb_open(path, options); in adb_open_mode()
[all …]
Dadb_auth_host.cpp160 char path[PATH_MAX], info[MAX_PAYLOAD]; in write_public_keyfile() local
165 if (snprintf(path, sizeof(path), "%s.pub", private_key_path) >= in write_public_keyfile()
166 (int)sizeof(path)) { in write_public_keyfile()
176 outfile = fopen(path, "w"); in write_public_keyfile()
178 D("Failed to open '%s'\n", path); in write_public_keyfile()
182 D("Writing public key to '%s'\n", path); in write_public_keyfile()
304 char path[PATH_MAX]; in get_user_keyfilepath() local
307 SHGetFolderPath(NULL, CSIDL_PROFILE, NULL, 0, path); in get_user_keyfilepath()
308 home = path; in get_user_keyfilepath()
337 char path[PATH_MAX]; in get_user_key() local
[all …]
Dfile_sync_service.cpp37 static bool should_use_fs_config(const char* path) { in should_use_fs_config() argument
39 return strncmp("/system/", path, strlen("/system/")) == 0 || in should_use_fs_config()
40 strncmp("/vendor/", path, strlen("/vendor/")) == 0 || in should_use_fs_config()
41 strncmp("/oem/", path, strlen("/oem/")) == 0; in should_use_fs_config()
80 static int do_stat(int s, const char *path) in do_stat() argument
87 if(lstat(path, &st)) { in do_stat()
100 static int do_list(int s, const char *path) in do_list() argument
111 len = strlen(path); in do_list()
112 memcpy(tmp, path, len); in do_list()
118 d = opendir(path); in do_list()
[all …]
/system/extras/ext4_utils/
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()
83 void canned_fs_config(const char* path, int dir, const char* target_out_path, in canned_fs_config() argument
86 key.path = path+1; // canned paths lack the leading '/' in canned_fs_config()
89 fprintf(stderr, "failed to find [%s] in canned fs_config\n", path); in canned_fs_config()
102 fs_config(path, dir, target_out_path, &c_uid, &c_gid, &c_mode, &c_capabilities); in canned_fs_config()
104 if (c_uid != *uid) printf("%s uid %d %d\n", path, *uid, c_uid); in canned_fs_config()
105 if (c_gid != *gid) printf("%s gid %d %d\n", path, *gid, c_gid); in canned_fs_config()
106 if (c_mode != *mode) printf("%s mode 0%o 0%o\n", path, *mode, c_mode); in canned_fs_config()
[all …]
Dsetup_fs.c14 char buf[256], path[128]; in setup_fs() local
20 n = readlink(blockdev, path, sizeof(path) - 1); in setup_fs()
22 path[n] = 0; in setup_fs()
23 if (!memcmp(path, "/dev/block/", 11)) in setup_fs()
24 blockdev = path + 11; in setup_fs()
/system/core/init/
Ddevices.cpp62 const char *path; member
89 char *path; member
173 static bool perm_path_matches(const char *path, struct perms_ *dp) in perm_path_matches() argument
176 if (strncmp(path, dp->name, strlen(dp->name)) == 0) in perm_path_matches()
179 if (fnmatch(dp->name, path, FNM_PATHNAME) == 0) in perm_path_matches()
182 if (strcmp(path, dp->name) == 0) in perm_path_matches()
189 static mode_t get_device_perm(const char *path, const char **links, in get_device_perm() argument
205 if (perm_path_matches(path, dp)) { in get_device_perm()
231 static void make_device(const char *path, in make_device() argument
242 mode = get_device_perm(path, links, &uid, &gid) | (block ? S_IFBLK : S_IFCHR); in make_device()
[all …]
Dutil.cpp152 bool read_file(const char* path, std::string* content) { in read_file() argument
155 int fd = TEMP_FAILURE_RETRY(open(path, O_RDONLY|O_NOFOLLOW|O_CLOEXEC)); in read_file()
164 ERROR("fstat failed for '%s': %s\n", path, strerror(errno)); in read_file()
168 ERROR("skipping insecure file '%s'\n", path); in read_file()
177 int write_file(const char* path, const char* content) { in write_file() argument
178 int fd = TEMP_FAILURE_RETRY(open(path, O_WRONLY|O_CREAT|O_NOFOLLOW|O_CLOEXEC, 0600)); in write_file()
180 NOTICE("write_file: Unable to open '%s': %s\n", path, strerror(errno)); in write_file()
185 NOTICE("write_file: Unable to write to '%s': %s\n", path, strerror(errno)); in write_file()
356 char path[256]; in remove_link() local
358 ret = readlink(newpath, path, sizeof(path) - 1); in remove_link()
[all …]
/system/core/base/
Dfile.cpp45 bool ReadFileToString(const std::string& path, std::string* content) { in ReadFileToString() argument
49 TEMP_FAILURE_RETRY(open(path.c_str(), O_RDONLY | O_CLOEXEC | O_NOFOLLOW)); in ReadFileToString()
72 static bool CleanUpAfterFailedWrite(const std::string& path) { in CleanUpAfterFailedWrite() argument
75 unlink(path.c_str()); in CleanUpAfterFailedWrite()
81 bool WriteStringToFile(const std::string& content, const std::string& path, in WriteStringToFile() argument
84 open(path.c_str(), O_WRONLY | O_CREAT | O_TRUNC | O_CLOEXEC | O_NOFOLLOW, in WriteStringToFile()
95 return CleanUpAfterFailedWrite(path); in WriteStringToFile()
99 return CleanUpAfterFailedWrite(path); in WriteStringToFile()
103 return CleanUpAfterFailedWrite(path); in WriteStringToFile()
110 bool WriteStringToFile(const std::string& content, const std::string& path) { in WriteStringToFile() argument
[all …]
/system/core/fastboot/
Dutil_linux.c37 void get_my_path(char *path) in get_my_path() argument
43 int err = readlink(proc, path, PATH_MAX - 1); in get_my_path()
46 path[0] = 0; in get_my_path()
48 path[err] = 0; in get_my_path()
49 x = strrchr(path,'/'); in get_my_path()
/system/media/audio_utils/
DAndroid.mk19 LOCAL_C_INCLUDES += $(call include-path-for, speex)
21 $(call include-path-for, speex) \
22 $(call include-path-for, audio-utils)
42 $(call include-path-for, audio-utils)
55 $(call include-path-for, audio-utils)
70 $(call include-path-for, audio-utils)
87 $(call include-path-for, audio-utils)
/system/core/include/cutils/
Dfs.h45 extern int fs_prepare_dir(const char* path, mode_t mode, uid_t uid, gid_t gid);
51 extern int fs_read_atomic_int(const char* path, int* value);
57 extern int fs_write_atomic_int(const char* path, int value);
65 extern int fs_mkdirs(const char* path, mode_t mode);
/system/bt/main/
Dstack_config.c37 const char *path = "/etc/bluetooth/bt_stack.conf"; in init() local
38 assert(path != NULL); in init()
40 LOG_INFO("%s attempt to load stack conf from %s", __func__, path); in init()
42 config = config_new(path); in init()
44 LOG_INFO("%s file >%s< not found", __func__, path); in init()

12345