this repo has no description
1
fork

Configure Feed

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

Merge pull request #732 from facekapow/stub-csops

Add a dummy implementation of csops in userspace

authored by

Luboš Doležel and committed by
GitHub
7bc9354e bfd6cc90

+42
+1
src/kernel/emulation/linux/CMakeLists.txt
··· 172 172 misc/setlogin.c 173 173 misc/reboot.c 174 174 misc/iopolicysys.c 175 + misc/csops.c 175 176 fcntl/open.c 176 177 fcntl/openat.c 177 178 fcntl/fcntl.c
+31
src/kernel/emulation/linux/misc/csops.c
··· 1 + #include "csops.h" 2 + #include <stdint.h> 3 + #include <sys/codesign.h> 4 + #include "../duct_errno.h" 5 + #include <strings.h> 6 + 7 + // TODO: actually implement this 8 + // this is just a dummy implementation for now that returns no actual data for any operation 9 + long sys_csops(int pid, unsigned int ops, void* useraddr, size_t usersize) { 10 + int ret = 0; 11 + 12 + switch (ops) { 13 + case CS_OPS_STATUS: { 14 + *(uint32_t*)useraddr = CS_VALID; 15 + } break; 16 + 17 + case CS_OPS_BLOB: 18 + case CS_OPS_ENTITLEMENTS_BLOB: 19 + case CS_OPS_IDENTITY: { 20 + memset(useraddr, 0, usersize); 21 + } break; 22 + 23 + // all other operations are completely unsupported 24 + default: { 25 + ret = -1; 26 + errno = ENOSYS; 27 + } break; 28 + } 29 + 30 + return ret; 31 + };
+8
src/kernel/emulation/linux/misc/csops.h
··· 1 + #ifndef LINUX_CSOPS_H 2 + #define LINUX_CSOPS_H 3 + 4 + #include <stddef.h> 5 + 6 + long sys_csops(int pid, unsigned int ops, void* useraddr, size_t usersize); 7 + 8 + #endif // LINUX_CSOPS_H
+2
src/kernel/emulation/linux/syscalls.c
··· 118 118 #include "misc/gethostuuid.h" 119 119 #include "misc/getrusage.h" 120 120 #include "misc/syscall.h" 121 + #include "misc/csops.h" 121 122 #include "synch/semwait_signal.h" 122 123 #include "fcntl/open.h" 123 124 #include "fcntl/openat.h" ··· 309 310 [157] = sys_statfs, 310 311 [158] = sys_fstatfs, 311 312 [159] = sys_unmount, 313 + [169] = sys_csops, 312 314 [173] = sys_waitid, 313 315 [181] = sys_setgid, 314 316 [182] = sys_setegid,