It seems, that the getlogin()
function is not working when called from the Linux subsystem on Windows (it always returns null).
This leads to two questions:
- Is there a working alternative?
- Is it possible to determine if we are on a "normal" Linux or a "Windows Linux" like stated here?
sudo my-program
to showroot
?