Lines Matching refs:fd
77 int32_t PartitionSlotManager::WriteSlot(int fd, int32_t slot, off_t offset, off_t size)
79 if (lseek(fd, offset, SEEK_SET) < 0) {
84 if (write(fd, &slot, size) != size) {
93 int fd = open(MISC_DEVICE_NODE, O_RDWR | O_CLOEXEC, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH);
94 if (fd < 0) {
97 if (lseek(fd, offset, SEEK_SET) < 0) {
99 close(fd);
103 if (read(fd, &slot, size) != size) {
105 close(fd);
109 close(fd);
119 int fd = open(MISC_DEVICE_NODE, O_RDWR | O_CLOEXEC, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH);
120 if (fd < 0) {
125 if (WriteSlot(fd, slot, offset, size) < 0) {
127 close(fd);
130 close(fd);