this repo has no description
1
fork

Configure Feed

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

vchroot changes

+96 -30
+1
src/kernel/emulation/linux/CMakeLists.txt
··· 277 277 psynch/ulock_wake.c 278 278 conf/pathconf.c 279 279 conf/fpathconf.c 280 + vchroot_expand.c 280 281 syscalls-table.S 281 282 linux-syscall.S 282 283 )
+2 -1
src/kernel/emulation/linux/bsdthread/pthread_chdir.c
··· 6 6 #include "../../../../lkm/api.h" 7 7 #include "../fcntl/open.h" 8 8 #include "../unistd/close.h" 9 + #include "../vchroot_expand.h" 9 10 #include "per_thread_wd.h" 10 11 11 12 long sys_pthread_chdir(const char* path) ··· 19 20 20 21 strcpy(vc.path, path); 21 22 22 - rv = lkm_call(NR_vchroot_expand, &vc); 23 + rv = vchroot_expand(&vc); 23 24 if (rv < 0) 24 25 return errno_linux_to_bsd(rv); 25 26
+7 -5
src/kernel/emulation/linux/fcntl/openat.c
··· 7 7 #include <mach/lkm.h> 8 8 #include "../../../../libc/include/fcntl.h" 9 9 #include "../common_at.h" 10 + #include "../simple.h" 11 + #include "../vchroot_expand.h" 10 12 #include "../bsdthread/cancelable.h" 11 13 12 14 #ifndef O_NOFOLLOW ··· 51 53 struct vchroot_expand_args vc; 52 54 vc.flags = VCHROOT_FOLLOW; 53 55 vc.dfd = atfd(fd); 54 - 56 + 55 57 strcpy(vc.path, filename); 56 - ret = lkm_call(NR_vchroot_expand, &vc); 58 + ret = vchroot_expand(&vc); 57 59 if (ret < 0) { 58 - __simple_printf("vchroot_exoand failed for %s: %d\n", filename, ret); 60 + __simple_kprintf("vchroot_expand failed for %s: %d\n", filename, ret); 59 61 return errno_linux_to_bsd(ret); 60 62 } 61 - __simple_printf("vchroot_expand: %s -> %s\n", filename, vc.path); 63 + __simple_kprintf("vchroot_expand: %s -> %s\n", filename, vc.path); 62 64 63 65 ret = LINUX_SYSCALL(__NR_openat, vc.dfd, vc.path, linux_flags, mode); 64 66 if (ret < 0) 65 67 { 66 - __simple_printf("open failed with error %d\n", ret); 68 + __simple_kprintf("open failed with error %d\n", ret); 67 69 ret = errno_linux_to_bsd(ret); 68 70 } 69 71
+2 -1
src/kernel/emulation/linux/ioctl/filio.c
··· 6 6 #include "../errno.h" 7 7 #include "../unistd/readlink.h" 8 8 #include "../fdpath.h" 9 + #include "../simple.h" 9 10 #include <stddef.h> 10 11 #include <stdbool.h> 11 12 ··· 56 57 *retval = -EBADF; 57 58 return IOCTL_HANDLED; 58 59 } 59 - __simple_printf("dtype for fd %d -> %s\n", fd, orig_path); 60 + __simple_kprintf("dtype for fd %d -> %s\n", fd, orig_path); 60 61 61 62 *retval = 0; 62 63 if (strncmp(orig_path, "/dev/pts", 8) == 0
+3 -1
src/kernel/emulation/linux/process/execve.c
··· 13 13 #include <errno.h> 14 14 #include <lkm/api.h> 15 15 #include <mach/lkm.h> 16 + #include "../vchroot_expand.h" 16 17 #include "../bsdthread/per_thread_wd.h" 17 18 18 19 long sys_execve(char* fname, char** argvp, char** envp) ··· 25 26 26 27 strcpy(vc.path, fname); 27 28 28 - ret = lkm_call(NR_vchroot_expand, &vc); 29 + ret = vchroot_expand(&vc); 30 + __simple_kprintf("execve expand %s -> %s, ret %d", fname, vc.path, ret); 29 31 if (ret < 0) 30 32 return errno_linux_to_bsd(ret); 31 33
+14
src/kernel/emulation/linux/simple.c
··· 3 3 #include <stdarg.h> 4 4 #include <stddef.h> 5 5 #include <linux-syscalls/linux.h> 6 + #include <lkm/api.h> 6 7 7 8 void __simple_vsprintf(char* buf, const char* format, va_list vl); 8 9 extern char* memchr(char* buf, int c, __SIZE_TYPE__ n); ··· 128 129 va_end(vl); 129 130 130 131 LINUX_SYSCALL3(__NR_write, 1, buffer, __simple_strlen(buffer)); 132 + } 133 + 134 + __attribute__ ((visibility ("default"))) 135 + void __simple_kprintf(const char* format, ...) 136 + { 137 + char buffer[512]; 138 + va_list vl; 139 + 140 + va_start(vl, format); 141 + __simple_vsprintf(buffer, format, vl); 142 + va_end(vl); 143 + 144 + lkm_call(NR_kernel_printk, buffer); 131 145 } 132 146 133 147 void __simple_fprintf(int fd, const char* format, ...)
+1
src/kernel/emulation/linux/simple.h
··· 2 2 #define LINUX_DEBUG_H 3 3 4 4 void __simple_printf(const char* format, ...); 5 + void __simple_kprintf(const char* format, ...); 5 6 void __simple_fprintf(int fd, const char* format, ...); 6 7 void __simple_sprintf(char *buffer, const char* format, ...); 7 8 int __simple_strlen(const char* str);
+3 -2
src/kernel/emulation/linux/stat/fstatat.c
··· 3 3 #include "../base.h" 4 4 #include "../errno.h" 5 5 #include "../common_at.h" 6 + #include "../vchroot_expand.h" 6 7 #include <lkm/api.h> 7 8 #include <mach/lkm.h> 8 9 #include <linux-syscalls/linux.h> ··· 20 21 vc.dfd = atfd(fd); 21 22 22 23 strcpy(vc.path, path); 23 - ret = lkm_call(NR_vchroot_expand, &vc); 24 + ret = vchroot_expand(&vc); 24 25 if (ret < 0) 25 26 return errno_linux_to_bsd(ret); 26 27 ··· 51 52 vc.dfd = atfd(fd); 52 53 53 54 strcpy(vc.path, path); 54 - ret = lkm_call(NR_vchroot_expand, &vc); 55 + ret = vchroot_expand(&vc); 55 56 if (ret < 0) 56 57 return errno_linux_to_bsd(ret); 57 58
+1 -1
src/kernel/emulation/linux/stat/fstatfs.c
··· 47 47 48 48 statfs_linux_to_bsd64(&lbuf, buf); 49 49 50 - ret = fdpath(fd, path, sizeof(fd)); 50 + ret = fdpath(fd, path, sizeof(path)); 51 51 52 52 if (ret < 0) 53 53 return ret;
+3 -2
src/kernel/emulation/linux/stat/lstat.c
··· 5 5 #include <linux-syscalls/linux.h> 6 6 #include <lkm/api.h> 7 7 #include <mach/lkm.h> 8 + #include "../vchroot_expand.h" 8 9 #include "../bsdthread/per_thread_wd.h" 9 10 10 11 long sys_lstat(const char* path, struct stat* stat) ··· 18 19 19 20 strcpy(vc.path, path); 20 21 21 - ret = lkm_call(NR_vchroot_expand, &vc); 22 + ret = vchroot_expand(&vc); 22 23 if (ret < 0) 23 24 return errno_linux_to_bsd(ret); 24 25 ··· 47 48 48 49 strcpy(vc.path, path); 49 50 50 - ret = lkm_call(NR_vchroot_expand, &vc); 51 + ret = vchroot_expand(&vc); 51 52 if (ret < 0) 52 53 return errno_linux_to_bsd(ret); 53 54
+2 -1
src/kernel/emulation/linux/stat/mkdirat.c
··· 4 4 #include "../errno.h" 5 5 #include <linux-syscalls/linux.h> 6 6 #include "../common_at.h" 7 + #include "../vchroot_expand.h" 7 8 #include <lkm/api.h> 8 9 #include <mach/lkm.h> 9 10 ··· 19 20 20 21 strcpy(vc.path, path); 21 22 22 - ret = lkm_call(NR_vchroot_expand, &vc); 23 + ret = vchroot_expand(&vc); 23 24 if (ret < 0) 24 25 return errno_linux_to_bsd(ret); 25 26
+2 -1
src/kernel/emulation/linux/stat/mkfifo.c
··· 4 4 #include "../errno.h" 5 5 #include <linux-syscalls/linux.h> 6 6 #include "../bsdthread/per_thread_wd.h" 7 + #include "../vchroot_expand.h" 7 8 #include <lkm/api.h> 8 9 #include <mach/lkm.h> 9 10 ··· 19 20 20 21 strcpy(vc.path, path); 21 22 22 - ret = lkm_call(NR_vchroot_expand, &vc); 23 + ret = vchroot_expand(&vc); 23 24 if (ret < 0) 24 25 return errno_linux_to_bsd(ret); 25 26
+2 -1
src/kernel/emulation/linux/stat/rmdir.c
··· 4 4 #include "../errno.h" 5 5 #include <linux-syscalls/linux.h> 6 6 #include "../bsdthread/per_thread_wd.h" 7 + #include "../vchroot_expand.h" 7 8 #include <lkm/api.h> 8 9 #include <mach/lkm.h> 9 10 ··· 19 20 20 21 strcpy(vc.path, path); 21 22 22 - ret = lkm_call(NR_vchroot_expand, &vc); 23 + ret = vchroot_expand(&vc); 23 24 if (ret < 0) 24 25 return errno_linux_to_bsd(ret); 25 26
+2 -1
src/kernel/emulation/linux/time/utimes.c
··· 4 4 #include <linux-syscalls/linux.h> 5 5 #include <lkm/api.h> 6 6 #include <mach/lkm.h> 7 + #include "../vchroot_expand.h" 7 8 #include "../bsdthread/per_thread_wd.h" 8 9 9 10 long sys_utimes(const char* path, struct bsd_timeval* tv) ··· 25 26 26 27 strcpy(vc.path, path); 27 28 28 - ret = lkm_call(NR_vchroot_expand, &vc); 29 + ret = vchroot_expand(&vc); 29 30 if (ret < 0) 30 31 return errno_linux_to_bsd(ret); 31 32
+2 -1
src/kernel/emulation/linux/unistd/chdir.c
··· 4 4 #include <linux-syscalls/linux.h> 5 5 #include <lkm/api.h> 6 6 #include <mach/lkm.h> 7 + #include "../vchroot_expand.h" 7 8 #include "../bsdthread/per_thread_wd.h" 8 9 9 10 long sys_chdir(const char* path) ··· 16 17 17 18 strcpy(vc.path, path); 18 19 19 - ret = lkm_call(NR_vchroot_expand, &vc); 20 + ret = vchroot_expand(&vc); 20 21 if (ret < 0) 21 22 return errno_linux_to_bsd(ret); 22 23
+2 -1
src/kernel/emulation/linux/unistd/fchmodat.c
··· 3 3 #include "../errno.h" 4 4 #include <linux-syscalls/linux.h> 5 5 #include "../common_at.h" 6 + #include "../vchroot_expand.h" 6 7 #include <mach/lkm.h> 7 8 #include <lkm/api.h> 8 9 ··· 18 19 19 20 strcpy(vc.path, path); 20 21 21 - ret = lkm_call(NR_vchroot_expand, &vc); 22 + ret = vchroot_expand(&vc); 22 23 if (ret < 0) 23 24 return errno_linux_to_bsd(ret); 24 25
+2 -1
src/kernel/emulation/linux/unistd/fchownat.c
··· 3 3 #include "../errno.h" 4 4 #include <linux-syscalls/linux.h> 5 5 #include "../common_at.h" 6 + #include "../vchroot_expand.h" 6 7 #include <lkm/api.h> 7 8 #include <mach/lkm.h> 8 9 ··· 18 19 19 20 strcpy(vc.path, path); 20 21 21 - ret = lkm_call(NR_vchroot_expand, &vc); 22 + ret = vchroot_expand(&vc); 22 23 if (ret < 0) 23 24 return errno_linux_to_bsd(ret); 24 25
+2 -1
src/kernel/emulation/linux/unistd/lchown.c
··· 4 4 #include <linux-syscalls/linux.h> 5 5 #include <lkm/api.h> 6 6 #include <mach/lkm.h> 7 + #include "../vchroot_expand.h" 7 8 #include "../bsdthread/per_thread_wd.h" 8 9 9 10 long sys_lchown(const char* path, int uid, int gid) ··· 16 17 17 18 strcpy(vc.path, path); 18 19 19 - ret = lkm_call(NR_vchroot_expand, &vc); 20 + ret = vchroot_expand(&vc); 20 21 if (ret < 0) 21 22 return errno_linux_to_bsd(ret); 22 23
+3 -2
src/kernel/emulation/linux/unistd/linkat.c
··· 4 4 #include <linux-syscalls/linux.h> 5 5 #include "../../../../../platform-include/sys/errno.h" 6 6 #include "../common_at.h" 7 + #include "../vchroot_expand.h" 7 8 #include <lkm/api.h> 8 9 #include <mach/lkm.h> 9 10 ··· 24 25 25 26 strcpy(vc2.path, link); 26 27 27 - ret = lkm_call(NR_vchroot_expand, &vc); 28 + ret = vchroot_expand(&vc); 28 29 if (ret < 0) 29 30 return errno_linux_to_bsd(ret); 30 31 31 - ret = lkm_call(NR_vchroot_expand, &vc2); 32 + ret = vchroot_expand(&vc2); 32 33 if (ret < 0) 33 34 return errno_linux_to_bsd(ret); 34 35
+2 -1
src/kernel/emulation/linux/unistd/mknod.c
··· 4 4 #include <linux-syscalls/linux.h> 5 5 #include <lkm/api.h> 6 6 #include <mach/lkm.h> 7 + #include "../vchroot_expand.h" 7 8 #include "../bsdthread/per_thread_wd.h" 8 9 9 10 long sys_mknod(const char* path, int mode, int dev) ··· 16 17 17 18 strcpy(vc.path, path); 18 19 19 - ret = lkm_call(NR_vchroot_expand, &vc); 20 + ret = vchroot_expand(&vc); 20 21 if (ret < 0) 21 22 return errno_linux_to_bsd(ret); 22 23
+2 -1
src/kernel/emulation/linux/unistd/readlinkat.c
··· 3 3 #include "../errno.h" 4 4 #include <linux-syscalls/linux.h> 5 5 #include "../common_at.h" 6 + #include "../vchroot_expand.h" 6 7 #include <lkm/api.h> 7 8 #include <mach/lkm.h> 8 9 ··· 19 20 20 21 strcpy(vc.path, path); 21 22 22 - ret = lkm_call(NR_vchroot_expand, &vc); 23 + ret = vchroot_expand(&vc); 23 24 if (ret < 0) 24 25 return errno_linux_to_bsd(ret); 25 26
+3 -2
src/kernel/emulation/linux/unistd/renameat.c
··· 4 4 #include <linux-syscalls/linux.h> 5 5 #include "../../../../../platform-include/sys/errno.h" 6 6 #include "../common_at.h" 7 + #include "../vchroot_expand.h" 7 8 #include <lkm/api.h> 8 9 #include <mach/lkm.h> 9 10 ··· 24 25 25 26 strcpy(vc2.path, newpath); 26 27 27 - ret = lkm_call(NR_vchroot_expand, &vc); 28 + ret = vchroot_expand(&vc); 28 29 if (ret < 0) 29 30 return errno_linux_to_bsd(ret); 30 - ret = lkm_call(NR_vchroot_expand, &vc2); 31 + ret = vchroot_expand(&vc2); 31 32 if (ret < 0) 32 33 return errno_linux_to_bsd(ret); 33 34
+2 -1
src/kernel/emulation/linux/unistd/symlinkat.c
··· 4 4 #include <linux-syscalls/linux.h> 5 5 #include "../../../../../platform-include/sys/errno.h" 6 6 #include "../common_at.h" 7 + #include "../vchroot_expand.h" 7 8 #include <lkm/api.h> 8 9 #include <mach/lkm.h> 9 10 #include "../bsdthread/per_thread_wd.h" ··· 18 19 19 20 strcpy(vc.path, link); 20 21 21 - ret = lkm_call(NR_vchroot_expand, &vc); 22 + ret = vchroot_expand(&vc); 22 23 if (ret < 0) 23 24 return errno_linux_to_bsd(ret); 24 25
+2 -1
src/kernel/emulation/linux/unistd/truncate.c
··· 4 4 #include <linux-syscalls/linux.h> 5 5 #include <lkm/api.h> 6 6 #include "../bsdthread/per_thread_wd.h" 7 + #include "../vchroot_expand.h" 7 8 #include <mach/lkm.h> 8 9 9 10 long sys_truncate(const char* path, long long length) ··· 16 17 17 18 strcpy(vc.path, path); 18 19 19 - ret = lkm_call(NR_vchroot_expand, &vc); 20 + ret = vchroot_expand(&vc); 20 21 if (ret < 0) 21 22 return errno_linux_to_bsd(ret); 22 23
+2 -1
src/kernel/emulation/linux/unistd/unlinkat.c
··· 3 3 #include "../errno.h" 4 4 #include <linux-syscalls/linux.h> 5 5 #include "../common_at.h" 6 + #include "../vchroot_expand.h" 6 7 #include <lkm/api.h> 7 8 #include <mach/lkm.h> 8 9 ··· 18 19 19 20 strcpy(vc.path, path); 20 21 21 - ret = lkm_call(NR_vchroot_expand, &vc); 22 + ret = vchroot_expand(&vc); 22 23 if (ret < 0) 23 24 return errno_linux_to_bsd(ret); 24 25
+19
src/kernel/emulation/linux/vchroot_expand.c
··· 1 + #include "vchroot_expand.h" 2 + #include <mach/lkm.h> 3 + 4 + int vchroot_expand(struct vchroot_expand_args* args) 5 + { 6 + if (strncmp(args->path, "/Volumes/SystemRoot", 19) == 0) 7 + { 8 + memmove(args->path, args->path + 19, strlen(args->path + 19) + 1); 9 + if (args->path[0] == 0) 10 + { 11 + args->path[0] = '/'; 12 + args->path[1] = '\0'; 13 + } 14 + 15 + return 0; 16 + } 17 + 18 + return lkm_call(NR_vchroot_expand, args); 19 + }
+8
src/kernel/emulation/linux/vchroot_expand.h
··· 1 + #ifndef _VCHROOT_EXPAND_H 2 + #define _VCHROOT_EXPAND_H 3 + #include <lkm/api.h> 4 + 5 + int vchroot_expand(struct vchroot_expand_args* args); 6 + 7 + #endif 8 +