summaryrefslogtreecommitdiff
path: root/src/alloc.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/alloc.c')
-rw-r--r--src/alloc.c19
1 files changed, 17 insertions, 2 deletions
diff --git a/src/alloc.c b/src/alloc.c
index 4a912703c39..77be94d73d1 100644
--- a/src/alloc.c
+++ b/src/alloc.c
@@ -53,6 +53,10 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
#include <sys/sysinfo.h>
#endif
+#ifdef MSDOS
+#include "dosfns.h" /* For dos_memory_info. */
+#endif
+
#if (defined ENABLE_CHECKING \
&& defined HAVE_VALGRIND_VALGRIND_H \
&& !defined USE_VALGRIND)
@@ -6900,10 +6904,21 @@ values are zero. If the system is not supported, return nil. */)
(uintmax_t) freeswap / 1024);
else
return Qnil;
-#else /* not HAVE_LINUX_SYSINFO, not WINDOWSNT */
+#elif defined MSDOS
+ unsigned long totalram, freeram, totalswap, freeswap;
+
+ if (dos_memory_info (&totalram, &freeram, &totalswap, &freeswap) == 0)
+ return list4i ((uintmax_t) totalram / 1024,
+ (uintmax_t) freeram / 1024,
+ (uintmax_t) totalswap / 1024,
+ (uintmax_t) freeswap / 1024);
+ else
+ return Qnil;
+}
+#else /* not HAVE_LINUX_SYSINFO, not WINDOWSNT, not MSDOS */
/* FIXME: add more systems. */
return Qnil;
-#endif /* HAVE_LINUX_SYSINFO */
+#endif /* HAVE_LINUX_SYSINFO, not WINDOWSNT, not MSDOS */
}
/* Debugging aids. */