-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
lscpu: Detect Windows Subsystem for Linux
Windows 10 implements Windows Subsystem for Linux (WSL). WSL does not implement support for SIGSEGV handler, which is used inside is_vmware_platform(). As a result, lscpu crashes there. Implement WSL detection, and as a side effect, work around the crash. Note that none of existing virtualization types exactly matches. But the the closest would be "container". References: Provide a way to positively detect WSL from an app compiled on Linux. microsoft/WSL#423 missing support for SIGSEGV handler microsoft/WSL#1637 Signed-off-by: Stanislav Brabec <sbrabec@suse.cz>
- Loading branch information
1 parent
afa382f
commit 7572fb2
Showing
2 changed files
with
20 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,6 +18,7 @@ enum { | |
HYPER_OS400, | ||
HYPER_PHYP, | ||
HYPER_SPAR, | ||
HYPER_WSL, | ||
}; | ||
|
||
extern int read_hypervisor_dmi(void); | ||
|