24 #include <sys/types.h> 27 #include <sys/ioctl.h> 35 "Usage: fioclient FIOC_FILE [size]\n" 37 "Get size if <size> is omitted, set size otherwise\n" 40 int main(
int argc,
char **argv)
46 fprintf(stderr,
"%s", usage);
50 fd = open(argv[1], O_RDWR);
57 if (ioctl(fd, FIOC_GET_SIZE, &size)) {
61 printf(
"%zu\n", size);
63 size = strtoul(argv[2], NULL, 0);
64 if (ioctl(fd, FIOC_SET_SIZE, &size)) {