logo

live-bootstrap

Mirror of <https://github.com/fosslinux/live-bootstrap>

stat_override.c (569B)


  1. /*
  2. * SPDX-FileCopyrightText: 2022 fosslinux <fosslinux@aussies.space>
  3. *
  4. * SPDX-License-Identifier: GPL-2.0-or-later
  5. */
  6. #include <sys/stat.h>
  7. #include <linux/syscall.h>
  8. #include <linux/x86/syscall.h>
  9. int _stat(const char *path, struct stat *buf) {
  10. int rc = stat(path, buf);
  11. if (rc == 0) {
  12. buf->st_atime = 0;
  13. buf->st_mtime = 0;
  14. }
  15. return rc;
  16. }
  17. int _lstat(const char *path, struct stat *buf) {
  18. int rc = lstat(path, buf);
  19. if (rc == 0) {
  20. buf->st_atime = 0;
  21. buf->st_mtime = 0;
  22. }
  23. return rc;
  24. }
  25. #define stat(a,b) _stat(a,b)
  26. #define lstat(a,b) _lstat(a,b)