/bootable/recovery/otafault/ |
H A D | test.cpp | 26 int fd = open("testdata/test.file", O_RDWR); local 29 int readv = ota_read(fd, buf, 4); 31 int writev = ota_write(fd, out, 4); 33 close(fd);
|
H A D | ota_io.cpp | 63 int fd = open(path, oflags); local 65 filename_cache[fd] = path; 66 return fd; 70 int fd = open(path, oflags, mode); local 72 filename_cache[fd] = path; 73 return fd; 83 static int __ota_close(int fd) { argument 86 filename_cache.erase(fd); 87 return close(fd); 90 void OtaCloser::Close(int fd) { argument 94 ota_close(unique_fd& fd) argument 133 ota_read(int fd, void* buf, size_t nbyte) argument 173 ota_write(int fd, const void* buf, size_t nbyte) argument 193 ota_fsync(int fd) argument [all...] |
/bootable/recovery/ |
H A D | fuse_sdcard_provider.cpp | 35 int fd; // the underlying sdcard file member in struct:file_data 41 static int read_block_file(const file_data& fd, uint32_t block, uint8_t* buffer, argument 43 off64_t offset = static_cast<off64_t>(block) * fd.block_size; 44 if (TEMP_FAILURE_RETRY(lseek64(fd.fd, offset, SEEK_SET)) == -1) { 49 if (!android::base::ReadFully(fd.fd, buffer, fetch_size)) { 64 file_data fd; local 65 fd.fd [all...] |
H A D | fuse_sideload.cpp | 98 static void fuse_reply(const fuse_data* fd, uint64_t unique, const void* data, size_t len) { argument 110 int res = writev(fd->ffd, vec, 2); 116 static int handle_init(void* data, fuse_data* fd, const fuse_in_header* hdr) { argument 147 fuse_reply(fd, hdr->unique, &out, fuse_struct_size); 152 static void fill_attr(fuse_attr* attr, const fuse_data* fd, uint64_t nodeid, uint64_t size, argument 156 attr->uid = fd->uid; 157 attr->gid = fd->gid; 166 static int handle_getattr(void* /* data */, const fuse_data* fd, const fuse_in_header* hdr) { argument 171 fill_attr(&(out.attr), fd, hdr->nodeid, 4096, S_IFDIR | 0555); 173 fill_attr(&(out.attr), fd, PACKAGE_FILE_I 184 handle_lookup(void* data, const fuse_data* fd, const fuse_in_header* hdr) argument 208 handle_open(void* , const fuse_data* fd, const fuse_in_header* hdr) argument 228 fetch_block(fuse_data* fd, uint32_t block) argument 278 handle_read(void* data, fuse_data* fd, const fuse_in_header* hdr) argument 359 fuse_data fd = {}; local [all...] |
H A D | adb_install.cpp | 46 android::base::unique_fd fd(open(USB_DRIVER_CONTROL, O_WRONLY)); 47 if (fd == -1) { 54 if (!android::base::WriteStringToFd(enabled ? "1" : "0", fd)) {
|
H A D | roots.cpp | 205 static int64_t get_file_size(int fd, uint64_t reserve_len) { argument 207 int ret = fstat(fd, &buf); 214 uint64_t block_device_size = get_block_device_size(fd); 255 int fd = open(v->key_loc, O_WRONLY | O_CREAT, 0644); local 256 if (fd == -1) { 260 wipe_block_device(fd, get_file_size(fd)); 261 close(fd); 269 android::base::unique_fd fd(open(v->blk_device, O_RDONLY)); 270 if (fd [all...] |
H A D | ui.cpp | 217 int RecoveryUI::OnInputEvent(int fd, uint32_t epevents) { 219 if (ev_get_input(fd, epevents, &ev) == -1) { 484 int fd = open("/sys/class/android_usb/android0/state", O_RDONLY); 485 if (fd < 0) { 492 int connected = (TEMP_FAILURE_RETRY(read(fd, &buf, 1)) == 1) && (buf == 'C'); 493 if (close(fd) < 0) {
|
/bootable/recovery/minui/ |
H A D | events.cpp | 39 int fd; member in struct:fd_info 69 int fd = openat(dirfd(dir), de->d_name, O_RDONLY); local 70 if (fd == -1) continue; 76 if (ioctl(fd, EVIOCGBIT(0, sizeof(ev_bits)), ev_bits) == -1) { 77 close(fd); 85 close(fd); 93 if (epoll_ctl(g_epoll_fd, EPOLL_CTL_ADD, fd, &ev) == -1) { 94 close(fd); 99 ev_fdinfo[ev_count].fd = fd; 122 ev_add_fd(int fd, ev_callback cb) argument 168 ev_get_input(int fd, uint32_t epevents, input_event* ev) argument [all...] |
H A D | graphics_fbdev.cpp | 51 int fd = open("/dev/graphics/fb0", O_RDWR); local 52 if (fd == -1) { 58 if (ioctl(fd, FBIOGET_FSCREENINFO, &fi) < 0) { 60 close(fd); 64 if (ioctl(fd, FBIOGET_VSCREENINFO, &vi) < 0) { 66 close(fd); 90 void* bits = mmap(0, fi.smem_len, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0); 93 close(fd); 133 fb_fd = fd;
|
H A D | graphics_drm.h | 48 void DisableNonMainCrtcs(int fd, drmModeRes* resources, drmModeCrtc* main_crtc); 49 drmModeConnector* FindMainMonitor(int fd, drmModeRes* resources, uint32_t* mode_index);
|
H A D | graphics_drm.cpp | 179 static drmModeCrtc* find_crtc_for_connector(int fd, drmModeRes* resources, argument 184 encoder = drmModeGetEncoder(fd, connector->encoder_id); 193 return drmModeGetCrtc(fd, crtc); 199 encoder = drmModeGetEncoder(fd, connector->encoders[i]); 209 return drmModeGetCrtc(fd, crtc); 217 static drmModeConnector* find_used_connector_by_type(int fd, drmModeRes* resources, unsigned type) { argument 219 drmModeConnector* connector = drmModeGetConnector(fd, resources->connectors[i]); 231 static drmModeConnector* find_first_connected_connector(int fd, drmModeRes* resources) { argument 235 connector = drmModeGetConnector(fd, resources->connectors[i]); 246 drmModeConnector* MinuiBackendDrm::FindMainMonitor(int fd, drmModeRe argument 281 DisableNonMainCrtcs(int fd, drmModeRes* resources, drmModeCrtc* main_crtc) argument [all...] |
H A D | graphics_adf.cpp | 37 surf->fd = adf_interface_simple_buffer_alloc(intf_fd, mode->hdisplay, mode->vdisplay, format, 39 if (surf->fd < 0) { 40 return surf->fd; 49 mmap(nullptr, surf->pitch * surf->height, PROT_WRITE, MAP_SHARED, surf->fd, surf->offset)); 52 close(surf->fd); 174 surf->fd, surf->offset, surf->pitch, -1); 189 close(surf->fd);
|
H A D | graphics_adf.h | 27 int fd; member in class:GRSurfaceAdf
|
/bootable/recovery/otafault/include/otafault/ |
H A D | ota_io.h | 46 ssize_t ota_read(int fd, void* buf, size_t nbyte); 50 ssize_t ota_write(int fd, const void* buf, size_t nbyte); 52 int ota_fsync(int fd); 60 int ota_close(unique_fd& fd);
|
/bootable/recovery/tests/unit/ |
H A D | zip_test.cpp | 47 ASSERT_NE(-1, tmp_binary.fd); 48 ASSERT_EQ(0, ExtractEntryToFile(handle, &binary_entry, tmp_binary.fd));
|
/bootable/recovery/otautil/include/otautil/ |
H A D | SysUtil.h | 48 bool MapFD(int fd);
|
/bootable/recovery/otautil/ |
H A D | SysUtil.cpp | 34 bool MemMapping::MapFD(int fd) { argument 36 if (fstat(fd, &sb) == -1) { 37 PLOG(ERROR) << "fstat(" << fd << ") failed"; 41 void* memPtr = mmap(nullptr, sb.st_size, PROT_READ, MAP_PRIVATE, fd, 0); 43 PLOG(ERROR) << "mmap(" << sb.st_size << ", R, PRIVATE, " << fd << ", 0) failed"; 111 android::base::unique_fd fd(TEMP_FAILURE_RETRY(open(block_dev.c_str(), O_RDONLY))); 112 if (fd == -1) { 139 void* range_start = mmap(next, range_size, PROT_READ, MAP_PRIVATE | MAP_FIXED, fd, 182 android::base::unique_fd fd(TEMP_FAILURE_RETRY(open(fn.c_str(), O_RDONLY))); 183 if (fd [all...] |
/bootable/recovery/bootloader_message/ |
H A D | bootloader_message.cpp | 75 android::base::unique_fd fd(open(misc_blk_device.c_str(), O_RDONLY)); 76 if (fd == -1) { 81 if (lseek(fd, static_cast<off_t>(offset), SEEK_SET) != static_cast<off_t>(offset)) { 86 if (!android::base::ReadFully(fd, p, size)) { 96 android::base::unique_fd fd(open(misc_blk_device.c_str(), O_WRONLY)); 97 if (fd == -1) { 102 if (lseek(fd, static_cast<off_t>(offset), SEEK_SET) != static_cast<off_t>(offset)) { 107 if (!android::base::WriteFully(fd, p, size)) { 112 if (fsync(fd) == -1) {
|
/bootable/recovery/applypatch/ |
H A D | applypatch.cpp | 47 static size_t FileSink(const unsigned char* data, size_t len, int fd); 190 unique_fd fd(ota_open(filename, O_WRONLY | O_CREAT | O_TRUNC | O_SYNC, S_IRUSR | S_IWUSR)); 191 if (fd == -1) { 196 size_t bytes_written = FileSink(file->data.data(), file->data.size(), fd); 202 if (ota_fsync(fd) != 0) { 206 if (ota_close(fd) != 0) { 226 unique_fd fd(ota_open(partition, O_RDWR)); 227 if (fd == -1) { 235 if (TEMP_FAILURE_RETRY(lseek(fd, start, SEEK_SET)) == -1) { 243 ssize_t written = TEMP_FAILURE_RETRY(ota_write(fd, dat 424 FileSink(const unsigned char* data, size_t len, int fd) argument [all...] |
H A D | imgdiff.cpp | 185 static inline bool Write8(int fd, int64_t value) { argument 186 return android::base::WriteFully(fd, &value, sizeof(int64_t)); 191 static inline bool Write4(int fd, int32_t value) { argument 192 return android::base::WriteFully(fd, &value, sizeof(int32_t)); 341 int fd = mkstemp(ptemp); local 342 if (fd == -1) { 346 close(fd); 499 size_t PatchChunk::WriteHeaderToFd(int fd, size_t offset, size_t index) const { argument 500 Write4(fd, type_); 505 Write8(fd, static_cas [all...] |
/bootable/recovery/updater/ |
H A D | blockimg.cpp | 87 android::base::unique_fd fd(TEMP_FAILURE_RETRY(open(last_command_file.c_str(), O_RDONLY))); 88 if (fd == -1) { 100 if (!android::base::ReadFdToString(fd.get(), &content)) { 163 static int read_all(int fd, uint8_t* data, size_t size) { argument 166 ssize_t r = TEMP_FAILURE_RETRY(ota_read(fd, data+so_far, size-so_far)); 181 static int read_all(int fd, std::vector<uint8_t>& buffer, size_t size) { argument 182 return read_all(fd, buffer.data(), size); 185 static int write_all(int fd, const uint8_t* data, size_t size) { argument 188 ssize_t w = TEMP_FAILURE_RETRY(ota_write(fd, data+written, size-written)); 200 static int write_all(int fd, cons argument 204 discard_blocks(int fd, off64_t offset, uint64_t size) argument 218 check_lseek(int fd, off64_t offset, int whence) argument 241 RangeSinkWriter(int fd, const RangeSet& tgt) argument 486 ReadBlocks(const RangeSet& src, std::vector<uint8_t>& buffer, int fd) argument 504 WriteBlocks(const RangeSet& tgt, const std::vector<uint8_t>& buffer, int fd) argument 538 android::base::unique_fd fd; member in struct:CommandParameters 638 PrintHashForMissingStashedBlocks(const std::string& id, int fd) argument [all...] |
/bootable/recovery/minui/include/minui/ |
H A D | minui.h | 85 using ev_callback = std::function<int(int fd, uint32_t epevents)>; 90 int ev_add_fd(int fd, ev_callback cb); 101 int ev_get_input(int fd, uint32_t epevents, input_event* ev);
|
/bootable/recovery/boot_control/ |
H A D | boot_control.cpp | 95 android::base::unique_fd fd(open(misc_device, O_RDONLY)); 96 if (fd.get() == -1) { 100 if (lseek(fd, kBootloaderControlOffset, SEEK_SET) != kBootloaderControlOffset) { 104 if (!android::base::ReadFully(fd.get(), buffer, sizeof(bootloader_control))) { 113 android::base::unique_fd fd(open(misc_device, O_WRONLY | O_SYNC)); 114 if (fd.get() == -1) { 118 if (lseek(fd.get(), kBootloaderControlOffset, SEEK_SET) != kBootloaderControlOffset) { 122 if (!android::base::WriteFully(fd.get(), buffer, sizeof(bootloader_control))) {
|
/bootable/recovery/uncrypt/ |
H A D | uncrypt.cpp | 232 static int retry_fibmap(const int fd, const char* name, int* block, const int head_block) { argument 235 if (fsync(fd) == -1) { 239 if (ioctl(fd, FIBMAP, block) != 0) { 301 android::base::unique_fd fd(open(path, O_RDONLY)); 302 if (fd == -1) { 322 if (f2fs_fs && ioctl(fd, F2FS_IOC_SET_DONTMOVE) < 0) { 340 if (ioctl(fd, FIBMAP, &block) != 0) { 347 int error = retry_fibmap(fd, path, &block, head_block); 368 if (!android::base::ReadFully(fd, buffers[tail].data(), to_read)) { 385 if (ioctl(fd, FIBMA [all...] |
/bootable/recovery/update_verifier/ |
H A D | update_verifier.cpp | 147 android::base::unique_fd fd(TEMP_FAILURE_RETRY(open(dm_block_device.c_str(), O_RDONLY))); 148 if (fd.get() == -1) { 160 if (lseek64(fd.get(), static_cast<off64_t>(range_start) * kBlockSize, SEEK_SET) == -1) { 168 if (!android::base::ReadFully(fd.get(), buf.data(), to_read)) {
|