Home
last modified time | relevance | path

Searched refs:mode (Results 1 – 25 of 58) sorted by relevance

123

/system/core/toolbox/
Dls.c36 static char mode2kind(mode_t mode) in mode2kind() argument
38 switch(mode & S_IFMT){ in mode2kind()
50 void strmode(mode_t mode, char *out) in strmode() argument
52 *out++ = mode2kind(mode); in strmode()
54 *out++ = (mode & 0400) ? 'r' : '-'; in strmode()
55 *out++ = (mode & 0200) ? 'w' : '-'; in strmode()
56 if(mode & 04000) { in strmode()
57 *out++ = (mode & 0100) ? 's' : 'S'; in strmode()
59 *out++ = (mode & 0100) ? 'x' : '-'; in strmode()
61 *out++ = (mode & 040) ? 'r' : '-'; in strmode()
[all …]
Dchmod.c13 void recurse_chmod(char* path, int mode) in recurse_chmod() argument
37 if (chmod(subpath, mode) < 0) { in recurse_chmod()
42 recurse_chmod(subpath, mode); in recurse_chmod()
77 int mode = 0; in chmod_main() local
81 mode = (mode<<3) | (*s-'0'); in chmod_main()
91 if (chmod(argv[i], mode) < 0) { in chmod_main()
96 recurse_chmod(argv[i], mode); in chmod_main()
Dmknod.c46 mode_t mode = 0660; in mknod_main() local
59 mode |= S_IFBLK; in mknod_main()
64 mode |= S_IFCHR; in mknod_main()
68 mode |= S_IFIFO; in mknod_main()
90 if (mknod(path, mode, makedev(major, minor))) { in mknod_main()
/system/core/adb/
Dfile_sync_client.c92 typedef void (*sync_ls_cb)(unsigned mode, unsigned size, unsigned time, const char *name, void *coo…
122 func(ltohl(msg.dent.mode), in sync_ls()
144 unsigned int *mode) in sync_readtime() argument
166 *mode = ltohl(msg.stat.mode); in sync_readtime()
187 unsigned int *mode, unsigned int *size) in sync_finish_readtime() argument
198 *mode = ltohl(msg.stat.mode); in sync_finish_readtime()
204 int sync_readmode(int fd, const char *path, unsigned *mode) in sync_readmode() argument
225 *mode = ltohl(msg.stat.mode); in sync_readmode()
338 unsigned mtime, mode_t mode, int show_progress) in sync_send() argument
350 snprintf(tmp, sizeof(tmp), ",%d", mode); in sync_send()
[all …]
Dfile_sync_service.c53 unsigned int mode = 0775; in mkdirs() local
63 fs_config(name, 1, &uid, &gid, &mode, &cap); in mkdirs()
65 ret = adb_mkdir(name, mode); in mkdirs()
91 msg.stat.mode = 0; in do_stat()
95 msg.stat.mode = htoll(st.st_mode); in do_stat()
133 msg.dent.mode = htoll(st.st_mode); in do_list()
150 msg.dent.mode = 0; in do_list()
180 gid_t gid, mode_t mode, char *buffer, bool do_unlink) in handle_send_file() argument
186 fd = adb_open_mode(path, O_WRONLY | O_CREAT | O_EXCL | O_CLOEXEC, mode); in handle_send_file()
193 fd = adb_open_mode(path, O_WRONLY | O_CREAT | O_EXCL | O_CLOEXEC, mode); in handle_send_file()
[all …]
Dsysdeps.h107 static __inline__ int adb_mkdir(const char* path, int mode) in adb_mkdir() argument
115 extern int adb_creat(const char* path, int mode);
143 static __inline__ int adb_open_mode(const char* path, int options, int mode) in adb_open_mode() argument
156 int mode; in unix_open() local
159 mode = va_arg( args, int ); in unix_open()
161 return open(path, options, mode); in unix_open()
335 int mode; in unix_open() local
338 mode = va_arg( args, int ); in unix_open()
340 return TEMP_FAILURE_RETRY( open( path, options, mode ) ); in unix_open()
344 static __inline__ int adb_open_mode( const char* pathname, int options, int mode ) in adb_open_mode() argument
[all …]
DSYNC.TXT10 SERVICES.TXT sets the connection in sync mode. This mode is a binary mode that
11 differ from the regular adb protocol. The connection stays in sync mode until
17 In sync mode both the server and the client will frequently use eight-byte
22 all binary integers are Little-Endian in the sync mode. Sync mode is
44 2. A four-byte integer representing file mode.
56 encoded file mode containing the permissions of the file on device.
Dfile_sync_service.h57 unsigned mode; member
63 unsigned mode; member
/system/extras/tests/fstest/
Dperm_checker.c200 static void print_new_rule(const char *name, mode_t mode, uid_t uid, gid_t gid) in print_new_rule() argument
206 printf("%s %4o %4o %s %d %s %d\n", name, mode, mode, pw->pw_name, uid, in print_new_rule()
211 static int pass_rule(const perm_rule_t *pr, mode_t mode, uid_t uid, gid_t gid) in pass_rule() argument
213 if (((pr->min_mode & mode) == pr->min_mode) && in pass_rule()
214 ((pr->max_mode | mode) == pr->max_mode) && in pass_rule()
223 static int validate_file(const char *name, mode_t mode, uid_t uid, gid_t gid) in validate_file() argument
232 if (!pass_rule(pr, mode, uid, gid)) in validate_file()
245 print_new_rule(name, mode, uid, gid); in validate_file()
255 if (!pass_rule(pr, mode, uid, gid)) in validate_file()
266 if (!pass_rule(pr, mode, uid, gid)) in validate_file()
[all …]
DREADME37 <min_mode> is a numeric mode mask, and a mode will match it if and only if
38 (min_mode & mode) == min_mode.
40 <max_mode> is a numeric mode mask, and a mode will match it if and only if
41 (max_mode | mode) == max_mode.
/system/extras/ext4_utils/
Dcanned_fs_config.c31 unsigned mode; member
60 p->mode = strtol(strtok(NULL, " "), NULL, 8); // mode is in octal in load_canned_fs_config()
84 unsigned* uid, unsigned* gid, unsigned* mode, uint64_t* capabilities) { in canned_fs_config() argument
94 *mode = p->mode; 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()
Dext4fixup.c520 static int recurse_dir(int fd, struct ext4_inode *inode, char *dirbuf, int dirsize, int mode) in recurse_dir() argument
531 switch (mode) { in recurse_dir()
579 if (((mode == SANITY_CHECK_PASS) || (mode == UPDATE_INODE_NUMS)) && in recurse_dir()
610 is_dir = is_entry_dir(fd, dirp, mode); in recurse_dir()
612 ((mode == SANITY_CHECK_PASS) || (mode == MARK_INODE_NUMS) || in recurse_dir()
613 ((mode == UPDATE_INODE_NUMS) && (dirp->inode & 0x80000000))) ) { in recurse_dir()
636 recurse_dir(fd, &tmp_inode, tmp_dirbuf, tmp_dirsize, mode); in recurse_dir()
650 if (mode == MARK_INODE_NUMS) { in recurse_dir()
652 } else if (mode == UPDATE_INODE_NUMS) { in recurse_dir()
658 if ((bail_phase == mode) && (bail_loc == 1) && (bail_count == count)) { in recurse_dir()
[all …]
Dcontents.h27 u16 mode; member
40 int inode_set_permissions(u32 inode_num, u16 mode, u16 uid, u16 gid, u32 mtime);
Dmake_ext4fs.c90 .mode = S_IRWXU, in build_default_directory_structure()
98 inode_set_permissions(inode, dentries.mode, in build_default_directory_structure()
183 dentries[i].mode = stat.st_mode & (S_ISUID|S_ISGID|S_ISVTX|S_IRWXU|S_IRWXG|S_IRWXO); in build_directory_structure()
192 unsigned int mode = 0; in build_directory_structure() local
196 fs_config_func(dentries[i].path, dir, &uid, &gid, &mode, &capabilities); in build_directory_structure()
197 dentries[i].mode = mode; in build_directory_structure()
252 dentries[0].mode = S_IRWXU; in build_directory_structure()
257 if (selabel_lookup(sehnd, &dentries[0].secon, dentries[0].path, dentries[0].mode) < 0) in build_directory_structure()
292 ret = inode_set_permissions(entry_inode, dentries[i].mode, in build_directory_structure()
/system/core/liblog/
Dlog_read_kern.c76 static int accessmode(int mode) in accessmode() argument
78 if ((mode & O_ACCMODE) == O_WRONLY) { in accessmode()
81 if ((mode & O_ACCMODE) == O_RDWR) { in accessmode()
88 static int check_allocate_accessible(char **n, const char *b, int mode) in check_allocate_accessible() argument
101 return access(*n, accessmode(mode)); in check_allocate_accessible()
137 int mode; member
195 static int logger_ioctl(struct logger *logger, int cmd, int mode) in logger_ioctl() argument
204 if (((mode & O_ACCMODE) == O_RDWR) in logger_ioctl()
205 || (((mode ^ logger->top->mode) & O_ACCMODE) == 0)) { in logger_ioctl()
210 ret = check_allocate_accessible(&n, android_log_id_to_name(logger->id), mode); in logger_ioctl()
[all …]
Dlog_read.c240 int mode; member
466 struct logger_list *android_logger_list_alloc(int mode, in android_logger_list_alloc() argument
478 logger_list->mode = mode; in android_logger_list_alloc()
488 struct logger_list *android_logger_list_alloc_time(int mode, in android_logger_list_alloc_time() argument
500 logger_list->mode = mode; in android_logger_list_alloc_time()
546 int mode, in android_logger_list_open() argument
550 struct logger_list *logger_list = android_logger_list_alloc(mode, tail, pid); in android_logger_list_open()
581 if (logger_list->mode & O_NONBLOCK) { in android_logger_list_read()
601 (logger_list->mode & O_NONBLOCK) ? "dumpAndClose" : "stream"); in android_logger_list_read()
639 if (logger_list->mode & O_NONBLOCK) { in android_logger_list_read()
[all …]
/system/extras/tests/cpueater/
Ddaemonize.c33 int pid, fd, mode; in main() local
46 mode = O_TRUNC; in main()
64 mode = O_APPEND; in main()
72 if(open(file, O_WRONLY|mode|O_CREAT, 0666) < 0) { in main()
/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
57 if (((sb.st_mode & ALL_PERMS) == mode) && (sb.st_uid == uid) && (sb.st_gid == gid)) { in fs_prepare_dir()
64 if (TEMP_FAILURE_RETRY(mkdir(path, mode)) == -1) { 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()
153 int fs_mkdirs(const char* path, mode_t mode) { in fs_mkdirs() argument
186 if (mkdirat(fd, segment, mode) != 0) { in fs_mkdirs()
/system/core/init/
Dbuiltins.c112 static int _chmod(const char *path, mode_t mode) in _chmod() argument
122 ret = fchmod(fd, mode); in _chmod()
310 mode_t mode = 0755; in do_mkdir() local
316 mode = strtoul(args[2], 0, 8); in do_mkdir()
319 ret = make_dir(args[1], mode); in do_mkdir()
322 ret = _chmod(args[1], mode); in do_mkdir()
341 if (mode & (S_ISUID | S_ISGID)) { in do_mkdir()
342 ret = _chmod(args[1], mode); in do_mkdir()
423 int mode, loop, fd; in do_mount() local
426 mode = (flags & MS_RDONLY) ? O_RDONLY : O_RDWR; in do_mount()
[all …]
Dutil.h34 int mkdir_recursive(const char *pathname, mode_t mode);
42 int make_dir(const char *path, mode_t mode);
/system/core/include/private/
Dandroid_filesystem_config.h182 unsigned mode; member
273 unsigned *uid, unsigned *gid, unsigned *mode, uint64_t *capabilities) in fs_config() argument
300 *mode = (*mode & (~07777)) | pc->mode; in fs_config()
305 path, pc->prefix ? pc->prefix : "", *uid, *gid, *mode); in fs_config()
/system/core/include/cutils/
Dfs.h45 extern int fs_prepare_dir(const char* path, mode_t mode, uid_t uid, gid_t gid);
65 extern int fs_mkdirs(const char* path, mode_t mode);
/system/core/adf/libadfhwc/
Dadfhwc.cpp118 const drm_mode_modeinfo &mode, const uint32_t attribute) in adf_display_attribute() argument
122 if (mode.vrefresh) in adf_display_attribute()
123 return 1000000000 / mode.vrefresh; in adf_display_attribute()
127 return mode.hdisplay; in adf_display_attribute()
130 return mode.vdisplay; in adf_display_attribute()
133 return dpi(mode.hdisplay, data.width_mm); in adf_display_attribute()
136 return dpi(mode.vdisplay, data.height_mm); in adf_display_attribute()
/system/media/audio_utils/
Dtinysndfile.c28 int mode; member
71 handle->mode = SFM_READ; in sf_open_read()
304 handle->mode = SFM_WRITE; in sf_open_write()
313 SNDFILE *sf_open(const char *path, int mode, SF_INFO *info) in sf_open() argument
319 switch (mode) { in sf_open()
325 fprintf(stderr, "mode=%d\n", mode); in sf_open()
335 if (handle->mode == SFM_WRITE) { in sf_close()
353 if (handle == NULL || handle->mode != SFM_READ || ptr == NULL || !handle->remaining || in sf_readf_short()
398 if (handle == NULL || handle->mode != SFM_READ || ptr == NULL || !handle->remaining || in sf_readf_float()
445 if (handle == NULL || handle->mode != SFM_READ || ptr == NULL || !handle->remaining || in sf_readf_int()
[all …]
/system/core/sdcard/
Dsdcard.c182 mode_t mode; member
423 attr->mode = s->st_mode; in attr_from_stat()
432 int filtered_mode = node->mode & (owner_mode | (owner_mode >> 3) | (owner_mode >> 6)); in attr_from_stat()
433 attr->mode = (attr->mode & S_IFMT) | filtered_mode; in attr_from_stat()
436 static int touch(char* path, mode_t mode) { in touch() argument
437 int fd = open(path, O_RDWR | O_CREAT | O_EXCL | O_NOFOLLOW, mode); in touch()
459 node->mode = parent->mode; in derive_permissions_locked()
477 node->mode = 0770; in derive_permissions_locked()
481 node->mode = 0771; in derive_permissions_locked()
500 node->mode = 0771; in derive_permissions_locked()
[all …]

123