this repo has no description
1
fork

Configure Feed

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

syscall fixes

+53 -25
+28 -24
src/kernel/emulation/linux/fcntl/open.c
··· 52 52 { 53 53 int linux_flags = 0; 54 54 55 - if (flags & O_RDONLY) /* always false */ 55 + if (flags & BSD_O_RDONLY) /* always false */ 56 56 linux_flags |= LINUX_O_RDONLY; 57 - if (flags & O_WRONLY) 57 + if (flags & BSD_O_WRONLY) 58 58 linux_flags |= LINUX_O_WRONLY; 59 - if (flags & O_RDWR) 59 + if (flags & BSD_O_RDWR) 60 60 linux_flags |= LINUX_O_RDWR; 61 - if (flags & O_NONBLOCK) 61 + if (flags & BSD_O_NONBLOCK) 62 62 linux_flags |= LINUX_O_NONBLOCK; 63 - if (flags & O_APPEND) 63 + if (flags & BSD_O_APPEND) 64 64 linux_flags |= LINUX_O_APPEND; 65 - if (flags & O_CREAT) 65 + if (flags & BSD_O_CREAT) 66 66 linux_flags |= LINUX_O_CREAT; 67 - if (flags & O_TRUNC) 67 + if (flags & BSD_O_TRUNC) 68 68 linux_flags |= LINUX_O_TRUNC; 69 - if (flags & O_EXCL) 69 + if (flags & BSD_O_EXCL) 70 70 linux_flags |= LINUX_O_EXCL; 71 - if (flags & O_CLOEXEC) 71 + if (flags & BSD_O_CLOEXEC) 72 72 linux_flags |= LINUX_O_CLOEXEC; 73 - if (flags & O_NOFOLLOW) 73 + if (flags & BSD_O_NOFOLLOW) 74 74 linux_flags |= LINUX_O_NOFOLLOW; 75 - if (flags & O_DIRECTORY) 75 + if (flags & BSD_O_DIRECTORY) 76 76 linux_flags |= LINUX_O_DIRECTORY; 77 - if (flags & O_CLOEXEC) 77 + if (flags & BSD_O_CLOEXEC) 78 78 linux_flags |= LINUX_O_CLOEXEC; 79 + if (flags & BSD_O_NOCTTY) 80 + linux_flags |= LINUX_O_NOCTTY; 79 81 80 82 return linux_flags; 81 83 } ··· 85 87 int bsd_flags = 0; 86 88 87 89 if (flags & LINUX_O_RDONLY) /* always false */ 88 - bsd_flags |= O_RDONLY; 90 + bsd_flags |= BSD_O_RDONLY; 89 91 if (flags & LINUX_O_WRONLY) 90 - bsd_flags |= O_WRONLY; 92 + bsd_flags |= BSD_O_WRONLY; 91 93 if (flags & LINUX_O_RDWR) 92 - bsd_flags |= O_RDWR; 94 + bsd_flags |= BSD_O_RDWR; 93 95 if (flags & LINUX_O_NONBLOCK) 94 - bsd_flags |= O_NONBLOCK; 96 + bsd_flags |= BSD_O_NONBLOCK; 95 97 if (flags & LINUX_O_APPEND) 96 - bsd_flags |= O_APPEND; 98 + bsd_flags |= BSD_O_APPEND; 97 99 if (flags & LINUX_O_CREAT) 98 - bsd_flags |= O_CREAT; 100 + bsd_flags |= BSD_O_CREAT; 99 101 if (flags & LINUX_O_TRUNC) 100 - bsd_flags |= O_TRUNC; 102 + bsd_flags |= BSD_O_TRUNC; 101 103 if (flags & LINUX_O_EXCL) 102 - bsd_flags |= O_EXCL; 104 + bsd_flags |= BSD_O_EXCL; 103 105 if (flags & LINUX_O_CLOEXEC) 104 - bsd_flags |= O_CLOEXEC; 106 + bsd_flags |= BSD_O_CLOEXEC; 105 107 if (flags & LINUX_O_NOFOLLOW) 106 - bsd_flags |= O_NOFOLLOW; 108 + bsd_flags |= BSD_O_NOFOLLOW; 107 109 if (flags & LINUX_O_DIRECTORY) 108 - bsd_flags |= O_DIRECTORY; 110 + bsd_flags |= BSD_O_DIRECTORY; 109 111 if (flags & LINUX_O_CLOEXEC) 110 - bsd_flags |= O_CLOEXEC; 112 + bsd_flags |= BSD_O_CLOEXEC; 113 + if (flags & LINUX_O_NOCTTY) 114 + bsd_flags |= BSD_O_NOCTTY; 111 115 112 116 return bsd_flags; 113 117 }
+17
src/kernel/emulation/linux/fcntl/open.h
··· 20 20 #define LINUX_O_NOFOLLOW 0400000 21 21 #define LINUX_O_DIRECTORY 0200000 22 22 23 + #define BSD_O_RDONLY 0 24 + #define BSD_O_WRONLY 1 25 + #define BSD_O_RDWR 2 26 + #define BSD_O_NONBLOCK 4 27 + #define BSD_O_APPEND 8 28 + #define BSD_O_SHLOCK 0x10 29 + #define BSD_O_EXLOCK 0x20 30 + #define BSD_O_ASYNC 0x40 31 + #define BSD_O_NOFOLLOW 0x100 32 + #define BSD_O_CREAT 0x200 33 + #define BSD_O_TRUNC 0x400 34 + #define BSD_O_EXCL 0x800 35 + #define BSD_O_NOCTTY 0x20000 36 + #define BSD_O_DIRECTORY 0x100000 37 + #define BSD_O_SYMLINK 0x200000 38 + #define BSD_O_CLOEXEC 0x1000000 39 + 23 40 #endif 24 41
+1 -1
src/kernel/emulation/linux/stat/getfsstat.c
··· 31 31 32 32 fd = sys_open("/proc/self/mounts", O_RDONLY, 0); 33 33 if (fd < 0) 34 - return error_linux_to_bsd(fd); 34 + return errno_linux_to_bsd(fd); 35 35 36 36 __simple_readline_init(&rbuf); 37 37
+2
src/kernel/libsyscall/sys/SYS.h
··· 147 147 cmpq $-4095, %rax ;\ 148 148 jb 2f ;\ 149 149 movq %rax, %rdi ;\ 150 + negq %rdi ;\ 150 151 BRANCH_EXTERN(cerror) ;\ 151 152 2: 152 153 ··· 157 158 cmpq $-4095, %rax ;\ 158 159 jb 2f ;\ 159 160 movq %rax, %rdi ;\ 161 + negq %rdi ;\ 160 162 BRANCH_EXTERN(cerror) ;\ 161 163 2: 162 164
+5
src/kernel/libsyscall/wrappers/ioctl.c
··· 1 + // Modified by Lubos Dolezel for Darling 1 2 /* 2 3 * Copyright (c) 2004 Apple Computer, Inc. All rights reserved. 3 4 * ··· 22 23 */ 23 24 24 25 #if defined(__LP64__) || defined(__arm__) 26 + 27 + #ifdef DARLING 28 + # define ioctl __real_ioctl 29 + #endif 25 30 26 31 #include <sys/ioctl.h> 27 32 #include <stdarg.h>