Lines Matching defs:fd
34 uint64_t get_block_device_size(int fd)
39 ret = ioctl(fd, BLKGETSIZE64, &size);
47 int wipe_block_device(int fd)
51 uint64_t len = get_block_device_size(fd);
59 ret = ioctl(fd, BLKSECDISCARD, &range);
64 ret = ioctl(fd, BLKDISCARD, &range);
81 int fd = open(path, O_RDONLY);
83 if (fd < 0)
86 return get_block_device_size(fd);
91 int fd = open(path, O_WRONLY);
93 if (fd < 0)
96 return wipe_block_device(fd);