From d0794ca0aa8c890e00cceff509dc54c1ed444af2 Mon Sep 17 00:00:00 2001 From: Dhanya Thattil Date: Fri, 3 Sep 2021 08:42:13 +0200 Subject: [PATCH] wip --- .../src/slsDetectorServer_funcs.c | 28 +++---------------- 1 file changed, 4 insertions(+), 24 deletions(-) diff --git a/slsDetectorServers/slsDetectorServer/src/slsDetectorServer_funcs.c b/slsDetectorServers/slsDetectorServer/src/slsDetectorServer_funcs.c index 7dec9a8f5..248c05099 100644 --- a/slsDetectorServers/slsDetectorServer/src/slsDetectorServer_funcs.c +++ b/slsDetectorServers/slsDetectorServer/src/slsDetectorServer_funcs.c @@ -13,6 +13,7 @@ #include #include #include +#include #include // defined in the detector specific Makefile @@ -3726,30 +3727,9 @@ int program_fpga(int file_des) { LOG(logINFOBLUE, ("Program size is: %lld\n", (long long unsigned int)filesize)); - int rc; - u_int page_size; - struct vmtotal vmt; - size_t vmt_size, uint_size; - - vmt_size = sizeof(vmt); - uint_size = sizeof(page_size); - - rc = sysctlbyname("vm.vmtotal", &vmt, &vmt_size, NULL, 0); - if (rc < 0) { - perror("sysctlbyname"); - return 1; - } - - rc = sysctlbyname("vm.stats.vm.v_page_size", &page_size, &uint_size, - NULL, 0); - if (rc < 0) { - perror("sysctlbyname"); - return 1; - } - - printf("Free memory : %ld\n", vmt.t_free * (u_int64_t)page_size); - printf("Available memory : %ld\n", vmt.t_avm * (u_int64_t)page_size); - + struct sysinfo info; + sysinfo(&info); + printf("freeram %ld ", info.freeram); /* // delete old /var/tmp/file char cmd[MAX_STR_LENGTH] = {0};