FreeBSD 6.3 32 bit and 64 bit

5 views
Skip to first unread message

Stephen Sanders

unread,
Aug 27, 2009, 5:11:41 PM8/27/09
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.

Giampaolo Rodola'

unread,
Aug 27, 2009, 6:26:56 PM8/27/09
to psutil-dev
Hi,
please open a bug report for this with the patch attached, but from
the code you pasted in point #4 I understand you're using the 0.1.2
version (I presume it's the pristine tarball).
You should get the latest code from SVN and work on that one.

Thanks

Stephen Sanders

unread,
Aug 28, 2009, 7:27:47 AM8/28/09
to psutil-dev
You're correct, I'm using the tar ball.

I'll pick up the code from SVN and file a bug as soon as I can.

Thanks
Reply all
Reply to author
Forward
0 new messages