From 2f976f3a5e9b5995ab368c1e20be1892f1775012 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?P=C3=A1ll=20Haraldsson?= Date: Sun, 24 Nov 2024 16:30:15 +0000 Subject: [PATCH] Update sysinfo.jl --- base/sysinfo.jl | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/base/sysinfo.jl b/base/sysinfo.jl index 7dab313cf4f57..ccb1a2df4f247 100644 --- a/base/sysinfo.jl +++ b/base/sysinfo.jl @@ -80,7 +80,6 @@ A symbol representing the architecture of the build configuration. """ const ARCH = ccall(:jl_get_ARCH, Any, ())::Symbol - """ Sys.KERNEL::Symbol @@ -513,6 +512,19 @@ See documentation in [Handling Operating System Variation](@ref). """ iswindows(os::Symbol) = (os === :Windows || os === :NT) +""" + Sys.isWSL([os]) + +Predicate for testing if the OS is the Windows subsystem for Linux (version 2 or the original), +running under a derivative of Microsoft Windows NT. +See documentation in [Handling Operating System Variation](@ref). + +!!! compat "Julia 1.12" + This function requires at least Julia 1.12. +""" +# https://superuser.com/questions/1749781/how-can-i-check-if-the-environment-is-wsl-from-a-shell-script +iswindows(os::Symbol) = ispath("/proc/sys/fs/binfmt_misc/WSLInterop") # WSL sigil + """ Sys.isapple([os])