Improve system call support

This commit is contained in:
Justine Tunney 2021-08-25 21:35:58 -07:00
parent 63b867bd2f
commit 3085ac7837
65 changed files with 900 additions and 544 deletions

View file

@ -20,6 +20,7 @@
#include "libc/calls/internal.h"
#include "libc/calls/struct/framebuffervirtualscreeninfo.h"
#include "libc/dce.h"
#include "libc/nt/enum/version.h"
#include "libc/nt/system.h"
#include "libc/runtime/runtime.h"
#include "libc/sysv/errfuns.h"
@ -70,9 +71,9 @@ int reboot(int howto) {
if (howto == 0xD000FCE2u) {
ok = !!SetSuspendState(0, 0, 0);
} else {
howto |= kNtShutdownForceOthers;
howto |= kNtShutdownForceSelf;
if (NtGetVersion() >= 8) {
howto |= kNtShutdownForceOthers;
if (NtGetVersion() >= kNtVersionWindows8) {
howto |= kNtShutdownHybrid;
}
if (immediately) {