this repo has no description
1
fork

Configure Feed

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

stat() and stat64() syscalls

+63
+1
kernel/emulation/linux/CMakeLists.txt
··· 49 49 network/socket.c 50 50 network/connect.c 51 51 stat/fstat.c 52 + stat/stat.c 52 53 stat/common.c 53 54 dirent/getdirentries.c 54 55 time/gettimeofday.c
+48
kernel/emulation/linux/stat/stat.c
··· 1 + #include "stat.h" 2 + #include "common.h" 3 + #include "../base.h" 4 + #include "../errno.h" 5 + #include <asm/unistd.h> 6 + 7 + long sys_stat(const char* path, struct stat* stat) 8 + { 9 + int ret; 10 + struct linux_stat lstat; 11 + 12 + // TODO: handle case conversion 13 + 14 + #ifdef __NR_stat64 15 + ret = LINUX_SYSCALL(__NR_stat64, path, &lstat); 16 + #else 17 + ret = LINUX_SYSCALL(__NR_stat, path, &lstat); 18 + #endif 19 + 20 + if (ret < 0) 21 + return errno_linux_to_bsd(ret); 22 + 23 + stat_linux_to_bsd(&lstat, stat); 24 + 25 + return 0; 26 + } 27 + 28 + long sys_stat64(const char* path, struct stat64* stat) 29 + { 30 + int ret; 31 + struct linux_stat lstat; 32 + 33 + // TODO: handle case conversion 34 + 35 + #ifdef __NR_stat64 36 + ret = LINUX_SYSCALL(__NR_stat64, path, &lstat); 37 + #else 38 + ret = LINUX_SYSCALL(__NR_stat, path, &lstat); 39 + #endif 40 + 41 + if (ret < 0) 42 + return errno_linux_to_bsd(ret); 43 + 44 + stat_linux_to_bsd64(&lstat, stat); 45 + 46 + return 0; 47 + } 48 +
+11
kernel/emulation/linux/stat/stat.h
··· 1 + #ifndef LINUX_STAT_H 2 + #define LINUX_STAT_H 3 + 4 + struct stat; 5 + struct stat64; 6 + 7 + long sys_stat(const char* path, struct stat* stat); 8 + long sys_stat64(const char* path, struct stat64* stat); 9 + 10 + #endif 11 +
+3
kernel/emulation/linux/syscalls.c
··· 36 36 #include "network/connect.h" 37 37 #include "dirent/getdirentries.h" 38 38 #include "stat/fstat.h" 39 + #include "stat/stat.h" 39 40 #include "time/gettimeofday.h" 40 41 #include "wqueue/bsdthread_register.h" 41 42 ··· 72 73 [182] = sys_setegid, 73 74 [183] = sys_seteuid, 74 75 [187] = sys_fdatasync, 76 + [188] = sys_stat, 75 77 [189] = sys_fstat, 76 78 [196] = sys_getdirentries, 77 79 [197] = sys_mmap, 78 80 [199] = sys_lseek, 79 81 [201] = sys_ftruncate, 80 82 [202] = sys_sysctl, 83 + [338] = sys_stat64, 81 84 [339] = sys_fstat64, 82 85 [344] = sys_getdirentries64, 83 86 [366] = sys_bsdthread_register,