/system/core/cpio/ |
H A D | mkbootfs.c | 237 int fd; local 239 fd = open(in, O_RDONLY); 240 if(fd < 0) die("cannot open '%s' for read", in); 245 if(read(fd, tmp, s.st_size) != s.st_size) { 252 close(fd);
|
/system/core/fastboot/ |
H A D | usb_linux.c | 98 static int filter_usb_device(int fd, char *ptr, int len, int writable, argument 153 result = ioctl(fd, USBDEVFS_CONTROL, &ctrl); 165 * hub. We are passed an fd that was obtained by opening an entry under 183 result = fstat(fd, &st); 253 int fd; local 274 if((fd = open(devname, O_RDWR)) < 0) { 278 if((fd = open(devname, O_RDONLY)) < 0) { 283 n = read(fd, desc, sizeof(desc)); 285 if(filter_usb_device(fd, desc, n, writable, callback, 291 usb->desc = fd; 408 int fd; local 420 int fd; local [all...] |
/system/core/libcutils/ |
H A D | sched_policy.c | 70 int fd; local 74 fd = bg_cgroup_fd; 79 fd = fg_cgroup_fd; 83 fd = system_cgroup_fd; 87 fd = -1; 91 if (fd < 0) { 106 if (write(fd, ptr, end - ptr) < 0) { 275 int fd; local 280 fd = open(statfile, O_RDONLY); 281 if (fd > [all...] |
H A D | tzstrftime.c | 731 int fd; local 772 fd = open(filename, O_RDONLY); 773 if (fd < 0) { 780 fd = open(filename, O_RDONLY); 781 if (fd < 0) 784 if (fstat(fd, &st) != 0) 796 if (read(fd, p, (size_t) st.st_size) != st.st_size) 798 if (close(fd) != 0) 836 (void) close(fd);
|
/system/core/liblinenoise/ |
H A D | linenoise.c | 116 static int enableRawMode(int fd) { argument 124 if (tcgetattr(fd,&orig_termios) == -1) goto fatal; 142 if (tcsetattr(fd,TCSADRAIN,&raw) < 0) goto fatal; 151 static void disableRawMode(int fd) { argument 153 if (rawmode && tcsetattr(fd,TCSADRAIN,&orig_termios) != -1) 187 static void refreshLine(int fd, const char *prompt, char *buf, size_t len, size_t pos, size_t cols) { argument 202 if (write(fd,seq,strlen(seq)) == -1) return; 204 if (write(fd,prompt,strlen(prompt)) == -1) return; 205 if (write(fd,buf,len) == -1) return; 208 if (write(fd,se 214 linenoisePrompt(int fd, char *buf, size_t buflen, const char *prompt) argument 365 int fd = STDIN_FILENO; local [all...] |
/system/core/liblog/ |
H A D | event_tag_map.c | 68 int fd = -1; local 74 fd = open(fileName, O_RDONLY); 75 if (fd < 0) { 81 end = lseek(fd, 0L, SEEK_END); 82 (void) lseek(fd, 0L, SEEK_SET); 89 fd, 0); 104 if (fd >= 0) 105 close(fd);
|
/system/core/libpixelflinger/codeflinger/ |
H A D | CodeCache.cpp | 84 int fd = ashmem_create_region("CodeFlinger code cache", local 86 LOG_ALWAYS_FATAL_IF(fd < 0, 91 MAP_PRIVATE, fd, 0); 95 close(fd);
|
/system/core/libsparse/ |
H A D | backed_block.c | 39 int fd; member in struct:backed_block::__anon460::__anon463 41 } fd; member in union:backed_block::__anon460 90 return bb->fd.fd; 99 return bb->fd.offset; 230 if (a->fd.fd != b->fd.fd || 231 a->fd 343 backed_block_add_fd(struct backed_block_list *bbl, int fd, int64_t offset, unsigned int len, unsigned int block) argument [all...] |
H A D | sparse.c | 75 int fd, int64_t file_offset, unsigned int len, unsigned int block) 77 return backed_block_add_fd(s->backed_block_list, fd, file_offset, 151 int sparse_file_write(struct sparse_file *s, int fd, bool gz, bool sparse, argument 159 out = output_file_open_fd(fd, s->block_size, s->len, gz, sparse, chunks, crc); 74 sparse_file_add_fd(struct sparse_file *s, int fd, int64_t file_offset, unsigned int len, unsigned int block) argument
|
H A D | sparse_read.c | 99 int fd, int64_t offset, unsigned int blocks, unsigned int block, 114 ret = sparse_file_add_fd(s, fd, offset, len, block); 122 ret = read_all(fd, copybuf, chunk); 130 lseek64(fd, len, SEEK_CUR); 137 int fd, unsigned int blocks, unsigned int block, uint32_t *crc32) 150 ret = read_all(fd, &fill_val, sizeof(fill_val)); 178 int fd, unsigned int blocks, unsigned int block, uint32_t *crc32) 204 static int process_crc32_chunk(int fd, unsigned int chunk_size, uint32_t crc32) argument 213 ret = read_all(fd, &file_crc32, sizeof(file_crc32)); 225 static int process_chunk(struct sparse_file *s, int fd, off64_ argument 98 process_raw_chunk(struct sparse_file *s, unsigned int chunk_size, int fd, int64_t offset, unsigned int blocks, unsigned int block, uint32_t *crc32) argument 136 process_fill_chunk(struct sparse_file *s, unsigned int chunk_size, int fd, unsigned int blocks, unsigned int block, uint32_t *crc32) argument 177 process_skip_chunk(struct sparse_file *s, unsigned int chunk_size, int fd, unsigned int blocks, unsigned int block, uint32_t *crc32) argument 277 sparse_file_read_sparse(struct sparse_file *s, int fd, bool crc) argument 359 sparse_file_read_normal(struct sparse_file *s, int fd) argument 410 sparse_file_read(struct sparse_file *s, int fd, bool sparse, bool crc) argument 423 sparse_file_import(int fd, bool verbose, bool crc) argument 479 sparse_file_import_auto(int fd, bool crc) argument [all...] |
/system/core/run-as/ |
H A D | package.c | 75 int fd, ret, old_errno; local 83 fd = TEMP_FAILURE_RETRY(open(filename, O_RDONLY)); 84 if (fd < 0) 88 ret = TEMP_FAILURE_RETRY(fstat(fd, &st)); 110 address = TEMP_FAILURE_RETRY(mmap(NULL, length, PROT_READ, MAP_PRIVATE, fd, 0)); 122 close(fd);
|
/system/core/sh/ |
H A D | histedit.c | 375 int fd; local 378 if ((fd = mkstemp(editfile)) < 0) 380 if ((efp = fdopen(fd, "w")) == NULL) { 381 close(fd);
|
H A D | input.c | 91 int fd; /* file descriptor (or -1 if string) */ member in struct:parsefile 179 return parsefile != NULL && parsefile->fd == 0; 191 if (parsefile->fd == 0 && el) { 214 if (parsefile->fd == 0) { 252 nr = read(parsefile->fd, buf, BUFSIZ - 8); 259 if (parsefile->fd == 0 && errno == EWOULDBLOCK) { 350 if (parsefile->fd == 0 && hist && something) { 435 int fd; local 439 if ((fd = open(fname, O_RDONLY)) < 0) 441 if (fd < 1 459 setinputfd(int fd, int push) argument [all...] |
H A D | output.c | 113 file->fd = BLOCK_OUT; 151 if (dest->fd == BLOCK_OUT) { 161 } else if (dest->fd == MEM_OUT) { 188 if (dest->buf == NULL || dest->nextc == dest->buf || dest->fd < 0) 190 if (xwrite(dest->fd, dest->buf, dest->nextc - dest->buf) < 0) 251 strout.fd = BLOCK_OUT; 479 xwrite(int fd, char *buf, int nbytes) argument 488 i = write(fd, buf, n); 510 xioctl(int fd, unsigned long request, char *arg) argument 514 while ((i = ioctl(fd, reques [all...] |
/system/core/toolbox/cp/ |
H A D | utils.c | 313 /* set the mod/access times now after close of the fd */ 376 * in the stat structure. If fd is zero, also call set_utimes() to set 377 * the mod/access times. If fd is non-zero, the caller must do a utimes 378 * itself after close(fd). 381 setfile(struct stat *fs, int fd) argument 395 if (fd ? fchown(fd, fs->st_uid, fs->st_gid) : 404 if (fd ? fchmod(fd, fs->st_mode) : chmod(to.p_path, fs->st_mode)) { 406 if (fd [all...] |
/system/core/toolbox/ |
H A D | dd.h | 55 int fd; /* file descriptor */ member in struct:__anon476
|
H A D | iftop.c | 104 int ret, nr, fd; local 106 fd = open(PROC_NET_DEV, O_RDONLY); 107 if (fd < 0) { 112 ret = read(fd, buf, sizeof(buf) - 1); 179 ret = close(fd);
|
H A D | ps.c | 41 int fd, r; local 60 fd = open(cmdline, O_RDONLY); 61 if(fd == 0) { 64 r = read(fd, cmdline, 1023); 65 close(fd); 71 fd = open(statline, O_RDONLY); 72 if(fd == 0) return -1; 73 r = read(fd, statline, 1023); 74 close(fd); 149 fd [all...] |
H A D | schedtop.c | 81 int fd; local 83 fd = open(line, O_RDONLY); 84 if(fd == 0) 86 len = read(fd, line, line_size - 1); 87 close(fd);
|
/system/core/toolbox/grep/ |
H A D | grep.h | 89 int fd; member in struct:file
|
/system/extras/ext4_utils/ |
H A D | ext4_utils.c | 84 void write_ext4_image(int fd, int gz, int sparse, int crc) argument 86 sparse_file_write(info.sparse_file, fd, gz, sparse, crc); 381 static u64 get_block_device_size(int fd) argument 387 ret = ioctl(fd, BLKGETSIZE64, &size); 389 ret = ioctl(fd, DKIOCGETBLOCKCOUNT, &size); 391 close(fd); 401 u64 get_file_size(int fd) argument 408 ret = fstat(fd, &buf); 418 computed_size = get_block_device_size(fd) - reserve_len;
|
/system/extras/libpagemap/ |
H A D | pm_process.c | 163 int fd; local 189 fd = open(filename, O_WRONLY); 190 if (fd < 0) 193 write(fd, "1\n", strlen("1\n")); 195 close(fd);
|
/system/extras/libublock/ |
H A D | ublock.c | 40 int fd; member in struct:ublock_ctx 249 in_len = read(ub_ctx->fd, in_buf, in_size); 257 out_wrote = write(ub_ctx->fd, out_buf, out_len); 371 ub_ctx->fd = open(CONTROL_FILE, O_RDWR); 372 if (ub_ctx->fd < 0) { 411 if (ub_ctx->fd) 412 close(ub_ctx->fd); 428 close(ub_ctx->fd);
|
/system/extras/procrank/ |
H A D | procrank.c | 52 int fd = open("/proc/meminfo", O_RDONLY); local 54 if (fd < 0) { 59 const int len = read(fd, buffer, sizeof(buffer)-1); 60 close(fd);
|
/system/extras/sound/ |
H A D | playwav.c | 136 int fd, unsigned count) 143 if (read(fd, next, count) != count) { 155 int fd; local 156 fd = open(fn, O_RDONLY); 157 if (fd < 0) { 161 if (read(fd, &hdr, sizeof(hdr)) != sizeof(hdr)) { 186 fd, hdr.data_sz); 197 int fd, afd; local 215 fd = open(fn, O_CREAT | O_RDWR, 0666); 216 if (fd < 135 play_file(unsigned rate, unsigned channels, int fd, unsigned count) argument 299 int fd, afd; local [all...] |