Bug 172803 - [patch] sysutils/py-psutil: get_virtual_mem() fails without COMPAT_FREEBSD[4-7]
Summary: [patch] sysutils/py-psutil: get_virtual_mem() fails without COMPAT_FREEBSD[4-7]
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: Normal Affects Only Me
Assignee: Po-Chuan Hsieh
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-10-17 02:40 UTC by Jan Beich
Modified: 2013-04-13 12:50 UTC (History)
0 users

See Also:


Attachments
bufspace_type.diff (1.62 KB, patch)
2012-10-17 02:40 UTC, Jan Beich
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Jan Beich freebsd_committer freebsd_triage 2012-10-17 02:40:02 UTC
vfs.bufspace type was changed from `int' to `long' in r189595.

ref. http://svnweb.freebsd.org/changeset/base/189595
     http://svnweb.freebsd.org/changeset/base/189627
     https://code.google.com/p/psutil/issues/detail?id=325
Comment 1 Edwin Groothuis freebsd_committer freebsd_triage 2012-10-17 02:40:13 UTC
Responsible Changed
From-To: freebsd-ports-bugs->sunpoet

Over to maintainer (via the GNATS Auto Assign Tool)
Comment 2 dfilter service freebsd_committer freebsd_triage 2013-04-13 12:49:09 UTC
Author: crees
Date: Sat Apr 13 11:49:01 2013
New Revision: 315794
URL: http://svnweb.freebsd.org/changeset/ports/315794

Log:
  Fix on FreeBSD 8+
  
  PR:		ports/172803
  Submitted by:	Jan Beich
  Approved by:	maintainer timeout (sunpoet, ~6 months)
  Approved by:	portmgr (decke)

Modified:
  head/sysutils/py-psutil/Makefile
  head/sysutils/py-psutil/files/patch-psutil-_psutil_bsd.c

Modified: head/sysutils/py-psutil/Makefile
==============================================================================
--- head/sysutils/py-psutil/Makefile	Sat Apr 13 09:41:06 2013	(r315793)
+++ head/sysutils/py-psutil/Makefile	Sat Apr 13 11:49:01 2013	(r315794)
@@ -1,12 +1,9 @@
-# New ports collection makefile for:	py-psutil
-# Date created:				04 May 2010
-# Whom:					Ju Pengfei <jupengfei@gmail.com>
-#
+# Created by: Ju Pengfei <jupengfei@gmail.com>
 # $FreeBSD$
-#
 
 PORTNAME=	psutil
 PORTVERSION=	0.6.1
+PORTREVISION=	1
 CATEGORIES=	sysutils python
 MASTER_SITES=	GOOGLE_CODE
 PKGNAMEPREFIX=	${PYTHON_PKGNAMEPREFIX}

Modified: head/sysutils/py-psutil/files/patch-psutil-_psutil_bsd.c
==============================================================================
--- head/sysutils/py-psutil/files/patch-psutil-_psutil_bsd.c	Sat Apr 13 09:41:06 2013	(r315793)
+++ head/sysutils/py-psutil/files/patch-psutil-_psutil_bsd.c	Sat Apr 13 11:49:01 2013	(r315794)
@@ -1,5 +1,35 @@
 --- psutil/_psutil_bsd.c.orig	2012-08-16 23:07:37.000000000 +0800
 +++ psutil/_psutil_bsd.c	2012-09-27 14:50:20.843763756 +0800
+@@ -576,12 +576,19 @@ get_process_memory_info(PyObject* self, 
+ static PyObject*
+ get_virtual_mem(PyObject* self, PyObject* args)
+ {
+-    unsigned int   total, active, inactive, wired, cached, free, buffers;
++    unsigned int   total, active, inactive, wired, cached, free;
+     size_t		   size = sizeof(total);
+ 	struct vmtotal vm;
+ 	int            mib[] = {CTL_VM, VM_METER};
+ 	long           pagesize = getpagesize();
+ 
++#if __FreeBSD_version > 702101
++    long buffers;
++#else
++    int buffers;
++#endif
++    size_t buffers_size = sizeof(buffers);
++
+     if (sysctlbyname("vm.stats.vm.v_page_count", &total, &size, NULL, 0))
+         goto error;
+     if (sysctlbyname("vm.stats.vm.v_active_count", &active, &size, NULL, 0))
+@@ -594,7 +601,7 @@ get_virtual_mem(PyObject* self, PyObject
+         goto error;
+     if (sysctlbyname("vm.stats.vm.v_free_count", &free, &size, NULL, 0))
+         goto error;
+-    if (sysctlbyname("vfs.bufspace", &buffers, &size, NULL, 0))
++    if (sysctlbyname("vfs.bufspace", &buffers, &buffers_size, NULL, 0))
+         goto error;
+ 
+     size = sizeof(vm);
 @@ -1376,8 +1376,10 @@
              strlcat(opts, ",noclusterr", sizeof(opts));
          if (flags & MNT_NOCLUSTERW)
_______________________________________________
svn-ports-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-ports-all
To unsubscribe, send any mail to "svn-ports-all-unsubscribe@freebsd.org"
Comment 3 Chris Rees freebsd_committer freebsd_triage 2013-04-13 12:49:18 UTC
State Changed
From-To: open->closed

Committed. Thanks!