this repo has no description
1
fork

Configure Feed

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

Implement sysctl({ CTL_KERN, KERN_OSVERSION }) (#304)

+14 -1
+3 -1
src/kernel/emulation/linux/CMakeLists.txt
··· 11 11 add_definitions(-DBSDTHREAD_WRAP_LINUX_PTHREAD 12 12 -DEMULATED_SYSNAME="Darwin" 13 13 -DEMULATED_RELEASE="16.0.0" 14 - -DEMULATED_VERSION="Darwin Kernel Version 16.0.0") 14 + -DEMULATED_VERSION="Darwin Kernel Version 16.0.0" 15 + -DEMULATED_OSVERSION="16D32" 16 + ) 15 17 16 18 17 19 include_directories(${CMAKE_SOURCE_DIR}/src/libelfloader/native)
+11
src/kernel/emulation/linux/misc/sysctl_kern.c
··· 28 28 static sysctl_handler(handle_domainname); 29 29 static sysctl_handler(handle_osrelease); 30 30 static sysctl_handler(handle_version); 31 + static sysctl_handler(handle_osversion); 31 32 static sysctl_handler(handle_maxproc); 32 33 static sysctl_handler(handle_netboot); 33 34 static sysctl_handler(handle_safeboot); ··· 51 52 { .oid = KERN_DOMAINNAME, .type = CTLTYPE_STRING, .exttype = "S", .name = "domainname", .handler = handle_domainname }, 52 53 { .oid = KERN_OSRELEASE, .type = CTLTYPE_STRING, .exttype = "S", .name = "osrelease", .handler = handle_osrelease }, 53 54 { .oid = KERN_VERSION, .type = CTLTYPE_STRING, .exttype = "S", .name = "version", .handler = handle_version }, 55 + { .oid = KERN_OSVERSION, .type = CTLTYPE_STRING, .exttype = "S", .name = "osversion", .handler = handle_osversion }, 54 56 { .oid = -1 } 55 57 }; 56 58 ··· 154 156 copyout_string(s, (char*) old, oldlen); 155 157 return 0; 156 158 } 159 + 160 + sysctl_handler(handle_osversion) 161 + { 162 + const char* s = EMULATED_OSVERSION; 163 + 164 + copyout_string(s, (char*) old, oldlen); 165 + return 0; 166 + } 167 + 157 168 158 169 static struct linux_utsname lu; 159 170 struct linux_utsname* need_uname(void)