Home
last modified time | relevance | path

Searched refs:fd (Results 1 – 25 of 25) sorted by relevance

/bootable/recovery/
Dfuse_sideload.c97 static void fuse_reply(struct fuse_data* fd, __u64 unique, const void *data, size_t len) in fuse_reply() argument
112 res = writev(fd->ffd, vec, 2); in fuse_reply()
118 static int handle_init(void* data, struct fuse_data* fd, const struct fuse_in_header* hdr) { in handle_init() argument
154 fuse_reply(fd, hdr->unique, &out, fuse_struct_size); in handle_init()
159 static void fill_attr(struct fuse_attr* attr, struct fuse_data* fd, in fill_attr() argument
163 attr->uid = fd->uid; in fill_attr()
164 attr->gid = fd->gid; in fill_attr()
173 static int handle_getattr(void* data, struct fuse_data* fd, const struct fuse_in_header* hdr) { in handle_getattr() argument
180 fill_attr(&(out.attr), fd, hdr->nodeid, 4096, S_IFDIR | 0555); in handle_getattr()
182 fill_attr(&(out.attr), fd, PACKAGE_FILE_ID, fd->file_size, S_IFREG | 0444); in handle_getattr()
[all …]
Dfuse_sdcard_provider.c30 int fd; // the underlying sdcard file member
37 struct file_data* fd = (struct file_data*)cookie; in read_block_file() local
39 off64_t offset = ((off64_t) block) * fd->block_size; in read_block_file()
40 if (TEMP_FAILURE_RETRY(lseek64(fd->fd, offset, SEEK_SET)) == -1) { in read_block_file()
46 ssize_t r = TEMP_FAILURE_RETRY(read(fd->fd, buffer, fetch_size)); in read_block_file()
59 struct file_data* fd = (struct file_data*)cookie; in close_file() local
60 close(fd->fd); in close_file()
79 struct file_data fd; in run_sdcard_fuse() local
82 fd.fd = open(t->path, O_RDONLY); in run_sdcard_fuse()
83 if (fd.fd < 0) { in run_sdcard_fuse()
[all …]
Dadb_install.cpp40 int fd = open("/sys/class/android_usb/android0/enable", O_WRONLY); in set_usb_driver() local
41 if (fd < 0) { in set_usb_driver()
45 if (TEMP_FAILURE_RETRY(write(fd, enabled ? "1" : "0", 1)) == -1) { in set_usb_driver()
48 if (close(fd) < 0) { in set_usb_driver()
Dui.cpp68 int RecoveryUI::InputCallback(int fd, uint32_t epevents, void* data) { in InputCallback() argument
69 return reinterpret_cast<RecoveryUI*>(data)->OnInputEvent(fd, epevents); in InputCallback()
90 int RecoveryUI::OnInputEvent(int fd, uint32_t epevents) { in OnInputEvent() argument
92 if (ev_get_input(fd, epevents, &ev) == -1) { in OnInputEvent()
245 int fd = open("/sys/class/android_usb/android0/state", O_RDONLY); in IsUsbConnected() local
246 if (fd < 0) { in IsUsbConnected()
254 int connected = (TEMP_FAILURE_RETRY(read(fd, &buf, 1)) == 1) && (buf == 'C'); in IsUsbConnected()
255 if (close(fd) < 0) { in IsUsbConnected()
Droots.cpp219 int fd = open(v->key_loc, O_WRONLY | O_CREAT, 0644); in format_volume() local
220 if (fd < 0) { in format_volume()
224 wipe_block_device(fd, get_file_size(fd)); in format_volume()
225 close(fd); in format_volume()
Dinstall.cpp61 int fd = creat(binary, 0755); in try_update_binary() local
62 if (fd < 0) { in try_update_binary()
67 bool ok = mzExtractZipEntryToFile(zip, binary_entry, fd); in try_update_binary()
68 close(fd); in try_update_binary()
Dui.h154 static int InputCallback(int fd, uint32_t epevents, void* data);
155 int OnInputEvent(int fd, uint32_t epevents);
/bootable/recovery/minui/
Devents.cpp37 int fd; member
72 int fd = openat(dirfd(dir), de->d_name, O_RDONLY); in ev_init() local
73 if (fd == -1) continue; in ev_init()
76 if (ioctl(fd, EVIOCGBIT(0, sizeof(ev_bits)), ev_bits) == -1) { in ev_init()
77 close(fd); in ev_init()
83 close(fd); in ev_init()
90 if (epoll_ctl(g_epoll_fd, EPOLL_CTL_ADD, fd, &ev) == -1) { in ev_init()
91 close(fd); in ev_init()
96 ev_fdinfo[ev_count].fd = fd; in ev_init()
120 int ev_add_fd(int fd, ev_callback cb, void* data) { in ev_add_fd() argument
[all …]
Dgraphics_fbdev.cpp83 int fd = open("/dev/graphics/fb0", O_RDWR); in fbdev_init() local
84 if (fd == -1) { in fbdev_init()
90 if (ioctl(fd, FBIOGET_FSCREENINFO, &fi) < 0) { in fbdev_init()
92 close(fd); in fbdev_init()
96 if (ioctl(fd, FBIOGET_VSCREENINFO, &vi) < 0) { in fbdev_init()
98 close(fd); in fbdev_init()
123 void* bits = mmap(0, fi.smem_len, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0); in fbdev_init()
126 close(fd); in fbdev_init()
166 fb_fd = fd; in fbdev_init()
Dgraphics_drm.cpp209 static drmModeCrtc *find_crtc_for_connector(int fd, in find_crtc_for_connector() argument
220 encoder = drmModeGetEncoder(fd, connector->encoder_id); in find_crtc_for_connector()
227 return drmModeGetCrtc(fd, crtc); in find_crtc_for_connector()
235 encoder = drmModeGetEncoder(fd, connector->encoders[i]); in find_crtc_for_connector()
246 return drmModeGetCrtc(fd, crtc); in find_crtc_for_connector()
254 static drmModeConnector *find_used_connector_by_type(int fd, in find_used_connector_by_type() argument
261 connector = drmModeGetConnector(fd, resources->connectors[i]); in find_used_connector_by_type()
274 static drmModeConnector *find_first_connected_connector(int fd, in find_first_connected_connector() argument
280 connector = drmModeGetConnector(fd, resources->connectors[i]); in find_first_connected_connector()
292 static drmModeConnector *find_main_monitor(int fd, drmModeRes *resources, in find_main_monitor() argument
[all …]
Dgraphics_adf.cpp34 int fd; member
56 surf->fd = adf_interface_simple_buffer_alloc(pdata->intf_fd, mode->hdisplay, in adf_surface_init()
58 if (surf->fd < 0) in adf_surface_init()
59 return surf->fd; in adf_surface_init()
68 MAP_SHARED, surf->fd, surf->offset)); in adf_surface_init()
70 close(surf->fd); in adf_surface_init()
202 surf->base.width, surf->base.height, pdata->format, surf->fd, in adf_flip()
221 close(surf->fd); in adf_surface_destroy()
Dminui.h64 typedef int (*ev_callback)(int fd, uint32_t epevents, void* data);
69 int ev_add_fd(int fd, ev_callback cb, void* data);
79 int ev_get_input(int fd, uint32_t epevents, input_event* ev);
/bootable/recovery/minzip/
DSysUtil.c22 static int getFileStartAndLength(int fd, off_t *start_, size_t *length_) in getFileStartAndLength() argument
32 start = TEMP_FAILURE_RETRY(lseek(fd, 0L, SEEK_CUR)); in getFileStartAndLength()
33 end = TEMP_FAILURE_RETRY(lseek(fd, 0L, SEEK_END)); in getFileStartAndLength()
35 if (TEMP_FAILURE_RETRY(lseek(fd, start, SEEK_SET)) == -1 || in getFileStartAndLength()
60 static int sysMapFD(int fd, MemMapping* pMap) in sysMapFD() argument
68 if (getFileStartAndLength(fd, &start, &length) < 0) in sysMapFD()
71 memPtr = mmap(NULL, length, PROT_READ, MAP_PRIVATE, fd, start); in sysMapFD()
74 fd, (int) start, strerror(errno)); in sysMapFD()
130 int fd = open(block_dev, O_RDONLY); in sysMapBlockFile() local
131 if (fd < 0) { in sysMapBlockFile()
[all …]
DZip.c672 int fd = (int)(intptr_t)cookie; in writeProcessFunction() local
678 ssize_t n = TEMP_FAILURE_RETRY(write(fd, data+soFar, dataLen-soFar)); in writeProcessFunction()
699 const ZipEntry *pEntry, int fd) in mzExtractZipEntryToFile() argument
702 (void*)(intptr_t)fd); in mzExtractZipEntryToFile()
978 int fd = open(targetFile, O_CREAT|O_WRONLY|O_TRUNC|O_SYNC, in mzExtractRecursive() local
986 if (fd < 0) { in mzExtractRecursive()
993 bool ok = mzExtractZipEntryToFile(pArchive, pEntry, fd); in mzExtractRecursive()
995 ok = (fsync(fd) == 0); in mzExtractRecursive()
997 if (close(fd) != 0) { in mzExtractRecursive()
DZip.h126 const ZipEntry *pEntry, int fd);
/bootable/recovery/mtdutils/
Dmtdutils.c42 int fd; member
49 int fd; member
75 int fd; in mtd_scan_partitions() local
107 fd = open(MTD_PROC_FILENAME, O_RDONLY); in mtd_scan_partitions()
108 if (fd < 0) { in mtd_scan_partitions()
111 nbytes = TEMP_FAILURE_RETRY(read(fd, buf, sizeof(buf) - 1)); in mtd_scan_partitions()
112 close(fd); in mtd_scan_partitions()
243 int fd = open(mtddevname, O_RDONLY); in mtd_partition_info() local
244 if (fd < 0) return -1; in mtd_partition_info()
247 int ret = ioctl(fd, MEMGETINFO, &mtd_info); in mtd_partition_info()
[all …]
Dflash_image.c71 int fd = open(argv[2], O_RDONLY); in main() local
72 if (fd < 0) die("error opening %s", argv[2]); in main()
75 int headerlen = TEMP_FAILURE_RETRY(read(fd, header, sizeof(header))); in main()
107 while ((len = TEMP_FAILURE_RETRY(read(fd, buf, sizeof(buf)))) > 0) { in main()
128 if (TEMP_FAILURE_RETRY(lseek(fd, headerlen, SEEK_SET)) != headerlen) in main()
134 len = TEMP_FAILURE_RETRY(read(fd, buf, left > (int)sizeof(buf) ? (int)sizeof(buf) : left)); in main()
/bootable/recovery/tools/ota/
Dcheck-lost+found.c67 int fd = open(kMarkerFile, O_WRONLY|O_CREAT, 0444); in main() local
68 if (fd >= 0 && close(fd) == 0) { in main()
79 fd = open(fn, O_WRONLY|O_CREAT, 0444); in main()
80 if (fd >= 0) { // Don't sweat it if we can't write the file. in main()
81 TEMP_FAILURE_RETRY(write(fd, fn, sizeof(fn))); // write, you know, some data in main()
82 close(fd); in main()
/bootable/recovery/updater/
Dblockimg.c114 static int read_all(int fd, uint8_t* data, size_t size) { in read_all() argument
117 ssize_t r = TEMP_FAILURE_RETRY(read(fd, data+so_far, size-so_far)); in read_all()
127 static int write_all(int fd, const uint8_t* data, size_t size) { in write_all() argument
130 ssize_t w = TEMP_FAILURE_RETRY(write(fd, data+written, size-written)); in write_all()
138 if (fsync(fd) == -1) { in write_all()
146 static bool check_lseek(int fd, off64_t offset, int whence) { in check_lseek() argument
147 off64_t rc = TEMP_FAILURE_RETRY(lseek64(fd, offset, whence)); in check_lseek()
170 int fd; member
192 if (write_all(rss->fd, data, write_now) == -1) { in RangeSinkWrite()
209 if (!check_lseek(rss->fd, (off64_t)rss->tgt->pos[rss->p_block*2] * BLOCKSIZE, in RangeSinkWrite()
[all …]
Dupdater.c65 int fd = atoi(argv[2]); in main() local
66 FILE* cmd_pipe = fdopen(fd, "wb"); in main()
Dinstall.c1523 int fd = open(filename, O_WRONLY, 0644); in WipeBlockDeviceFn() local
1524 int success = wipe_block_device(fd, len); in WipeBlockDeviceFn()
1529 close(fd); in WipeBlockDeviceFn()
/bootable/recovery/minadbd/
Dservices.cpp34 void (*func)(int fd, void *cookie);
35 int fd; member
41 sti->func(sti->fd, sti->cookie); in service_bootstrap_func()
76 sti->fd = s[1]; in create_service_thread()
/bootable/recovery/uncrypt/
Duncrypt.cpp221 int fd = open(path, O_RDONLY); in produce_block_map() local
222 if (fd < 0) { in produce_block_map()
248 ret = ioctl(fd, FIBMAP, &block); in produce_block_map()
269 … TEMP_FAILURE_RETRY(read(fd, buffers[tail] + so_far, sb.st_blksize - so_far)); in produce_block_map()
289 ret = ioctl(fd, FIBMAP, &block); in produce_block_map()
315 close(fd); in produce_block_map()
333 int fd = open(v->blk_device, O_WRONLY | O_SYNC); in wipe_misc() local
340 ssize_t w = TEMP_FAILURE_RETRY(write(fd, zeroes, size-written)); in wipe_misc()
348 if (fsync(fd) == -1) { in wipe_misc()
350 close(fd); in wipe_misc()
[all …]
/bootable/recovery/applypatch/
Dapplypatch.c312 int fd = open(filename, O_WRONLY | O_CREAT | O_TRUNC | O_SYNC, S_IRUSR | S_IWUSR); in SaveFileContents() local
313 if (fd < 0) { in SaveFileContents()
319 ssize_t bytes_written = FileSink(file->data, file->size, &fd); in SaveFileContents()
324 close(fd); in SaveFileContents()
327 if (fsync(fd) != 0) { in SaveFileContents()
331 if (close(fd) != 0) { in SaveFileContents()
417 int fd = open(partition, O_RDWR | O_SYNC); in WriteToPartition() local
418 if (fd < 0) { in WriteToPartition()
425 if (TEMP_FAILURE_RETRY(lseek(fd, start, SEEK_SET)) == -1) { in WriteToPartition()
434 ssize_t written = TEMP_FAILURE_RETRY(write(fd, data+start, to_write)); in WriteToPartition()
[all …]
Dbsdiff.c227 int fd; in bsdiff() local