// SPDX-License-Identifier: GPL-2.0 #include // #include #include #include #include #include #include "my-ioctl.h" int main(int argc, char **argv) { int fd; if (argc < 2) { printf("I need the file to open as an argument!\n"); return 0; } fd = open(argv[1], O_RDWR); if (fd < 0) { perror("open"); return 1; } if (ioctl(fd, MY_IOCTL_FILL)) { perror("ioctl"); close(fd); return 1; } if (ioctl(fd, MY_IOCTL_WIPE)) { perror("ioctl"); close(fd); return 1; } printf("ioctl successful\n"); close(fd); return 0; }