wsl 0.1.0

Detect if the program is running under Windows Subsystem for Linux
Documentation
  • Coverage
  • 66.67%
    2 out of 3 items documented1 out of 2 items with examples
  • Size
  • Source code size: 3.16 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 1.1 MB This is the summed size of all files generated by rustdoc for all configured targets
  • Links
  • Dentosal/wsl-rs
    5 3 3
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • Dentosal

Detect if the code is ran under Windows Subsystem for Linux

Usage

wsl::is_wsl() returns true under WSL, false otherwise.

Method

A semi-official source lists some pointers. We are going to use the simplest approach here: Testing if /proc/sys/kernel/osrelease contains string Microsoft or WSL.