diff --git a/doc/api/process.markdown b/doc/api/process.markdown index d1d396a1e9..647d7ddaad 100644 --- a/doc/api/process.markdown +++ b/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. diff --git a/src/node.cc b/src/node.cc index f36cd73bba..70ed8e009e 100644 --- a/src/node.cc +++ b/src/node.cc @@ -1992,6 +1992,9 @@ Handle 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)); diff --git a/wscript b/wscript index b582b5835a..dd7fa75444 100644 --- a/wscript +++ b/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'] + '"')