this repo has no description
1
fork

Configure Feed

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

Add gettimeofday() and open_nocancel()

+56
+1
kernel/emulation/linux/CMakeLists.txt
··· 50 50 stat/fstat.c 51 51 stat/common.c 52 52 dirent/getdirentries.c 53 + time/gettimeofday.c 53 54 ext/epoll_create.c 54 55 ext/epoll_create1.c 55 56 ext/epoll_ctl.c
+5
kernel/emulation/linux/fcntl/open.c
··· 19 19 20 20 long sys_open(const char* filename, int flags, unsigned int mode) 21 21 { 22 + return sys_open_nocancel(filename, flags, mode); 23 + } 24 + 25 + long sys_open_nocancel(const char* filename, int flags, unsigned int mode) 26 + { 22 27 int ret, linux_flags; 23 28 24 29 linux_flags = oflags_bsd_to_linux(flags);
+1
kernel/emulation/linux/fcntl/open.h
··· 2 2 #define LINUX_OPEN_H 3 3 4 4 long sys_open(const char* filename, int flags, unsigned int mode); 5 + long sys_open_nocancel(const char* filename, int flags, unsigned int mode); 5 6 6 7 #define LINUX_O_RDONLY 00 7 8 #define LINUX_O_WRONLY 01
+3
kernel/emulation/linux/syscalls.c
··· 35 35 #include "network/connect.h" 36 36 #include "dirent/getdirentries.h" 37 37 #include "stat/fstat.h" 38 + #include "time/gettimeofday.h" 38 39 39 40 void* __bsd_syscall_table[512] = { 40 41 [1] = sys_exit, ··· 59 60 [95] = sys_fsync, 60 61 [97] = sys_socket, 61 62 [98] = sys_connect, 63 + [116] = sys_gettimeofday, 62 64 [123] = sys_fchown, 63 65 [124] = sys_fchmod, 64 66 [147] = sys_setsid, ··· 78 80 [372] = sys_thread_selfid, 79 81 [396] = sys_read_nocancel, 80 82 [397] = sys_write_nocancel, 83 + [398] = sys_open_nocancel, 81 84 [399] = sys_close_nocancel, 82 85 [408] = sys_fsync_nocancel, 83 86 [414] = sys_pread_nocancel,
+24
kernel/emulation/linux/time/gettimeofday.c
··· 1 + #include "gettimeofday.h" 2 + #include "../base.h" 3 + #include "../errno.h" 4 + #include <asm/unistd.h> 5 + 6 + long sys_gettimeofday(struct bsd_timeval* tv, struct timezone* tz) 7 + { 8 + int ret; 9 + struct linux_timeval ltv; 10 + 11 + ret = LINUX_SYSCALL(__NR_gettimeofday, &ltv, tz); 12 + if (ret < 0) 13 + { 14 + ret = errno_linux_to_bsd(ret); 15 + } 16 + else 17 + { 18 + tv->tv_sec = ltv.tv_sec; 19 + tv->tv_usec = ltv.tv_usec; 20 + } 21 + 22 + return ret; 23 + } 24 +
+22
kernel/emulation/linux/time/gettimeofday.h
··· 1 + #ifndef LINUX_GETTIMEOFDAY_H 2 + #define LINUX_GETTIMEOFDAY_H 3 + #include <stdint.h> 4 + 5 + struct bsd_timeval 6 + { 7 + unsigned long tv_sec; 8 + int32_t tv_usec; 9 + }; 10 + 11 + struct linux_timeval 12 + { 13 + unsigned long tv_sec; 14 + long tv_usec; 15 + }; 16 + 17 + struct timezone; 18 + 19 + long sys_gettimeofday(struct bsd_timeval* tv, struct timezone* tz); 20 + 21 + #endif 22 +