Skip to content

Commit

Permalink
#997 / virtual_memory() / FreeBSD: sysctl vm.stats.vm.v_cache_count f…
Browse files Browse the repository at this point in the history
…ails on FreeBSD 12; set it to 0
  • Loading branch information
giampaolo committed Mar 23, 2017
1 parent 33928a6 commit 5bb89fd
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 3 deletions.
10 changes: 10 additions & 0 deletions HISTORY.rst
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
*Bug tracker at https://github.com/giampaolo/psutil/issues*

*XXXX-XX-XX*

5.2.1
=====

**Bug fixes**

- 997_: [FreeBSD] virtual_memory() may fail due to missing sysctl parameter on
FreeBSD 12.

*2017-03-05*

5.2.0
Expand Down
4 changes: 2 additions & 2 deletions IDEAS
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ https://github.com/giampaolo/psutil/issues
PLATFORMS
=========

- #355 (patch): Android
- #605 (branch): AIX
- #355: Android (with patch)
- #605: AIX (with branch)
- #276: GNU/Hurd
- DragonFlyBSD
- HP-UX
Expand Down
3 changes: 2 additions & 1 deletion psutil/arch/bsd/freebsd.c
Original file line number Diff line number Diff line change
Expand Up @@ -468,8 +468,9 @@ psutil_virtual_mem(PyObject *self, PyObject *args) {
goto error;
if (sysctlbyname("vm.stats.vm.v_wire_count", &wired, &size, NULL, 0))
goto error;
// https://github.com/giampaolo/psutil/issues/997
if (sysctlbyname("vm.stats.vm.v_cache_count", &cached, &size, NULL, 0))
goto error;
cached = 0;
if (sysctlbyname("vm.stats.vm.v_free_count", &free, &size, NULL, 0))
goto error;
if (sysctlbyname("vfs.bufspace", &buffers, &buffers_size, NULL, 0))
Expand Down

0 comments on commit 5bb89fd

Please sign in to comment.