Hi, lists.

At startup-time, gtkg always warns "Unable to determine amount of physical RAM",
and I've noticed there is condition whether physical memory is enough or not
as to be ultrapeer node, in preference of GnutellaNet.

Yes, I've seen a Linux, FreeBSD, MacOS X, Solaris as a ultrapeer, however
IRIX, never! So, I've some works to resolve it. But there are some problem;

1) It needs '#include <invent.h>' in src/common.h with proper macro directive
   in both it and config.h (eg. I_INVENT).

2) Therefore it needs some modification for Configure, config.sh, config_h.SH,
   and adding U/d_invent.U or the like.

3) In my machine (O2 - n32 bit), detecting amount of RAM was a success, but in
   other SGI machine (Indy - o32 bit, Octane - 64 bit), I don't know...

4) Finally, I think it might be important especially, an additional code is
   just only returning amount of RAM, instead of warning not to be detected
   with g_warning! and I don't know variable and typedef is valid or not...

If there are other IRIX user or familiar with it, could you advice me?
I welcome any suggestion, and thanks in advance.

--- src/core/settings.c  2004-11-19 12:11:44.717640255 +0900
+++ src/core/settings.c  2004-11-20 00:00:02.166717760 +0900
@@ -210,7 +210,20 @@
                        "settings_getphysmemsize: sysctl() for HW_USERMEM 
failed: %s",
                        g_strerror(errno));
        return amount / 1024;
-#else /* !(defined (_SC_PHYS_PAGES) || defined(HAS_SYSCTL)) */
+#elif defined (__sgi__)
+        inventory_t *inv;
+        ulong_t physmem = 0;
+
+        setinvent();
+        while ((inv = getinvent())) {
+                if (inv->inv_class == INV_MEMORY && inv->inv_type == 
INV_MAIN_MB) {
+                        physmem = inv->inv_state * 1024;
+                        g_message("detected amount of physiacal RAM: %lu KB", 
physmem);
+                        return physmem;
+                }
+        }
+        endinvent();
+#else /* !(defined (_SC_PHYS_PAGES) || defined(HAS_SYSCTL) || defined 
(__sgi__)) */
        g_warning("Unable to determine amount of physical RAM");
        return 0;
 #endif         /* _SC_PHYS_PAGES */


-------------------------------------------------------
This SF.Net email is sponsored by: InterSystems CACHE
FREE OODBMS DOWNLOAD - A multidimensional database that combines
robust object and relational technologies, making it a perfect match
for Java, C++,COM, XML, ODBC and JDBC. www.intersystems.com/match8
_______________________________________________
Gtk-gnutella-devel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/gtk-gnutella-devel

Reply via email to