summaryrefslogtreecommitdiff
path: root/libiberty/physmem.c
diff options
context:
space:
mode:
authorghazi <ghazi@138bc75d-0d04-0410-961f-82ee72b054a4>2003-02-22 15:39:16 +0000
committerghazi <ghazi@138bc75d-0d04-0410-961f-82ee72b054a4>2003-02-22 15:39:16 +0000
commit4195ec6ac08b9ca0c7c04c52d785f3f5c56581f5 (patch)
tree37e0fbe96e286c2f526746e6bbe9b37fae875e21 /libiberty/physmem.c
parent0991d38e7beb2f0729589412b1712ac4805a4aee (diff)
downloadgcc-4195ec6ac08b9ca0c7c04c52d785f3f5c56581f5.tar.gz
* configure.in: Check for sys/systemcfg.h and
_system_configuration. * physmem.c: Add support for AIX. Tweek formatting as per upstream coreutils beta. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@63287 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libiberty/physmem.c')
-rw-r--r--libiberty/physmem.c27
1 files changed, 18 insertions, 9 deletions
diff --git a/libiberty/physmem.c b/libiberty/physmem.c
index c502a86c118..80fdd7975e9 100644
--- a/libiberty/physmem.c
+++ b/libiberty/physmem.c
@@ -15,7 +15,7 @@
along with this program; if not, write to the Free Software Foundation,
Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
-/* Written by Paul Eggert and Jim Meyering. */
+/* Written by Paul Eggert. */
#if HAVE_CONFIG_H
# include <config.h>
@@ -30,26 +30,30 @@
#endif
#if HAVE_SYS_SYSMP_H
-#include <sys/sysmp.h>
+# include <sys/sysmp.h>
#endif
#if HAVE_SYS_SYSINFO_H && HAVE_MACHINE_HAL_SYSINFO_H
-# include <sys/sysinfo.h>
-# include <machine/hal_sysinfo.h>
+# include <sys/sysinfo.h>
+# include <machine/hal_sysinfo.h>
#endif
#if HAVE_SYS_TABLE_H
-# include <sys/table.h>
+# include <sys/table.h>
#endif
#include <sys/types.h>
#if HAVE_SYS_PARAM_H
-#include <sys/param.h>
+# include <sys/param.h>
#endif
#if HAVE_SYS_SYSCTL_H
-#include <sys/sysctl.h>
+# include <sys/sysctl.h>
+#endif
+
+#if HAVE_SYS_SYSTEMCFG_H
+# include <sys/systemcfg.h>
#endif
#include "libiberty.h"
@@ -83,7 +87,7 @@ physmem_total ()
#if HAVE_SYSMP && defined MP_SAGET && defined MPSA_RMINFO && defined _SC_PAGESIZE
{ /* This works on irix6. */
struct rminfo realmem;
- if (sysmp(MP_SAGET, MPSA_RMINFO, &realmem, sizeof(realmem)) == 0)
+ if (sysmp (MP_SAGET, MPSA_RMINFO, &realmem, sizeof realmem) == 0)
{
double pagesize = sysconf (_SC_PAGESIZE);
double pages = realmem.physmem;
@@ -120,6 +124,11 @@ physmem_total ()
}
#endif
+#if HAVE__SYSTEM_CONFIGURATION
+ /* This works on AIX. */
+ return _system_configuration.physmem;
+#endif
+
/* Return 0 if we can't determine the value. */
return 0;
}
@@ -155,7 +164,7 @@ physmem_available ()
#if HAVE_SYSMP && defined MP_SAGET && defined MPSA_RMINFO && defined _SC_PAGESIZE
{ /* This works on irix6. */
struct rminfo realmem;
- if (sysmp(MP_SAGET, MPSA_RMINFO, &realmem, sizeof(realmem)) == 0)
+ if (sysmp (MP_SAGET, MPSA_RMINFO, &realmem, sizeof realmem) == 0)
{
double pagesize = sysconf (_SC_PAGESIZE);
double pages = realmem.availrmem;