#
# Supported methods:
#
-# - Windows (including Cygwin), OS/2, DJGPP (DOS), and OpenVMS have
-# operating-system specific functions.
+# - Windows (including Cygwin), OS/2, DJGPP (DOS), OpenVMS, AROS,
+# and QNX have operating-system specific functions.
#
# - AIX has _system_configuration.physmem.
#
AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
#if defined(_WIN32) || defined(__CYGWIN__) || defined(__OS2__) \
|| defined(__DJGPP__) || defined(__VMS) \
- || defined(AMIGA) || defined(__AROS__)
+ || defined(AMIGA) || defined(__AROS__) || defined(__QNX__)
int main(void) { return 0; }
#else
compile error
# define __USE_INLINE__
# include <proto/exec.h>
-// AIX
+#elif defined(__QNX__)
+# include <sys/syspage.h>
+# include <string.h>
+
#elif defined(TUKLIB_PHYSMEM_AIX)
# include <sys/systemcfg.h>
#elif defined(AMIGA) || defined(__AROS__)
ret = AvailMem(MEMF_TOTAL);
+#elif defined(__QNX__)
+ const struct asinfo_entry *entries = SYSPAGE_ENTRY(asinfo);
+ size_t count = SYSPAGE_ENTRY_SIZE(asinfo) / sizeof(struct asinfo_entry);
+ const char *strings = SYSPAGE_ENTRY(strings)->data;
+
+ for (size_t i = 0; i < count; ++i)
+ if (strcmp(strings + entries[i].name, "ram") == 0)
+ ret += entries[i].end - entries[i].start + 1;
+
#elif defined(TUKLIB_PHYSMEM_AIX)
ret = _system_configuration.physmem;