Menu

[0a35e6]: / src / rtlib / dragonfly / sys_fmem.c  Maximize  Restore  History

Download this file

19 lines (14 with data), 364 Bytes

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
/* fre() function */
#include "../fb.h"
#include <sys/sysctl.h>
#include <sys/vmmeter.h>
#include <vm/vm_param.h>
FBCALL size_t fb_GetMemAvail( int mode )
{
int mib[2] = { CTL_VM, VM_METER };
struct vmtotal vmt;
size_t size = sizeof(struct vmtotal);
if( sysctl( mib, 2, &vmt, &size, NULL, 0 ) )
return 0;
return vmt.t_free * sysconf( _SC_PAGE_SIZE );
}
Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.