Lines Matching refs:dev_fd
85 static int num_parts, disp_unit_cyl, dos_flag, dev_fd = 3;
151 if (ioctl(dev_fd, BLKSSZGET, &arg) == 0) g_sect_size = arg;
166 if (ioctl(dev_fd, BLKGETSIZE64, &sec64) == 0) {
174 if (ioctl(dev_fd, BLKGETSIZE, §ors) == 0)
227 if (ioctl(dev_fd, HDIO_GETGEO, &geometry)) return;
260 xlseek(dev_fd, (off_t)(offset * g_sect_size), SEEK_SET);
262 if (g_sect_size != readall(dev_fd, sec_buf, g_sect_size)) {
263 close(dev_fd);
355 if(fd != dev_fd) {
356 if(dup2(fd, dev_fd) != dev_fd) perror_exit("Can't dup2");
361 if (SECTOR_SIZE != readall(dev_fd, MBRbuf, SECTOR_SIZE)) {
362 close(dev_fd);
459 close(dev_fd);
673 xlseek(dev_fd, offset * g_sect_size, SEEK_SET);
674 xwrite(dev_fd, pe->sec_buffer, g_sect_size);
681 if(ioctl(dev_fd, BLKRRPART, NULL) < 0)
1369 close(dev_fd);
1428 //this will keep dev_fd = 3 always alive
1432 if(fd != dev_fd) {
1433 if(dup2(fd, dev_fd) != dev_fd) perror_exit("Can't dup2");
1524 close(dev_fd);