←back to thread

Ubuntu on Windows

(blog.dustinkirkland.com)
2049 points bpierre | 1 comments | | HN request time: 0.262s | source
Show context
msoad ◴[] No.11390994[source]
So what OS you're going to get when you run an application under this? So if I run this:

    node -e 'console.log(require("os").type())'
What it's going to print?
replies(7): >>11391034 #>>11391059 #>>11391325 #>>11391359 #>>11392940 #>>11393115 #>>11394355 #
1. davesque ◴[] No.11394355[source]
Looks like, if a posix system is detected at compile time, it will return whatever it gets from the `uname` system call in `sys/utsname.h`:

https://github.com/nodejs/node/blob/master/src/node_os.cc#L5...

Microsoft probably hard-codes a response of "Linux" (or whatever would be normal for Ubuntu) for that call to prevent Ubuntu binaries from freaking out.