summaryrefslogtreecommitdiff
path: root/psutil/_psutil_bsd.c
Commit message (Collapse)AuthorAgeFilesLines
* BSD big refact: move proc funcs in new proc.c fileGiampaolo Rodola2023-04-191-1001/+11
|
* C refact: remove useless cmdline / cwd / environ layers. Call direct functionsGiampaolo Rodola2023-04-181-16/+0
|
* [NetBSD] move files / refactoring of C files (#2232)Giampaolo Rodola2023-04-141-1/+4
|
* OpenBSD: rewrite net_connections() from scratch (#2230)Giampaolo Rodola2023-04-131-4/+3
|
* [POSIX] psutil.users() loses precision for "started" attribute #2225 (#2226)Giampaolo Rodola2023-04-121-2/+2
|
* [POSIX] psutil.users() loses precision for "started" attribute #2225 (#2226)Giampaolo Rodola2023-04-111-2/+2
|
* FreeBSD files refactoring (#2059)Giampaolo Rodola2022-01-161-7/+4
|
* Remove docstrings from C function definitions (#2058)Giampaolo Rodola2022-01-161-70/+34
|
* OpenBSD: add support for CPU frequency (#2057)Giampaolo Rodola2022-01-161-3/+4
|
* OpenBSD files refactoring (#2056)Giampaolo Rodola2022-01-161-1/+4
|
* PSUTIL_DEBUG: print file + line number for C ext modules (#2005)Giampaolo Rodola2021-10-261-2/+2
|
* FreeBSD: move CPU C functions in their own cpu.c moduleGiampaolo Rodola2020-12-241-2/+3
|
* Rename cpu_count_physical() to cpu_count_cores()Giampaolo Rodola2020-12-211-2/+2
| | | | | | | | | | This has always been cause of confusion, e.g. see: https://github.com/giampaolo/psutil/pull/1727#issuecomment-698934643 Removed the reference to "physical" from dostrings, functions and test. I still left it in the doc though, as it's more explanatory. Signed-off-by: Giampaolo Rodola <g.rodola@gmail.com>
* [macOS, UNIX] prefer _SC_PAGESIZE over (partially) deprecated getpagesize() ↵Giampaolo Rodola2020-12-171-1/+1
| | | | | | | | | | | | | | | (#1891) Add a reusable `psutil_getpagesize()` utility common to all UNIXes. Related to #1885 (`getpagesize()` is deprecated on recent macOS, POSIX.1-2001 and possibly other UNIXes). The problem emerged on macOS but `getpagesize()` is also used in FreeBSD, NetBSD, OpenBSD and AIX, so it makes sense to do this in one place only, similarly to Windows which also provide a `psutil_getpagesize()` utility. Follow cPython's `mmapmodule.c` and `resourcemodule.c` lead and rely on `sysconf(_SC_PAGESIZE)` instead, but leave `getpagesize()` in place as last resort/attempt for systems where it's not deprecated and/or they still legitimately rely on it. Also provide a python wrapper so we can test the return value of this C function against Python's stdlib modules. Signed-off-by: Giampaolo Rodola <g.rodola@gmail.com>
* [Windows] #1877: turn OpenProcess -> ERROR_SUCCESS into AD or NSP (#1887)Giampaolo Rodola2020-12-141-3/+3
| | | | Signed-off-by: Giampaolo Rodola <g.rodola@gmail.com>
* disk_partitions() maxfile and maxpath (#1863)Giampaolo Rodola2020-10-241-5/+0
|
* [FreeBSD] process resource limits (#1859) (#809)Giampaolo Rodola2020-10-231-0/+4
|
* Implement Process.environ() on *BSD family (#1800) (patch by Armin Gruner)Armin Gruner2020-08-131-1/+149
|
* Properly handle PID type in C (#1672)Giampaolo Rodola2020-01-291-23/+40
|
* OpenBSD fixes (#1673)Giampaolo Rodola2020-01-271-11/+3
|
* get rid of globals.c; move stuff in _psutil_common.cGiampaolo Rodola2020-01-061-5/+1
|
* Fix Process on FreeBSD 12.0+ i386 (#1646)Po-Chuan Hsieh2019-12-211-1/+5
| | | | | FreeBSD 12.0+ change ki_tdev from 32 bits to 64 bits. Reference: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=242543
* release gil around users()/BSD (#1425)Giampaolo Rodola2019-11-201-0/+2
|
* Use Py_CLEAR instead of Py_DECREF to also set the variable to NULL (#1616)Riccardo Schirone2019-11-131-15/+15
| | | | | | | | | | | | | | These files contain loops that convert system data into python objects and during the process they create objects and dereference their refcounts after they have been added to the resulting list. However, in case of errors during the creation of those python objects, the refcount to previously allocated objects is dropped again with Py_XDECREF, which should be a no-op in case the paramater is NULL. Even so, in most of these loops the variables pointing to the objects are never set to NULL, even after Py_DECREF is called at the end of the loop iteration. This means, after the first iteration, if an error occurs those python objects will get their refcount dropped two times, resulting in a possible double-free.
* Fix _psutil_bsd.c compile error on OpenBSD (#1619)Nathan Houghton2019-11-121-1/+1
|
* Refactor C modules init (#1603)Giampaolo Rodola2019-10-211-87/+76
|
* Implement psutil_proc_cwd for NetBSD (#1530)Kamil Rytarowski2019-06-121-1/+1
| | | | Pick KERN_PROC_CWD that is available in 8.99.43 and fallback for older versions to readlink("/proc/$PID/cwd").
* NetBSD fixes (#1526)Kamil Rytarowski2019-06-111-0/+2
| | | | | | | | | | | | | | | | | | | * Fix psutil_get_cmd_args() for NetBSD Do not overallocate the buffer prompting for KERN_ARGMAX. It also fixes the code as KERN_ARGMAX was received into a size_t type, while kernel returned int. It caused argmax to contain garbage and allocation was randomly crashing with new jemalloc in the basesystem. New code prompts for exact buffer size before allocation and stores argv[] inside it. Bug investigated by Leonardo Taccari. * Stop including sys/user.h for NetBSD This header was removed from the OS as it was empty.
* #1411 / BSD / Process() init: use Py_INCREF() around process name pyobj and ↵Giampaolo Rodola2019-02-251-4/+2
| | | | avoid segfault
* #1428 in case of error, show the C syscall which caused itGiampaolo Rodola2019-02-241-1/+1
|
* Add CPU frequency support for FreeBSD (#1369)Alex Manuskin2018-12-011-0/+2
| | | | Add CPU frequency support for FreeBSD (patch by @amanusk)
* FreeBSD adding temperature sensors (WIP) (#1350)Alex Manuskin2018-11-031-0/+2
| | | FreeBSD: add temperature sensors
* Rename OSX to macOS (#1298)Giampaolo Rodola2018-06-261-1/+1
| | | rename OSX to macOS
* 1173 debug mode (#1176)Giampaolo Rodola2017-11-141-1/+1
| | | | | | | | | | | | | | | | | | | | | | * implement PSUTIL_DEBUG from C module * update doc * add psutil_debug() utility function * update doc * enable PSUTIL_DEBUG for tests * update appveyor.yml * change psutil_debug() signature so that it can accept variable num of args * provide DEBUG info in psutil_raise_for_pid() * properly print debug message * do not print too much
* define a setup() function which is called on import by all C modulesGiampaolo Rodola2017-11-121-0/+2
|
* refactor PSUTIL_TESTING C APIsGiampaolo Rodola2017-11-121-3/+1
|
* get rid of PSUTIL_TESTING env var: it must be necessarily set from cmdline, ↵psutil-test-flagGiampaolo Rodola2017-11-111-2/+4
| | | | hence 'python -m psutil.tests' won't work out of the box
* PSUTIL_TESTING env var (#1083)Giampaolo Rodola2017-05-181-1/+5
| | | | | | | | | | | | | | * Introduce PSUTIL_TESTING env var ...so that we can make stricter assertions in C and py code during tests only. * define a C function in _common.c which returns whether the var is set * set PSUTIL_TESTING from the Makefile * cache psutil_testing() result * winmake: set PSUTIL_TESTING env var for tests
* Freebsd socks refactoring (#1073)Giampaolo Rodola2017-05-161-1/+2
| | | | | | | | * freebsd: split socks.c into 2 separate files * remove unused h files * freebsd: split socks.c into 2 separate files
* BSD: mv arch C files (#1072)Giampaolo Rodola2017-05-161-5/+5
| | | | | | | | | | * move freebsd C arch files * rename C file * move openbsd C arch files * move netbsd C arch files
* fix #1069 / freebsd: cpu_num() may return 255; now returns -1Giampaolo Rodola2017-05-141-3/+4
|
* fix #1065: cmdline() on OpenBSD may raise SystemError; also set a limit of ↵Giampaolo Rodola2017-05-131-5/+2
| | | | retries to realloc() the space to store the cmdline to max 8k so that it won't loop forever
* fix failing tests on netbsdGiampaolo Rodola2017-05-131-1/+0
|
* refactor ifdefsGiampaolo Rodola2017-05-121-6/+2
|
* fix compilation err on netbsdGiampaolo Rodola2017-05-121-3/+3
|
* freebsd: fix memory leak in open_files()Giampaolo Rodola2017-05-121-3/+3
|
* broken links: also inspect C and H filesGiampaolo Rodola2017-05-121-5/+5
|
* merge from masterGiampaolo Rodola2017-05-021-1/+9
|\
| * #1022 / users(): PID cannot be determined on OpenBSD so we set it to NoneGiampaolo Rodola2017-05-011-1/+9
| |
* | #1040: add replacement for PyUnicode_DecodeFSDefaultAndSize on Python 2; ↵Giampaolo Rodola2017-05-011-11/+11
| | | | | | | | also get rid of the pstuil_ prefix and use the original Python names