int GPTLget_memusage (int *size, int *rss, int *share, int *text, int *datastack)
 
/*
** $Id: get_memusage.c,v 1.10 2010-11-09 19:08:53 rosinski Exp $
**
** Author: Jim Rosinski
**   Credit to Chuck Bardeen for MACOS section (__APPLE__ ifdef)
**
** get_memusage: 
**
**   Designed to be called from Fortran, returns information about memory
**   usage in each of 5 input int* args.  On Linux read from the /proc
**   filesystem because getrusage() returns placebos (zeros).  Return -1 for
**   values which are unavailable or ambiguous on a particular architecture.
**
**   Return value: 0  = success
**                 -1 = failure
*/
#include <sys/resource.h>
#include "gptl.h"    /* additional cpp defs and function prototypes */
/* _AIX is automatically defined when using the AIX C compilers */
#ifdef _AIX
#include <sys/times.h>
#endif
#ifdef IRIX64
#include <sys/time.h>
#endif
#ifdef HAVE_SLASHPROC
#include <sys/time.h>
#include <sys/types.h>
#include <stdio.h>
#include <unistd.h>
#elif (defined __APPLE__)
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#endif
#ifdef BGP
#include <spi/kernel_interface.h>
#include <common/bgp_personality.h>
#include <common/bgp_personality_inlines.h>
#include <malloc.h>
#define   Personality                    _BGP_Personality_t