:New submission from Carlos Olmedo Escobar <[email protected]>:
:
: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 
                                        <[email protected]>

Reply via email to