/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 | nodes.h | 105 int fd; member in struct:nfile 114 int fd; member in struct:ndup 123 int fd; member in struct:nhere
|
/system/core/toolbox/ |
H A D | alarm.c | 75 res = ioctl(fd, RTC_ALM_READ, &tm); 95 res = ioctl(fd, RTC_RD_TIME, &tm); 133 res = ioctl(fd, RTC_ALM_SET, &tm); 138 res = ioctl(fd, RTC_AIE_ON); 171 FD_SET(fd, &rfds); 172 res = select(fd + 1, &rfds, NULL, NULL, &timeout); 179 read(fd, &event, sizeof(event));
|
H A D | getevent.c | 43 static int print_input_props(int fd) argument 52 res = ioctl(fd, EVIOCGPROP(sizeof(bits)), bits); 75 static int print_possible_events(int fd, int print_flags) argument 89 res = ioctl(fd, EVIOCGBIT(i, bits_size), bits); 102 res2 = ioctl(fd, EVIOCGKEY(res), bits + bits_size); 119 res2 = ioctl(fd, EVIOCGLED(res), bits + bits_size); 124 res2 = ioctl(fd, EVIOCGSND(res), bits + bits_size); 129 res2 = ioctl(fd, EVIOCGSW(bits_size), bits + bits_size); 177 if(ioctl(fd, EVIOCGABS(j * 8 + k), &abs) == 0) { 297 int fd; local [all...] |
H A D | dd.c | 159 in.fd = STDIN_FILENO; 161 in.fd = open(in.name, O_RDONLY, 0); 162 if (in.fd < 0) { 169 /* Ensure in.fd is outside the stdio descriptor range */ 170 in.fd = redup_clean_fd(in.fd); 184 out.fd = STDOUT_FILENO; 189 out.fd = open(out.name, O_RDWR | OFLAGS, DEFFILEMODE); 195 if (out.fd < 0) { 196 out.fd 272 redup_clean_fd(int fd) argument 566 bwrite(int fd, const void *buf, size_t len) argument [all...] |
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...] |
/system/core/adb/ |
H A D | sockets.c | 33 int sendfailmsg(int fd, const char *reason) argument 40 if(writex(fd, buf, 8)) return -1; 41 return writex(fd, reason, len); 55 ** write to their fd. 148 int r = adb_write(s->fd, p->ptr, p->len); 204 D("LS(%d): destroying fde.fd=%d\n", s->id, s->fde.fd); 206 /* IMPORTANT: the remove closes the fd 229 D("entered. LS(%d) fd=%d\n", s->id, s->fd); 263 local_socket_event_func(int fd, unsigned ev, void *_s) argument 393 create_local_socket(int fd) argument 413 int fd; local [all...] |
H A D | transport.c | 137 read_packet(int fd, const char* name, apacket** ppacket) argument 144 snprintf(buff, sizeof buff, "fd=%d", fd); 148 r = adb_read(fd, p, len); 153 D("%s: read_packet (fd=%d), error ret=%d errno=%d: %s\n", name, fd, r, errno, strerror(errno)); 168 write_packet(int fd, const char* name, apacket** ppacket) argument 174 snprintf(buff, sizeof buff, "fd=%d", fd); 185 r = adb_write(fd, 198 transport_socket_events(int fd, unsigned events, void *_t) argument 523 transport_read_action(int fd, struct tmsg* m) argument 545 transport_write_action(int fd, struct tmsg* m) argument 1094 readx(int fd, void *ptr, size_t len) argument 1126 writex(int fd, const void *ptr, size_t len) argument [all...] |
H A D | adb.c | 624 int fd; local 627 fd = adb_socket_accept(_fd, &addr, &alen); 628 if(fd < 0) return; 630 adb_socket_setbufsize(fd, CHUNK_SIZE); 632 s = create_local_socket(fd); 638 adb_close(fd); 650 int fd; local 653 fd = adb_socket_accept(_fd, &addr, &alen); 654 if(fd < 0) return; 656 s = create_local_socket(fd); 872 int fd; local 1239 int port, fd; local [all...] |
H A D | backup_service.c | 27 int fd; member in struct:__anon272 45 adb_close(params->fd); 144 params->fd = s[0];
|
H A D | sysdeps_win32.c | 124 _fh_from_int( int fd ) 128 fd -= WIN32_FH_BASE; 130 if (fd < 0 || fd >= _win32_fh_count) { 131 D( "_fh_from_int: invalid fd %d\n", fd + WIN32_FH_BASE ); 136 f = &_win32_fhs[fd]; 139 D( "_fh_from_int: invalid fd %d\n", fd + WIN32_FH_BASE ); 357 D( "adb_open: '%s' => fd 402 adb_read(int fd, void* buf, int len) argument 414 adb_write(int fd, const void* buf, int len) argument 426 adb_lseek(int fd, int pos, int where) argument 438 adb_shutdown(int fd) argument 452 adb_close(int fd) argument 781 disable_tcp_nagle(int fd) argument 1339 int fd = _fh_to_int(f); local 1377 event_looper_hook( EventLooper looper, int fd, int events ) argument 1409 event_looper_unhook( EventLooper looper, int fd, int events ) argument 1748 int fd = fde->fd - WIN32_FH_BASE; local 1778 int fd = fde->fd - WIN32_FH_BASE; local 1829 fdevent_create(int fd, fd_func func, void *arg) argument 1847 fdevent_install(fdevent *fde, int fd, fd_func func, void *arg) argument [all...] |
H A D | adb.h | 101 ** us to our fd event system. For remote asockets 105 int fd; member in struct:asocket 181 int fd; member in struct:atransport 190 /* usb handle or socket fd as needed */ 228 int fd; member in struct:alistener 246 asocket *create_local_socket(int fd); 329 void framebuffer_service(int fd, void *cookie); 330 void log_service(int fd, void *cookie); 331 void remount_service(int fd, void *cookie); 488 int sendfailmsg(int fd, cons [all...] |
/system/netd/ |
H A D | TetherController.cpp | 66 int fd = open("/proc/sys/net/ipv4/ip_forward", O_WRONLY); local 67 if (fd < 0) { 72 if (write(fd, (enable ? "1" : "0"), 1) != 1) { 74 close(fd); 77 close(fd); 82 int fd = open("/proc/sys/net/ipv4/ip_forward", O_RDONLY); local 84 if (fd < 0) { 90 if (read(fd, &enabled, 1) != 1) { 92 close(fd); 96 close(fd); [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/gpttool/ |
H A D | gpttool.c | 89 int fd; local 90 fd = open("/dev/urandom", O_RDONLY); 91 read(fd, uuid, 16); 92 close(fd); 260 int fd; local 291 fd = open(device, O_RDWR); 292 if (fd < 0) { 296 if (ioctl(fd, BLKGETSIZE64, &sz)) { 367 write(fd, &ptbl, sizeof(ptbl)); 368 fsync(fd); [all...] |
/system/core/libcutils/ |
H A D | buffer.c | 77 ssize_t bufferRead(Buffer* buffer, int fd) { argument 80 ssize_t bytesRead = read(fd, 96 ssize_t bufferWrite(Buffer* buffer, int fd) { argument 100 ssize_t bytesWritten = write(fd,
|
H A D | mq.c | 173 SelectableFd* fd; member in struct:PeerProxy 211 static void setNonBlocking(int fd) { argument 213 if ((flags = fcntl(fd, F_GETFL, 0)) < 0) { 216 if (fcntl(fd, F_SETFL, flags | O_NONBLOCK) < 0) { 221 /** Closes a fd and logs a warning if the close fails. */ 222 static void closeWithWarning(int fd) { argument 223 int result = close(fd); 408 // Remove the fd from the selector. 409 if (peerProxy->fd != NULL) { 410 peerProxy->fd 515 peerProxyWrite(SelectableFd* fd) argument 561 peerProxyBeforeSelect(SelectableFd* fd) argument 706 peerProxySetFd(PeerProxy* peerProxy, SelectableFd* fd) argument 965 peerProxyRead(SelectableFd* fd) argument [all...] |
H A D | debugger.c | 56 int dump_backtrace_to_file(pid_t tid, int fd) { argument 78 if (TEMP_FAILURE_RETRY(write(fd, buffer, n)) != n) {
|
/system/extras/tests/sdcard/ |
H A D | sysutil.h | 113 // Fsync the given fd and drop caches. Fsync is needed because dirty 119 void fsyncAndDropCaches(int fd, int code = 3);
|
H A D | sysutil.cpp | 84 int fd = open(filename, O_RDONLY); local 86 if (fd < 0) 105 s = read(fd, end, size); 127 close(fd); 148 int fd = open(filename, O_WRONLY); local 151 if (fd < 0) 167 ssize_t s = write(fd, start, size); 184 close(fd); 399 void fsyncAndDropCaches(int fd, int code) argument 401 fsync(fd); [all...] |
/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/core/libpixelflinger/codeflinger/ |
H A D | blending.cpp | 73 int fd = component==GGLFormat::ALPHA ? mBlendDstA : mBlendDst; local 76 const int blending = blending_codes(fs, fd); 101 (fs==GGL_DST_COLOR && fd==GGL_ONE_MINUS_DST_COLOR) || 102 (fs==GGL_SRC_COLOR && fd==GGL_ONE_MINUS_SRC_COLOR) || 103 (fs==GGL_DST_ALPHA && fd==GGL_ONE_MINUS_DST_ALPHA) || 104 (fs==GGL_SRC_ALPHA && fd==GGL_ONE_MINUS_SRC_ALPHA); 107 (fs==GGL_ONE_MINUS_DST_COLOR && fd==GGL_DST_COLOR) || 108 (fs==GGL_ONE_MINUS_SRC_COLOR && fd==GGL_SRC_COLOR) || 109 (fs==GGL_ONE_MINUS_DST_ALPHA && fd==GGL_DST_ALPHA) || 110 (fs==GGL_ONE_MINUS_SRC_ALPHA && fd [all...] |
/system/core/libsparse/ |
H A D | output_file.c | 52 int fd, off64_t offset) 54 return __mmap2(addr, length, prot, flags, fd, offset >> 12); 70 int (*open)(struct output_file *, int fd); 110 int fd; member in struct:output_file_normal 125 static int file_open(struct output_file *out, int fd) argument 129 outn->fd = fd; 138 ret = lseek64(outn->fd, cnt, SEEK_CUR); 151 ret = ftruncate64(outn->fd, len); 164 ret = write(outn->fd, dat 51 mmap64(void *addr, size_t length, int prot, int flags, int fd, off64_t offset) argument 191 gz_file_open(struct output_file *out, int fd) argument 275 callback_file_open(struct output_file *out, int fd) argument 326 read_all(int fd, void *buf, size_t len) argument 667 output_file_open_fd(int fd, unsigned int block_size, int64_t len, int gz, int sparse, int chunks, int crc) argument 703 write_fd_chunk(struct output_file *out, unsigned int len, int fd, int64_t offset) argument [all...] |
/system/core/logcat/ |
H A D | logcat.cpp | 58 int fd; member in struct:log_device_t 262 if (dev->fd > max) { 263 max = dev->fd; 272 FD_SET(dev->fd, &readset); 279 if (FD_ISSET(dev->fd, &readset)) { 282 ret = read(dev->fd, entry->buf, LOGGER_ENTRY_MAX_LEN); 595 int fd; local 601 fd = open("/proc/cmdline", O_RDONLY); 602 if (fd >= 0) { 603 int n = read(fd, cmdlin [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);
|