Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Implement `process.arch` to get a String of the current processor arc…

…hitecture, with docs.
  • Loading branch information...
commit b1be5409bd82bf228a6e8678d100197c07e47af1 1 parent a2328dc
@TooTallNate TooTallNate authored isaacs committed
Showing with 13 additions and 0 deletions.
  1. +7 −0 doc/api/process.markdown
  2. +3 −0  src/node.cc
  3. +3 −0  wscript
View
7 doc/api/process.markdown
@@ -271,6 +271,13 @@ The PID of the process.
Getter/setter to set what is displayed in 'ps'.
+### process.arch
+
+What processor architecture you're running on. `'arm'`, `'ia32'`, etc.
+
+ console.log('This processor architecture is ' + process.arch);
+
+
### process.platform
What platform you're running on. `'linux2'`, `'darwin'`, etc.
View
3  src/node.cc
@@ -1992,6 +1992,9 @@ Handle<Object> SetupProcessObject(int argc, char *argv[]) {
+ // process.arch
+ process->Set(String::NewSymbol("arch"), String::New(ARCH));
+
// process.platform
process->Set(String::NewSymbol("platform"), String::New(PLATFORM));
View
3  wscript
@@ -501,6 +501,9 @@ def configure(conf):
else:
conf.env.append_value('CPPFLAGS', '-DHAVE_FDATASYNC=0')
+ # arch
+ conf.env.append_value('CPPFLAGS', '-DARCH="' + conf.env['DEST_CPU'] + '"')
+
# platform
conf.env.append_value('CPPFLAGS', '-DPLATFORM="' + conf.env['DEST_OS'] + '"')
Please sign in to comment.
Something went wrong with that request. Please try again.