summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/biruda.c2
-rw-r--r--src/system.c11
2 files changed, 11 insertions, 2 deletions
diff --git a/src/biruda.c b/src/biruda.c
index ea1fce5..091bbbf 100644
--- a/src/biruda.c
+++ b/src/biruda.c
@@ -205,7 +205,7 @@ static void print_config( struct gengetopt_args_info *args_info, cfg_t *cfg )
puts( "Environment:" );
printf( " Number of CPUs: %d\n", nofCpus );
int physMem = system_phys_memory( );
- printf( " Physical memory available: %d MB\n", physMem );
+ printf( " Physical memory available: %d kB\n", physMem );
char machine_arch[100];
system_arch( machine_arch, sizeof( machine_arch ) );
printf( " System architecture: %s\n", machine_arch );
diff --git a/src/system.c b/src/system.c
index b947ce2..9e2256d 100644
--- a/src/system.c
+++ b/src/system.c
@@ -390,8 +390,17 @@ int system_phys_memory( )
memset( &memState, 0, sizeof( MEMORYSTATUSEX ) );
memState.dwLength = sizeof( MEMORYSTATUSEX );
GlobalMemoryStatusEx( &memState );
- return memState.ullTotalPhys / 1024 / 1024;
+ return memState.ullTotalPhys / 1024;
+#elif defined( linux ) || defined( __linux ) || defined( __linux__ )
+ size_t pageSize;
+ size_t nofPages;
+
+ pageSize = sysconf( _SC_PAGESIZE );
+ nofPages = sysconf( _SC_PHYS_PAGES );
+
+ return ( pageSize / 1024 ) * nofPages;
#else
+#error Not ported yet!
#endif
}