This repository was archived by the owner on Oct 16, 2021. It is now read-only.
AIX - os.release() returns only minor version of OS #34
Copy link
Copy link
Closed
Description
Activity
On AIX -
uname -rvreturns "1 6"
This is interpreted as release 1, version 6 -> humans would call this 6.1The following patch causes os.release() on AIX to return just that
diff --git a/src/node_os.cc b/src/node_os.cc index 07f73f4..571cc91 100644 --- a/src/node_os.cc +++ b/src/node_os.cc @@ -94,7 +94,19 @@ static Handle<Value> GetOSRelease(const Arguments& args) { if (uname(&info) < 0) { return ThrowException(ErrnoException(errno, "uname")); } +#ifdef _AIX + /* + * On AIX info.release is only a part of OS release version. + * We need to combine info.version and info.release + */ + char versionInfo[2*SYS_NMLN+1] = {0}; + strcpy(versionInfo, info.version); + versionInfo[strlen(info.version)] = '.'; + strcpy(versionInfo + strlen(info.version) + 1, info.release); + return scope.Close(String::New(versionInfo)); +#else return scope.Close(String::New(info.release)); +#endif #else // __MINGW32__ char release[256]; OSVERSIONINFO info;
Metadata
Metadata
Assignees
Labels
No labels
os.release();will return '1' on AIX 6.1On Linux systems we get back the same answer as
uname -rThe documentation http://nodejs.org/api/os.html#os_os_release claims to run the operating system release. (it appears to be open to interpretation)