Topic
IC4NOTICE: developerWorks Community will be offline May 29-30, 2015 while we upgrade to the latest version of IBM Connections. For more information, read our upgrade FAQ.
1 reply Latest Post - ‏2012-08-17T12:08:59Z by flodstrom
ofarooq
ofarooq
1 Post
ACCEPTED ANSWER

Pinned topic Finding via a system subroutine, the system model name.

‏2012-08-16T01:54:22Z |
Hello,

I need to (via a C++ program) get the system model name. Platform is AIX 5.3. Basically I need to get the same information as "uname -M" command. e.g. IBM, 1234-E4A

I tried using the uname() but could not get this information and I am trying to avoid popen/system calls.

Any help/suggestions appreciated.

Thanks
Updated on 2012-08-17T12:08:59Z at 2012-08-17T12:08:59Z by flodstrom
  • flodstrom
    flodstrom
    57 Posts
    ACCEPTED ANSWER

    Re: Finding via a system subroutine, the system model name.

    ‏2012-08-17T12:08:59Z  in response to ofarooq
    Try something like the following, it works in 6.1 not sure about 5.3 though?

    
    #include <stdio.h>   #include <cf.h> #include <sys/cfgodm.h> #include <sys/cfgdb.h>   
    
    int main() 
    { struct CuAt *odmobj; 
    
    int how_many; odmobj = getattr(
    "sys0", 
    "modelname", 0, &how_many);   printf(
    "Modelname: %s\n", odmobj->value);   
    
    return 0; 
    }
    


    Look at Object Data Manager (ODM) programming for more specific things.