mirror of
https://gitlab.com/sortix/sortix.git
synced 2023-02-13 20:55:38 -05:00
37 lines
988 B
Diff
37 lines
988 B
Diff
diff -Paur --no-dereference -- xz.upstream/configure xz/configure
|
|
--- xz.upstream/configure
|
|
+++ xz/configure
|
|
@@ -19269,6 +19269,7 @@
|
|
|
|
#if defined(_WIN32) || defined(__CYGWIN__) || defined(__OS2__) \
|
|
|| defined(__DJGPP__) || defined(__VMS) \
|
|
+ || defined(__sortix__) \
|
|
|| defined(AMIGA) || defined(__AROS__) || defined(__QNX__)
|
|
int main(void) { return 0; }
|
|
#else
|
|
diff -Paur --no-dereference -- xz.upstream/src/common/tuklib_physmem.c xz/src/common/tuklib_physmem.c
|
|
--- xz.upstream/src/common/tuklib_physmem.c
|
|
+++ xz/src/common/tuklib_physmem.c
|
|
@@ -70,6 +70,11 @@
|
|
// This sysinfo() is Linux-specific.
|
|
#elif defined(TUKLIB_PHYSMEM_SYSINFO)
|
|
# include <sys/sysinfo.h>
|
|
+
|
|
+// Sortix
|
|
+#elif defined(__sortix__)
|
|
+# include <unistd.h>
|
|
+
|
|
#endif
|
|
|
|
|
|
@@ -210,6 +215,10 @@
|
|
struct sysinfo si;
|
|
if (sysinfo(&si) == 0)
|
|
ret = (uint64_t)si.totalram * si.mem_unit;
|
|
+#elif defined(__sortix__)
|
|
+ size_t ret_size_t;
|
|
+ memstat(NULL, &ret_size_t);
|
|
+ ret = ret_size_t;
|
|
#endif
|
|
|
|
return ret;
|