bmahler commented on pull request #365:
URL: https://github.com/apache/mesos/pull/365#issuecomment-631787330


   @Digital-Chaos Thanks! Looked through the sysctl related documentation and 
the code makes sense to me. I will ship this as is.
   
   However, I wonder why the code bothers with the lookup by name -> mib 
transformation and doesn't just do by name (slower) or by mib (faster) entirely:
   
   ```
   sysctlbyname("vm.swap_info.0", ...)
   sysctlbyname("vm.swap_info.1", ...)
   // until ENOENT
   
   // Or:
   int mib[3] = { CTL_VM, XXX, 0 }; // Oh.. I can't find something that looks 
like swap_info,
                                    // is there not a mib constant we can use 
for every name we can lookup?
   sysctl(...);
   ```
   
   (This applies to the earlier sysctlbyname calls in this function as well). 
Is it because not all entries have mib constants that we can just fill in 
without lookup?
   
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Reply via email to