Stephen Sanders
unread,Aug 27, 2009, 5:11:41 PM8/27/09Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to psutil-dev
In order to get psutil to work properly on FreeBSD 32 bit and 64 bit
systems, I made the following changes:
1. _psutil_bsd.c should be using "long" instead of "int" for
get_total_phymem() and get_avail_phymem().
2. In _psutil_bsd.c, the tuple mask "llssNll" should be "iissNii" as
gid_t and pid_ are integers and not longs.
3. In _psutil_bsd.c, the return from get_total_phymem() and
get_avail_phymem() should look
something like the following
#if defined(__amd64__)
return Py_BuildValue("L", avail_mem);
#else
return Py_BuildValue("i", avail_mem);
#endif
4. I don't understand why but in _psutil.py, I had to skip the final
attribute check in __eq__(self other)
in order to get the truth values to come out right. The code is
if not sys.platform.lower().startswith("freebsd"):
if getattr(self, attr) != getattr(other, attr):
return False
I can send this along as a patch if desired.