utime.cpp 338 B

1234567891011121314151617
  1. #include <Kernel/Syscall.h>
  2. #include <errno.h>
  3. #include <string.h>
  4. #include <utime.h>
  5. extern "C" {
  6. int utime(const char* pathname, const struct utimbuf* buf)
  7. {
  8. if (!pathname) {
  9. errno = EFAULT;
  10. return -1;
  11. }
  12. int rc = syscall(SC_utime, pathname, strlen(pathname), buf);
  13. __RETURN_WITH_ERRNO(rc, rc, -1);
  14. }
  15. }