#include #include #include #include #include #include #include #define EXT2_IOC_GETRTIME _IOR('f', 9, unsigned int) #define S_RECMOD 0x100000 int main(int argc, char **argv) { int fd; long flags; if (argc < 2) return 1; fd = open(argv[1], O_RDONLY); if (fd < 0) { printf("Cannot open: %m\n"); return 1; } if (ioctl(fd, EXT2_IOC_GETFLAGS, &flags) < 0) { printf("Cannot get flags: %m\n"); return 1; } flags |= S_RECMOD; if (ioctl(fd, EXT2_IOC_SETFLAGS, &flags) < 0) { printf("Cannot set flags: %m\n"); return 1; } return 0; }