summaryrefslogtreecommitdiff
path: root/src/cli.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/cli.c')
-rw-r--r--src/cli.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/cli.c b/src/cli.c
index 0ec95b1..f5bdcd1 100644
--- a/src/cli.c
+++ b/src/cli.c
@@ -400,6 +400,7 @@ void print_guessed_env( bool human_readable )
char hostname[100];
gethostname( hostname, sizeof( hostname ) );
unsigned int nofCpus = system_available_cpus( );
+ unsigned int nofPhysMem = system_phys_memory( );
char os_name[100];
system_os( os_name, sizeof( os_name ) );
char machine_arch[100];
@@ -410,6 +411,7 @@ void print_guessed_env( bool human_readable )
printf( "Operating system: %s\n", os_name );
printf( "Hostname: %s\n", hostname );
printf( "Number of CPUs: %d\n", nofCpus );
+ printf( "Physical memory in kB: %d\n", nofPhysMem );
} else {
json_object *obj = json_object_new_object( );
@@ -421,6 +423,8 @@ void print_guessed_env( bool human_readable )
json_object_object_add( obj, "host", host );
json_object *cpus = json_object_new_int( nofCpus );
json_object_object_add( obj, "cpus", cpus );
+ json_object *physMem = json_object_new_int( nofPhysMem );
+ json_object_object_add( obj, "physical_memory", physMem );
const char *msg = json_object_to_json_string( obj );
char *res = strdup( msg );