/bootable/recovery/minadbd/ |
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
|
H A D | services.c | 33 void (*func)(int fd, void *cookie); 34 int fd; member in struct:stinfo 42 sti->func(sti->fd, sti->cookie); 65 static void echo_service(int fd, void *cookie) 73 r = read(fd, buf, 4096); 83 r = write(fd, p, c); 94 close(fd); 113 sti->fd = s[1];
|
H A D | usb_linux_client.c | 42 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); 168 fprintf(stderr, "usb_adb_open_thread: %d\n", fd ); 170 if (fd < 0) { 173 } while (fd < 0); 176 close_on_exec(fd); 233 int fd; local [all...] |
H A D | fdevent.c | 73 fprintf(stderr,"FDE #%03d %c%c%c %s\n", fde->fd, 95 static void fdevent_subproc_event_func(int fd, unsigned events, void *userdata); 135 if(epoll_ctl(epoll_fd, EPOLL_CTL_ADD, fde->fd, &ev)) { 155 epoll_ctl(epoll_fd, EPOLL_CTL_DEL, fde->fd, &ev); 181 if(epoll_ctl(epoll_fd, EPOLL_CTL_MOD, fde->fd, &ev)) { 186 if(epoll_ctl(epoll_fd, EPOLL_CTL_DEL, fde->fd, &ev)) { 196 if(epoll_ctl(epoll_fd, EPOLL_CTL_ADD, fde->fd, &ev)) { 262 if(fde->fd >= select_n) { 263 select_n = fde->fd + 1; 271 FD_CLR(fde->fd, 517 fdevent_subproc_event_func(int fd, unsigned ev, void *userdata) argument 575 fdevent_create(int fd, fd_func func, void *arg) argument 593 fdevent_install(fdevent *fde, int fd, fd_func func, void *arg) argument [all...] |
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); 202 D("LS(%d): destroying fde.fd=%d\n", s->id, s->fde.fd); 204 /* IMPORTANT: the remove closes the fd 222 D("entered. LS(%d) fd=%d\n", s->id, s->fd); 256 local_socket_event_func(int fd, unsigned ev, void *_s) argument 387 create_local_socket(int fd) argument 407 int fd; local [all...] |
H A D | adb.h | 95 ** us to our fd event system. For remote asockets 99 int fd; member in struct:asocket 173 int fd; member in struct:atransport 181 /* usb handle or socket fd as needed */ 205 asocket *create_local_socket(int fd); 277 void framebuffer_service(int fd, void *cookie); 278 void log_service(int fd, void *cookie); 279 void remount_service(int fd, void *cookie); 421 int sendfailmsg(int fd, const char *reason);
|
H A D | sysdeps.h | 78 static __inline__ void close_on_exec(int fd) argument 83 extern void disable_tcp_nagle(int fd); 114 extern int adb_read(int fd, void* buf, int len); 115 extern int adb_write(int fd, const void* buf, int len); 116 extern int adb_lseek(int fd, int pos, int where); 117 extern int adb_shutdown(int fd); 118 extern int adb_close(int fd); 120 static __inline__ int unix_close(int fd) argument 122 return close(fd); 127 static __inline__ int unix_read(int fd, voi argument 134 unix_write(int fd, const void* buf, size_t len) argument 198 int fd; member in struct:fdevent 218 adb_socket_setbufsize( int fd, int bufsize ) argument 300 close_on_exec(int fd) argument 329 int fd = open(path, O_CREAT|O_WRONLY|O_TRUNC|O_NOFOLLOW, mode); local 342 int fd = open( pathname, options ); local 351 adb_shutdown(int fd) argument 358 adb_close(int fd) argument 366 adb_read(int fd, void* buf, size_t len) argument 374 adb_write(int fd, const void* buf, size_t len) argument 381 adb_lseek(int fd, int pos, int where) argument 397 int fd; local 427 adb_socket_setbufsize( int fd, int bufsize ) argument 433 disable_tcp_nagle(int fd) argument [all...] |
/bootable/recovery/ |
H A D | adb_install.cpp | 42 int fd = open("/sys/class/android_usb/android0/enable", O_WRONLY); local 43 if (fd < 0) { 47 if (write(fd, enabled ? "1" : "0", 1) < 0) { 50 if (close(fd) < 0) {
|
H A D | fuse_sdcard_provider.c | 29 int fd; // the underlying sdcard file member in struct:file_data 36 struct file_data* fd = (struct file_data*)cookie; local 38 if (lseek(fd->fd, block * fd->block_size, SEEK_SET) < 0) { 44 ssize_t r = read(fd->fd, buffer, fetch_size); 60 struct file_data* fd = (struct file_data*)cookie; local 61 close(fd->fd); 80 struct file_data fd; local [all...] |
H A D | install.cpp | 60 int fd = creat(binary, 0755); local 61 if (fd < 0) { 66 bool ok = mzExtractZipEntryToFile(zip, binary_entry, fd); 67 close(fd); 83 // - an fd to which the program can write in order to update the
|
H A D | roots.cpp | 220 int fd = open(v->key_loc, O_WRONLY | O_CREAT, 0644); local 221 if (fd < 0) { 225 wipe_block_device(fd, get_file_size(fd)); 226 close(fd); 276 int fd = open(v->blk_device, O_RDWR); local 277 uint64_t size = get_file_size(fd); 280 close(fd); 285 lseek(fd, size - 1, SEEK_SET); 286 read(fd, [all...] |
H A D | fuse_sideload.c | 96 static void fuse_reply(struct fuse_data* fd, __u64 unique, const void *data, size_t len) argument 111 res = writev(fd->ffd, vec, 2); 117 static int handle_init(void* data, struct fuse_data* fd, const struct fuse_in_header* hdr) { argument 128 fuse_reply(fd, hdr->unique, &out, sizeof(out)); 133 static void fill_attr(struct fuse_attr* attr, struct fuse_data* fd, argument 137 attr->uid = fd->uid; 138 attr->gid = fd->gid; 147 static int handle_getattr(void* data, struct fuse_data* fd, const struct fuse_in_header* hdr) { argument 154 fill_attr(&(out.attr), fd, hdr->nodeid, 4096, S_IFDIR | 0555); 156 fill_attr(&(out.attr), fd, PACKAGE_FILE_I 167 handle_lookup(void* data, struct fuse_data* fd, const struct fuse_in_header* hdr) argument 192 handle_open(void* data, struct fuse_data* fd, const struct fuse_in_header* hdr) argument 205 handle_flush(void* data, struct fuse_data* fd, const struct fuse_in_header* hdr) argument 209 handle_release(void* data, struct fuse_data* fd, const struct fuse_in_header* hdr) argument 215 fetch_block(struct fuse_data* fd, uint32_t block) argument 268 handle_read(void* data, struct fuse_data* fd, const struct fuse_in_header* hdr) argument 359 struct fuse_data fd; local [all...] |
H A D | ui.cpp | 68 int RecoveryUI::input_callback(int fd, uint32_t epevents, void* data) argument 73 ret = ev_get_input(fd, epevents, &ev); 247 int fd = open("/sys/class/android_usb/android0/state", O_RDONLY); local 248 if (fd < 0) { 256 int connected = (read(fd, &buf, 1) == 1) && (buf == 'C'); 257 if (close(fd) < 0) {
|
/bootable/recovery/tools/ota/ |
H A D | check-lost+found.c | 66 int fd = open(kMarkerFile, O_WRONLY|O_CREAT, 0444); local 67 if (fd >= 0 && close(fd) == 0) { 78 fd = open(fn, O_WRONLY|O_CREAT, 0444); 79 if (fd >= 0) { // Don't sweat it if we can't write the file. 80 write(fd, fn, sizeof(fn)); // write, you know, some data 81 close(fd);
|
/bootable/recovery/minui/ |
H A D | graphics_fbdev.c | 82 int fd; local 87 fd = open("/dev/graphics/fb0", O_RDWR); 88 if (fd < 0) { 93 if (ioctl(fd, FBIOGET_FSCREENINFO, &fi) < 0) { 95 close(fd); 99 if (ioctl(fd, FBIOGET_VSCREENINFO, &vi) < 0) { 101 close(fd); 126 bits = mmap(0, fi.smem_len, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0); 129 close(fd); 169 fb_fd = fd; [all...] |
H A D | events.c | 37 int fd; member in struct:fd_info 56 int fd; local 71 fd = openat(dirfd(dir), de->d_name, O_RDONLY); 72 if(fd < 0) continue; 75 if (ioctl(fd, EVIOCGBIT(0, sizeof(ev_bits)), ev_bits) < 0) { 76 close(fd); 83 close(fd); 89 if (epoll_ctl(epollfd, EPOLL_CTL_ADD, fd, &ev)) { 90 close(fd); 95 ev_fdinfo[ev_count].fd 113 ev_add_fd(int fd, ev_callback cb, void *data) argument 171 ev_get_input(int fd, uint32_t epevents, struct input_event *ev) argument [all...] |
H A D | graphics_adf.c | 33 int fd; member in struct:adf_surface_pdata 57 surf->fd = adf_interface_simple_buffer_alloc(pdata->intf_fd, mode->hdisplay, 59 if (surf->fd < 0) 60 return surf->fd; 68 MAP_SHARED, surf->fd, surf->offset); 70 close(surf->fd); 200 surf->base.width, surf->base.height, pdata->format, surf->fd, 219 close(surf->fd);
|
/bootable/recovery/minzip/ |
H A D | SysUtil.c | 22 static int getFileStartAndLength(int fd, off_t *start_, size_t *length_) argument 30 start = lseek(fd, 0L, SEEK_CUR); 31 end = lseek(fd, 0L, SEEK_END); 32 (void) lseek(fd, start, SEEK_SET); 52 * Map a file (from fd's current offset) into a private, read-only memory 58 static int sysMapFD(int fd, MemMapping* pMap) argument 66 if (getFileStartAndLength(fd, &start, &length) < 0) 69 memPtr = mmap(NULL, length, PROT_READ, MAP_PRIVATE, fd, start); 72 fd, (int) start, strerror(errno)); 128 int fd local 181 int fd = open(fn, O_RDONLY, 0); local [all...] |
/bootable/recovery/mtdutils/ |
H A D | flash_image.c | 71 int fd = open(argv[2], O_RDONLY); local 72 if (fd < 0) die("error opening %s", argv[2]); 75 int headerlen = read(fd, header, sizeof(header)); 107 while ((len = read(fd, buf, sizeof(buf))) > 0) { 128 if (lseek(fd, headerlen, SEEK_SET) != headerlen) 134 len = read(fd, buf, left > (int)sizeof(buf) ? (int)sizeof(buf) : left);
|
H A D | mounts.c | 64 int fd; local 89 fd = open(PROC_MOUNTS_FILENAME, O_RDONLY); 90 if (fd < 0) { 93 nbytes = read(fd, buf, sizeof(buf) - 1); 94 close(fd);
|
H A D | mtdutils.c | 42 int fd; member in struct:MtdReadContext 49 int fd; member in struct:MtdWriteContext 75 int fd; local 107 fd = open(MTD_PROC_FILENAME, O_RDONLY); 108 if (fd < 0) { 111 nbytes = read(fd, buf, sizeof(buf) - 1); 112 close(fd); 243 int fd = open(mtddevname, O_RDONLY); local 244 if (fd < 0) return -1; 247 int ret = ioctl(fd, MEMGETINF 288 read_block(const MtdPartition *partition, int fd, char *data) argument 410 int fd = ctx->fd; local [all...] |
/bootable/recovery/updater/ |
H A D | updater.c | 64 int fd = atoi(argv[2]); local 65 FILE* cmd_pipe = fdopen(fd, "wb");
|
/bootable/recovery/applypatch/ |
H A D | bsdiff.c | 227 int fd; local
|
H A D | applypatch.c | 312 int fd = open(filename, O_WRONLY | O_CREAT | O_TRUNC | O_SYNC, S_IRUSR | S_IWUSR); local 313 if (fd < 0) { 319 ssize_t bytes_written = FileSink(file->data, file->size, &fd); 324 close(fd); 327 if (fsync(fd) != 0) { 331 if (close(fd) != 0) { 417 int fd = open(partition, O_RDWR | O_SYNC); local 418 if (fd < 0) { 425 lseek(fd, start, SEEK_SET); 430 ssize_t written = write(fd, dat 624 int fd = *(int *)token; local [all...] |
/bootable/recovery/uncrypt/ |
H A D | uncrypt.c | 226 int fd = open(path, O_RDONLY); local 227 if (fd < 0) { 228 ALOGE("failed to open fd for reading: %s\n", strerror(errno)); 231 fsync(fd); 237 ALOGE("failed to open fd for writing: %s\n", strerror(errno)); 246 ret = ioctl(fd, FIBMAP, &block); 265 ssize_t this_read = read(fd, buffers[tail] + so_far, sb.st_blksize - so_far); 285 ret = ioctl(fd, FIBMAP, &block); 306 close(fd); 321 int fd local [all...] |