看板 DFBSD_bugs 關於我們 聯絡資訊
:New submission from Carlos Olmedo Escobar <carlos.olmedo.e@gmail.com>: : :I'm developing a library and I need to take the total/free swap space from a :sysctl() call (i can use kvm but in this case my lib will need the suid bit). :This kind of call already exists on FreeBSD (vm.swap_info plus struct xswdev). :Also in Open/NetBSD. We currently have (in HEAD): vm.swap_anon_use # of pages of anonymous memory swapped out to swap. vm.swap_cache_use # of pages of clean data swapped out by swapcache (for people with SSDs). There is no total swap sysctl but I will add one right now. I will call it 'vm.swap_size'. You will then be able to calculate the amount of free swap with (vm.swap_size - vm.anon_use - vm.cache_use). Currently the list of individual swap devices is not exported. -Matt Matthew Dillon <dillon@backplane.com>