Back to index

glibc  2.9
Functions
getsysstats.c File Reference
#include <errno.h>
#include <mach.h>
#include <hurd.h>
#include <sys/sysinfo.h>

Go to the source code of this file.

Functions

int __get_nprocs_conf ()
int __get_nprocs ()
long int __get_phys_pages ()
long int __get_avphys_pages ()

Function Documentation

long int __get_avphys_pages ( void  )

Definition at line 82 of file getsysstats.c.

{
  vm_statistics_data_t vs;
  kern_return_t err;

#ifdef HOST_VM_INFO
  {
    mach_msg_type_number_t count = HOST_VM_INFO_COUNT;
    err = __host_info (__mach_host_self (), HOST_VM_INFO,
                     (host_info_t) &vs, &count);
    if (!err && count < HOST_VM_INFO_COUNT)
      err = EGRATUITOUS;
  }
#else
  err = __vm_statistics (__mach_task_self (), &vs);
#endif
  if (err)
    return __hurd_fail (err);

  return vs.free_count;
}

Here is the call graph for this function:

Here is the caller graph for this function:

int __get_nprocs ( void  )

Definition at line 46 of file getsysstats.c.

{
  struct host_basic_info hbi;
  kern_return_t err;
  mach_msg_type_number_t cnt = HOST_BASIC_INFO_COUNT;

  err = __host_info (__mach_host_self (), HOST_BASIC_INFO,
                   (host_info_t) &hbi, &cnt);
  if (err)
    return __hurd_fail (err);
  else if (cnt != HOST_BASIC_INFO_COUNT)
    return __hurd_fail (EIEIO);

  return hbi.avail_cpus;
}

Here is the call graph for this function:

int __get_nprocs_conf ( void  )

Definition at line 28 of file getsysstats.c.

{
  struct host_basic_info hbi;
  kern_return_t err;
  mach_msg_type_number_t cnt = HOST_BASIC_INFO_COUNT;

  err = __host_info (__mach_host_self (), HOST_BASIC_INFO,
                   (host_info_t) &hbi, &cnt);
  if (err)
    return __hurd_fail (err);
  else if (cnt != HOST_BASIC_INFO_COUNT)
    return __hurd_fail (EIEIO);

  return hbi.max_cpus;
}

Here is the call graph for this function:

Here is the caller graph for this function:

long int __get_phys_pages ( void  )

Definition at line 64 of file getsysstats.c.

{
  struct host_basic_info hbi;
  kern_return_t err;
  mach_msg_type_number_t cnt = HOST_BASIC_INFO_COUNT;

  err = __host_info (__mach_host_self (), HOST_BASIC_INFO,
                   (host_info_t) &hbi, &cnt);
  if (err)
    return __hurd_fail (err);
  else if (cnt != HOST_BASIC_INFO_COUNT)
    return __hurd_fail (EIEIO);

  return hbi.memory_size / __vm_page_size;
}

Here is the call graph for this function: