/system/extras/tests/ext4/ |
H A D | set_ext4_err_bit.c | 14 int fd; local 23 fd = open(argv[1], O_RDWR); 25 if (fd < 0) { 30 if (lseek(fd, SB_OFFSET, SEEK_SET) == -1) { 35 if (read(fd, sb, SB_SIZE) != SB_SIZE) { 48 if (lseek(fd, SB_OFFSET, SEEK_SET) == -1) { 53 if (write(fd, sb, SB_SIZE) != SB_SIZE) { 58 close(fd);
|
H A D | corrupt_gdt_free_blocks.c | 15 int fd; local 27 fd = open(argv[1], O_RDWR); 29 if (fd < 0) { 34 if (lseek(fd, SB_OFFSET, SEEK_SET) == -1) { 39 if (read(fd, &sb, sizeof(sb)) != sizeof(sb)) { 67 if (lseek(fd, block_size, SEEK_SET) == -1) { 75 if (read(fd, &gd, sizeof(gd)) != sizeof(gd)) { 86 if (lseek(fd, -sizeof(gd), SEEK_CUR) == -1) { 91 if (write(fd, &gd, sizeof(gd)) != sizeof(gd)) { 96 close(fd); [all...] |
/system/vold/ |
H A D | Loop.cpp | 41 int fd; local 50 if ((fd = open(filename, O_RDWR)) < 0) { 59 rc = ioctl(fd, LOOP_GET_STATUS64, &li); 60 close(fd); 83 int fd; local 94 if ((fd = open(filename, O_RDWR)) < 0) { 103 rc = ioctl(fd, LOOP_GET_STATUS64, &li); 104 close(fd); 129 int fd; local 151 if ((fd 236 int fd; local 253 int fd; local [all...] |
H A D | Devmapper.cpp | 57 int fd; local 58 if ((fd = open("/dev/device-mapper", O_RDWR)) < 0) { 68 if (ioctl(fd, DM_LIST_DEVICES, io)) { 72 close(fd); 80 close(fd); 91 if (ioctl(fd, DM_DEV_STATUS, io2)) { 113 close(fd); 140 int fd; local 141 if ((fd = open("/dev/device-mapper", O_RDWR)) < 0) { 150 if (ioctl(fd, DM_DEV_STATU 174 int fd; local 271 int fd; local [all...] |
/system/core/toolbox/ |
H A D | setconsole.c | 16 int fd = (int)arg; local 19 res = ioctl(fd, VT_ACTIVATE, (void*)activate_thread_switch_vc); 34 int fd; local 104 fd = open(ttydev, O_RDWR | O_SYNC); 105 if (fd < 0) { 113 res = ioctl(fd, VT_GETSTATE, &vs); 122 res = ioctl(fd, VT_OPENQRY, &vtnum); 134 pthread_create(&thread, &attr, activate_thread, (void*)fd); 137 res = ioctl(fd, VT_WAITACTIVE, (void*)switch_vc); 146 close(fd); [all...] |
/system/bluetooth/tools/ |
H A D | sock_shutdown_test.c | 50 int fd; member in struct:thread_args 109 static int _close(int fd) { argument 112 printf("%d: close(%d)\n", gettid(), fd); 113 ret = close(fd); 114 printf("%d: close(%d) = %d\n", gettid(), fd, ret); 120 static int _bind(int fd, int type) { argument 149 printf("%d: bind(%d)\n", gettid(), fd); 150 ret = bind(fd, addr, len); 151 printf("%d: bind(%d) = %d\n", gettid(), fd, ret); 157 static int _listen(int fd, in argument 168 _accept(int fd, int type) argument 207 _shutdown(int fd, int how) argument 226 int fd; local [all...] |
/system/extras/ext4_utils/ |
H A D | ext4fixup.c | 87 static void read_sb(int fd, struct ext4_super_block *sb) argument 91 ret = lseek64(fd, 1024, SEEK_SET); 95 ret = read(fd, sb, sizeof(*sb)); 103 static void write_sb(int fd, unsigned long long offset, struct ext4_super_block *sb) argument 111 ret = lseek64(fd, offset, SEEK_SET); 115 ret = write(fd, sb, sizeof(*sb)); 122 static int get_fs_fixup_state(int fd) argument 131 lseek64(fd, 0, SEEK_SET); 132 len = read(fd, &magic, sizeof(magic)); 153 static int set_fs_fixup_state(int fd, in argument 199 read_ext(int fd) argument 258 read_inode(int fd, unsigned int inum, struct ext4_inode *inode) argument 282 read_block(int fd, unsigned long long block_num, void *block) argument 301 write_block(int fd, unsigned long long block_num, void *block) argument 339 check_inode_bitmap(int fd, unsigned int bg_num) argument 371 update_superblocks_and_bg_desc(int fd, int state) argument 475 get_indirect_blocks(int fd, struct ext4_inode *inode, unsigned long long *block_list, unsigned int *count) argument 502 get_block_list_indirect(int fd, struct ext4_inode *inode, unsigned long long *block_list) argument 513 get_extent_ents(int fd, struct ext4_extent_header *ext_hdr, unsigned long long *block_list) argument 539 get_extent_idx(int fd, struct ext4_extent_header *ext_hdr, unsigned long long *block_list) argument 572 get_block_list_extents(int fd, struct ext4_inode *inode, unsigned long long *block_list) argument 593 is_entry_dir(int fd, struct ext4_dir_entry_2 *dirp, int pass) argument 621 recurse_dir(int fd, struct ext4_inode *inode, char *dirbuf, int dirsize, int mode) argument 789 int fd; local [all...] |
/system/core/adb/ |
H A D | services.c | 42 void (*func)(int fd, void *cookie); 43 int fd; member in struct:stinfo 51 sti->func(sti->fd, sti->cookie); 59 static void dns_service(int fd, void *cookie) argument 69 writex(fd, &zero, 4); 71 writex(fd, hp->h_addr, 4); 74 adb_close(fd); 83 int fd; local 85 fd = adb_creat("/tmp/update", 0644); 86 if(fd < 110 restart_root_service(int fd, void *cookie) argument 135 restart_tcp_service(int fd, void *cookie) argument 155 restart_usb_service(int fd, void *cookie) argument 165 reboot_service(int fd, void *arg) argument 341 subproc_waiter_service(int fd, void *cookie) argument 502 wait_for_state(int fd, void* cookie) argument 553 int fd = create_service_thread(wait_for_state, sinfo); local [all...] |
H A D | sysdeps.h | 79 static __inline__ void close_on_exec(int fd) argument 84 extern void disable_tcp_nagle(int fd); 115 extern int adb_read(int fd, void* buf, int len); 116 extern int adb_write(int fd, const void* buf, int len); 117 extern int adb_lseek(int fd, int pos, int where); 118 extern int adb_shutdown(int fd); 119 extern int adb_close(int fd); 121 static __inline__ int unix_close(int fd) argument 123 return close(fd); 128 static __inline__ int unix_read(int fd, voi argument 135 unix_write(int fd, const void* buf, size_t len) argument 199 int fd; member in struct:fdevent 219 adb_socket_setbufsize( int fd, int bufsize ) argument 304 close_on_exec(int fd) argument 334 int fd = open( pathname, options ); local 343 adb_shutdown(int fd) argument 350 adb_close(int fd) argument 358 adb_read(int fd, void* buf, size_t len) argument 366 adb_write(int fd, const void* buf, size_t len) argument 373 adb_lseek(int fd, int pos, int where) argument 389 int fd = creat(path, mode); local 402 int fd; local 432 adb_socket_setbufsize( int fd, int bufsize ) argument 438 disable_tcp_nagle(int fd) argument [all...] |
H A D | file_sync_service.c | 155 int fd; local 157 fd = adb_open_mode(path, O_WRONLY | O_CREAT | O_EXCL, mode); 158 if(fd < 0 && errno == ENOENT) { 160 fd = adb_open_mode(path, O_WRONLY | O_CREAT | O_EXCL, mode); 162 if(fd < 0 && errno == EEXIST) { 163 fd = adb_open_mode(path, O_WRONLY, mode); 165 if(fd < 0) { 168 fd = -1; 193 if(fd < 0) 195 if(writex(fd, buffe 322 int fd, r; local 359 file_sync_service(int fd, void *cookie) argument [all...] |
H A D | fdevent.h | 33 typedef void (*fd_func)(int fd, unsigned events, void *userdata); 36 * Note: use FD_TIMER as 'fd' to create a fd-less object 39 fdevent *fdevent_create(int fd, fd_func func, void *arg); 48 void fdevent_install(fdevent *fde, int fd, fd_func func, void *arg); 72 int fd; member in struct:fdevent
|
/system/core/init/ |
H A D | util.c | 91 int fd, ret; local 96 fd = socket(PF_UNIX, type, 0); 97 if (fd < 0) { 122 ret = bind(fd, (struct sockaddr *) &addr, sizeof (addr)); 139 return fd; 144 close(fd); 153 int fd; local 157 fd = open(fn, O_RDONLY); 158 if(fd < 0) return 0; 162 if (fstat(fd, 203 int fd; local 374 int fd; local 396 int fd, n; local 442 int fd; local [all...] |
H A D | bootchart.c | 50 unix_read(int fd, void* buff, int len) argument 53 do { ret = read(fd, buff, len); } while (ret < 0 && errno == EINTR); 58 unix_write(int fd, const void* buff, int len) argument 61 do { ret = write(fd, buff, len); } while (ret < 0 && errno == EINTR); 69 int fd = open(filename, O_RDONLY); local 70 if (fd >= 0) { 71 len = unix_read(fd, buff, buffsize-1); 72 close(fd); 82 int fd; member in struct:__anon367 90 buff->fd 161 close_on_exec(int fd) argument 188 int fd, ret, len; local 217 int fd; local 258 int fd; local 342 int fd = open( LOG_ACCT, O_WRONLY|O_CREAT|O_TRUNC,0644); local [all...] |
H A D | property_service.h | 27 void get_property_workspace(int *fd, int *sz);
|
H A D | keychords.c | 67 int fd, ret; local 75 fd = open("/dev/keychord", O_RDWR); 76 if (fd < 0) { 80 fcntl(fd, F_SETFD, FD_CLOEXEC); 82 ret = write(fd, keychords, keychords_length); 85 close(fd); 86 fd = -1; 92 keychord_fd = fd;
|
/system/netd/ |
H A D | main.cpp | 102 int dfd, fd; local 106 fd = openat(dfd, "uevent", O_WRONLY); 107 if(fd >= 0) { 108 write(fd, "add\n", 4); 109 close(fd); 121 fd = openat(dfd, de->d_name, O_RDONLY | O_DIRECTORY); 122 if(fd < 0) 125 d2 = fdopendir(fd); 127 close(fd);
|
/system/core/debuggerd/ |
H A D | backtrace.h | 28 void dump_backtrace(int fd, pid_t pid, pid_t tid, bool* detach_failed,
|
/system/core/include/cutils/ |
H A D | record_stream.h | 18 * A simple utility for reading fixed records out of a stream fd 31 extern RecordStream *record_stream_new(int fd, size_t maxRecordLen);
|
/system/core/libcutils/ |
H A D | abort_socket.c | 26 struct asocket *asocket_init(int fd) { argument 32 flags = fcntl(fd, F_GETFL); 35 if (fcntl(fd, F_SETFL, flags | O_NONBLOCK)) 52 s->fd = fd; 65 ret = connect(s->fd, addr, addrlen); 73 pfd[0].fd = s->fd; 76 pfd[1].fd = s->abort_fd[0]; 102 if (getsockopt(s->fd, SOL_SOCKE [all...] |
H A D | partition_utils.c | 42 int fd, ret, wiped; local 44 if ((fd = open(source, O_RDONLY)) < 0) { 48 ret = read(fd, buf, sizeof(buf)); 49 close(fd);
|
H A D | process_name.c | 80 int fd = open(PROCESS_NAME_DEVICE, O_RDWR); local 81 if (fd < 0) 83 write(fd, process_name, strlen(process_name) + 1); 84 close(fd);
|
H A D | uio.c | 22 int readv( int fd, struct iovec* vecs, int count ) argument 31 int ret = read( fd, buf, len ); 49 int writev( int fd, const struct iovec* vecs, int count ) argument 58 int ret = write( fd, buf, len );
|
H A D | zygote.c | 45 static int send_request(int fd, int sendStdio, int argc, const char **argv) argument 93 ret = sendmsg(fd, &msg, MSG_NOSIGNAL); 100 // Only send the fd's once 125 ret = sendmsg(fd, &msg, MSG_NOSIGNAL); 145 ret = recvmsg(fd, &msg, MSG_NOSIGNAL | MSG_WAITALL); 164 int fd; local 169 fd = socket_local_client(ZYGOTE_SOCKET, 172 if (fd < 0) { 181 pid = send_request(fd, 1, argc + 1, newargv); 190 err = read(fd, 218 int fd = -1; local [all...] |
H A D | sockets.c | 25 bool socket_peer_is_trusted(int fd) argument 30 int n = getsockopt(fd, SOL_SOCKET, SO_PEERCRED, &cr, &len);
|
/system/extras/fatblock/ |
H A D | fdpool.h | 23 int fd; member in struct:pooled_fd
|