Skip to content
This repository has been archived by the owner on Apr 22, 2023. It is now read-only.

Commit

Permalink
Implement process.arch to get a String of the current processor arc…
Browse files Browse the repository at this point in the history
…hitecture, with docs.
  • Loading branch information
TooTallNate authored and isaacs committed Apr 27, 2011
1 parent a2328dc commit b1be540
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 0 deletions.
7 changes: 7 additions & 0 deletions doc/api/process.markdown
Expand Up @@ -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.
Expand Down
3 changes: 3 additions & 0 deletions src/node.cc
Expand Up @@ -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));

Expand Down
3 changes: 3 additions & 0 deletions wscript
Expand Up @@ -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'] + '"')

Expand Down

0 comments on commit b1be540

Please sign in to comment.