/system/core/debuggerd/ |
H A D | backtrace.c | 115 void dump_backtrace(int fd, pid_t pid, pid_t tid, bool* detach_failed, argument 118 log.tfd = fd;
|
H A D | getevent.c | 22 int fd; local 30 fd = open(device, O_RDWR); 31 if(fd < 0) { 35 if(ioctl(fd, EVIOCGVERSION, &version)) { 38 if(ioctl(fd, EVIOCGID, &id)) { 44 if(ioctl(fd, EVIOCGNAME(sizeof(name) - 1), &name) < 1) { 48 if(ioctl(fd, EVIOCGPHYS(sizeof(location) - 1), &location) < 1) { 52 if(ioctl(fd, EVIOCGUNIQ(sizeof(idstr) - 1), &idstr) < 1) { 69 ufds[nfds].fd = fd; [all...] |
/system/core/libcorkscrew/ |
H A D | symbol_table.c | 60 int fd = open(filename, O_RDONLY); local 61 if (fd < 0) { 66 if (fstat(fd, &sb)) { 71 char* base = mmap(NULL, length, PROT_READ, MAP_PRIVATE, fd, 0); 199 close(fd);
|
/system/core/libcutils/ |
H A D | qtaguid.c | 61 int fd, res, savedErrno; local 65 fd = TEMP_FAILURE_RETRY(open(CTRL_PROCPATH, O_WRONLY)); 66 if (fd < 0) { 70 res = TEMP_FAILURE_RETRY(write(fd, cmd, strlen(cmd))); 79 close(fd); 147 int fd, cnt = 0, res = 0; local
|
H A D | selector.c | 49 if (read(wakeupFd->fd, garbage, sizeof(garbage)) < 0) { 99 ALOGD("Wakeup fd: %d", selector->wakeupPipe[0]); 112 SelectableFd* selectorAdd(Selector* selector, int fd) { argument 118 selectableFd->fd = fd; 127 * Adds an fd to the given set if the callback is non-null. Returns true 128 * if the fd was added. 133 FD_SET(selectableFd->fd, fdSet); 172 ALOGD("Selecting fd %d for writing...", selectableFd->fd); 185 int fd = selectableFd->fd; local [all...] |
/system/core/libdiskconfig/ |
H A D | diskconfig.c | 239 sync_ptable(int fd) argument 246 if (fstat(fd, &stat)) { 251 if (S_ISBLK(stat.st_mode) && ((rv = ioctl(fd, BLKRRPART, NULL)) < 0)) { 273 int fd; local 283 if ((fd = open(dinfo->device, O_RDWR)) < 0) { 288 if (fstat(fd, &stat)) { 301 if (ioctl(fd, BLKSSZGET, §_sz) < 0) { 313 if (ioctl(fd, BLKGETSIZE64, &disk_size) < 0) { 379 return fd; 382 close(fd); 387 validate_and_config(struct disk_info *dinfo, int *fd, struct write_list **lst) argument 422 int fd; local 436 int fd; local [all...] |
/system/core/libion/ |
H A D | ion_test.c | 26 int _ion_alloc_test(int *fd, struct ion_handle **handle) argument 30 *fd = ion_open(); 31 if (*fd < 0) 32 return *fd; 34 ret = ion_alloc(*fd, len, align, heap_mask, alloc_flags, handle); 43 int fd, ret; local 46 if(_ion_alloc_test(&fd, &handle)) 49 ret = ion_free(fd, handle); 54 ion_close(fd); 60 int fd, map_f local 121 int fd, share_fd, ret; local 156 int fd, recv_fd; local [all...] |
/system/core/libsuspend/ |
H A D | autosuspend_earlysuspend.c | 52 int fd = open(EARLYSUSPEND_WAIT_FOR_FB_WAKE, O_RDONLY, 0); local 55 err = read(fd, &buf, 1); 59 close(fd); 67 int fd = open(EARLYSUSPEND_WAIT_FOR_FB_SLEEP, O_RDONLY, 0); local 70 err = read(fd, &buf, 1); 74 close(fd);
|
/system/core/libsysutils/src/ |
H A D | SocketListener.cpp | 169 int fd = (*it)->getSocket(); local 170 FD_SET(fd, &read_fds); 171 if (fd > max) 172 max = fd; 211 int fd = (*it)->getSocket(); local 212 if (FD_ISSET(fd, &read_fds)) {
|
/system/core/mkbootimg/ |
H A D | mkbootimg.c | 32 int fd; local 35 fd = open(fn, O_RDONLY); 36 if(fd < 0) return 0; 38 sz = lseek(fd, 0, SEEK_END); 41 if(lseek(fd, 0, SEEK_SET) != 0) goto oops; 46 if(read(fd, data, sz) != sz) goto oops; 47 close(fd); 53 close(fd); 77 int write_padding(int fd, unsigned pagesize, unsigned itemsize) argument 88 if(write(fd, paddin 109 int fd; local [all...] |
/system/core/sh/ |
H A D | main.c | 281 int fd; local 286 if ((fd = open(name, O_RDONLY)) >= 0) 287 setinputfd(fd, 1); 289 if (fd < 0) 317 int fd; local 320 if ((fd = open(name, O_RDONLY)) >= 0) 321 setinputfd(fd, 1);
|
H A D | redir.c | 112 int fd; local 130 fd = n->nfile.fd; 133 n->ndup.dupfd == fd) 136 if ((flags & REDIR_PUSH) && sv->renamed[fd] == EMPTY) { 139 if ((i = fcntl(fd, F_DUPFD, 10)) == -1) { 150 error("%d: %s", fd, strerror(errno)); 155 sv->renamed[fd] = i; 156 close(fd); 160 close(fd); 177 int fd = redir->nfile.fd; local [all...] |
/system/core/toolbox/ |
H A D | cat.c | 189 int fd; local 191 fd = fileno(stdin); 196 fd = fileno(stdin); 199 fd = open(*argv, O_RDONLY|O_NONBLOCK, 0); 200 if (fd < 0) 203 if (fstat(fd, &st) == -1) { 204 close(fd); 208 close(fd); 213 else if ((fd = open(*argv, O_RDONLY, 0)) < 0) { 223 raw_cat(fd); [all...] |
H A D | lsof.c | 136 static char* fd_path = "fd/"; 168 int fd; local 191 fd = open(info.path, O_RDONLY); 192 if (fd < 0) { 198 int numRead = read(fd, cmdline, sizeof(cmdline) - 1); 199 close(fd);
|
H A D | nandread.c | 27 int fd; local 102 fd = open(devname, O_RDONLY); 103 if (fd < 0) { 124 ret = ioctl(fd, MEMGETINFO, &mtdinfo); 150 ret = ioctl(fd, ECCGETLAYOUT, &ecclayout); 163 ret = ioctl(fd, ECCGETSTATS, &initial_ecc); 180 ret = ioctl(fd, MTDFILEMODE, MTD_MODE_RAW); 193 lseek64(fd, pos, SEEK_SET); 194 ret = read(fd, buffer, mtdinfo.writesize + rawmode); 201 ret = ioctl(fd, MEMREADOO [all...] |
H A D | sendevent.c | 51 int fd; local 61 fd = open(argv[1], O_RDWR); 62 if(fd < 0) { 66 if (ioctl(fd, EVIOCGVERSION, &version)) { 74 ret = write(fd, &event, sizeof(event));
|
/system/extras/ext4_utils/ |
H A D | ext2simg.c | 56 static int read_ext(int fd) argument 62 ret = lseek64(fd, 1024, SEEK_SET); 66 ret = read(fd, &sb, sizeof(sb)); 74 ret = lseek64(fd, info.len, SEEK_SET); 78 ret = lseek64(fd, info.block_size * (aux_info.first_data_block + 1), SEEK_SET); 82 ret = read(fd, aux_info.bg_desc, info.block_size * aux_info.bg_desc_blocks); 117 static int build_sparse_ext(int fd, const char *filename) argument 137 ret = lseek64(fd, (u64)info.block_size * aux_info.bg_desc[i].bg_block_bitmap, 142 ret = read(fd, block_bitmap, info.block_size);
|
/system/vold/ |
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...] |
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 | main.cpp | 103 int dfd, fd; local 107 fd = openat(dfd, "uevent", O_WRONLY); 108 if(fd >= 0) { 109 write(fd, "add\n", 4); 110 close(fd); 122 fd = openat(dfd, de->d_name, O_RDONLY | O_DIRECTORY); 123 if(fd < 0) 126 d2 = fdopendir(fd); 128 close(fd);
|
/system/bluetooth/tools/ |
H A D | pipetest.c | 37 static int _socketpair(int fd[2]) { argument 40 ret = socketpair(AF_UNIX, SOCK_STREAM, 0, fd); 46 static int _close(int fd) { argument 48 printf("%d: close(%d)\n", gettid(), fd); 49 ret = close(fd); 50 printf("%d: close(%d) = %d\n", gettid(), fd, ret); 65 printf("\tfd %d ", ufds[i].fd); print_events(ufds[i].revents); 72 static int _write(int fd, char *buf, int len) { argument 75 printf("%d: write(%d)\n", gettid(), fd); 76 ret = write(fd, bu 83 _read(int fd) argument 95 _shutdown(int fd, int how) argument 106 int fd = (int)args; local 116 int fd = (int)args; local 126 int fd = (int)args; local 138 int fd = (int)args; local 145 int fd = (int)args; local 154 int fd[2]; local 172 int fd[2]; local 193 int fd[2]; local 214 int fd[2]; local 231 int fd[2]; local 252 int fd[2]; local 270 int fd[2]; local 293 int fd[2]; local 342 int fd[2]; local 360 int fd[2]; local 371 int fd[2]; local [all...] |
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/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 | transport_local.c | 112 int fd = -1; local 117 fd = socket_network_client(host, adb_port, SOCK_STREAM); 120 if (fd < 0) { 121 fd = socket_loopback_client(adb_port, SOCK_STREAM); 124 if (fd >= 0) { 125 D("client: connected on remote on fd %d\n", fd); 126 close_on_exec(fd); 127 disable_tcp_nagle(fd); 129 register_socket_transport(fd, bu 156 int serverfd, fd; local 242 int res, fd; local 334 int fd = t->sfd; local [all...] |
H A D | usb_linux_client.c | 50 int fd; member in struct:usb_handle 152 int fd; local 157 while (usb->fd != -1) 164 fd = unix_open("/dev/android_adb", O_RDWR); 165 if (fd < 0) { 167 fd = unix_open("/dev/android", O_RDWR); 169 if (fd < 0) { 172 } while (fd < 0); 175 close_on_exec(fd); 176 usb->fd 232 int fd; local [all...] |