this repo has no description
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Implement utimes() and futimes() syscalls

+67
+2
src/kernel/emulation/linux/CMakeLists.txt
··· 66 66 stat/common.c 67 67 dirent/getdirentries.c 68 68 time/gettimeofday.c 69 + time/utimes.c 70 + time/futimes.c 69 71 ext/uname.c 70 72 ext/epoll_create.c 71 73 ext/epoll_create1.c
+4
src/kernel/emulation/linux/syscalls.c
··· 51 51 #include "stat/rmdir.h" 52 52 #include "stat/getfsstat.h" 53 53 #include "time/gettimeofday.h" 54 + #include "time/utimes.h" 55 + #include "time/futimes.h" 54 56 #include "wqueue/bsdthread_register.h" 55 57 56 58 void* __bsd_syscall_table[512] = { ··· 88 90 [124] = sys_fchmod, 89 91 [136] = sys_mkdir, 90 92 [137] = sys_rmdir, 93 + [138] = sys_utimes, 94 + [139] = sys_futimes, 91 95 [147] = sys_setsid, 92 96 [153] = sys_pread, 93 97 [154] = sys_pwrite,
+23
src/kernel/emulation/linux/time/futimes.c
··· 1 + #include "futimes.h" 2 + #include "../base.h" 3 + #include "../errno.h" 4 + #include <asm/unistd.h> 5 + #include <stddef.h> 6 + 7 + long sys_futimes(int fd, struct bsd_timeval* tv) 8 + { 9 + int ret; 10 + struct linux_timeval ltv[2]; 11 + 12 + ltv[0].tv_sec = tv[0].tv_sec; 13 + ltv[0].tv_usec = tv[0].tv_usec; 14 + ltv[1].tv_sec = tv[1].tv_sec; 15 + ltv[1].tv_usec = tv[1].tv_usec; 16 + 17 + ret = LINUX_SYSCALL(__NR_utimensat, fd, NULL, ltv, 0); 18 + if (ret < 0) 19 + ret = errno_linux_to_bsd(ret); 20 + 21 + return ret; 22 + } 23 +
+8
src/kernel/emulation/linux/time/futimes.h
··· 1 + #ifndef LINUX_FUTIMES_H 2 + #define LINUX_FUTIMES_H 3 + #include "gettimeofday.h" 4 + 5 + long sys_futimes(int fd, struct bsd_timeval* tv); 6 + 7 + #endif 8 +
+22
src/kernel/emulation/linux/time/utimes.c
··· 1 + #include "utimes.h" 2 + #include "../base.h" 3 + #include "../errno.h" 4 + #include <asm/unistd.h> 5 + 6 + long sys_utimes(const char* path, struct bsd_timeval* tv) 7 + { 8 + int ret; 9 + struct linux_timeval ltv[2]; 10 + 11 + ltv[0].tv_sec = tv[0].tv_sec; 12 + ltv[0].tv_usec = tv[0].tv_usec; 13 + ltv[1].tv_sec = tv[1].tv_sec; 14 + ltv[1].tv_usec = tv[1].tv_usec; 15 + 16 + ret = LINUX_SYSCALL(__NR_utimes, path, ltv); 17 + if (ret < 0) 18 + ret = errno_linux_to_bsd(ret); 19 + 20 + return ret; 21 + } 22 +
+8
src/kernel/emulation/linux/time/utimes.h
··· 1 + #ifndef LINUX_UTIMES_H 2 + #define LINUX_UTIMES_H 3 + #include "gettimeofday.h" 4 + 5 + long sys_utimes(const char* path, struct bsd_timeval* tv); 6 + 7 + #endif 8 +