summaryrefslogtreecommitdiffstats
path: root/freebsd/FreeBSDProcessList.c
Commit message (Collapse)AuthorAgeFilesLines
...
* FreeBSD: drop unused ProcessList fieldsChristian Göttsche2021-01-301-2/+2
|
* FreeBSD: miscChristian Göttsche2021-01-301-3/+3
|
* kfreeBSD: include config.h for _GNU_SOURCE (part 2)Christian Göttsche2021-01-121-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | strcasestr(3) is a GNU extension and when compiling freebsd/Platform.c on kfreebsd for Debian <string.h> is included before we define _GNU_SOURCE, so the function is not available. In file included from ./Object.h:16, from ./ListItem.h:12, from ./Meter.h:16, from ./Header.h:10, from ./Action.h:15, from freebsd/Platform.h:13, from freebsd/Platform.c:8: ./XUtils.h: In function ‘String_contains_i’: ./XUtils.h:43:11: warning: implicit declaration of function ‘strcasestr’; did you mean ‘strcasecmp’? [-Wimplicit-function-declaration] 43 | return strcasestr(s1, s2) != NULL; | ^~~~~~~~~~ | strcasecmp ./XUtils.h:43:30: warning: comparison between pointer and integer 43 | return strcasestr(s1, s2) != NULL; | ^~ In file included from ./Object.h:16, from ./ProcessList.h:16, from freebsd/FreeBSDProcessList.h:15, from freebsd/FreeBSDProcessList.c:8: ./XUtils.h: In function ‘String_contains_i’: ./XUtils.h:43:11: warning: implicit declaration of function ‘strcasestr’; did you mean ‘strcasecmp’? [-Wimplicit-function-declaration] 43 | return strcasestr(s1, s2) != NULL; | ^~~~~~~~~~ | strcasecmp ./XUtils.h:43:30: warning: comparison between pointer and integer 43 | return strcasestr(s1, s2) != NULL; | ^~
* Linux: use correct column alignment for wide fieldsChristian Göttsche2021-01-111-1/+1
| | | | | | | This affects: - PROC_COMM, PROC_EXE and CWD on Linux - JAIL on FreeBSD and DragonFlyBSD - ZONE on Solaris
* Drop usage of formatted error messages from <err.h>Christian Göttsche2021-01-071-2/+1
| | | | | | | They do not clean up the ncurses environment, leaving the terminal in a broken state. Also drop bare usage of exit(3).
* Drop redundant sys/dirent.h includeGraham Inggs2020-12-111-1/+0
| | | sys/dirent.h is included by dirent.h in FreeBSD, and does not exist in Debian GNU/kFreeBSD
* Cull the definitions of pageSize and pageSizeKB from CRT.cNathan Scott2020-12-101-9/+6
| | | | | | | | | | | | | | | By storing the per-process m_resident and m_virt values in the form htop wants to display them in (KB, not pages), we no longer need to have definitions of pageSize and pageSizeKB in the common CRT code. These variables were never really CRT (i.e. display) related in the first place. It turns out the darwin platform code doesn't need to use these at all (the process values are extracted from the kernel in bytes not pages) and the other platforms can each use their own local pagesize variables, in more appropriate locations. Some platforms were actually already doing this, so this change is removing duplication of logic and variables there.
* Drop unused global ProcessList memory fieldsNathan Scott2020-11-271-8/+0
| | | | | | | | | | The global ProcessList structure contains a couple of unused fields. 'sharedMem' has never been used by any Meter, since its not been anything other than zero in Linux /proc/meminfo for many, many years. The freeMem field is only used in the usedMem calculation, so it can reside on the stack like some other memory variables used within-calculations-only and not exposed to the user via a Meter.
* Simplify code flow by inlining declarations where they are usedBenny Baumann2020-11-221-14/+7
| | | | Note that xStrdup always returns non-NULL, thus the one error case cannot be reached.
* No need to check for change when no action is requiredBenny Baumann2020-11-221-4/+2
|
* Simplify page size related calculationsChristian Göttsche2020-11-211-1/+1
|
* Rename virtual memory column from M_SIZE to M_VIRTChristian Göttsche2020-11-211-1/+1
| | | | Closes: #325
* IWYU update (FreeBSD)Christian Goettsche2020-11-191-5/+13
|
* Embracing branchesBenny Baumann2020-11-021-12/+24
|
* Spacing around operatorsBenny Baumann2020-11-021-8/+8
|
* Whitespace and indentation issuesBenny Baumann2020-11-021-21/+21
|
* Spacing after keywords (if)Benny Baumann2020-11-021-2/+2
|
* Add compat wrapper for fstatatChristian Göttsche2020-10-291-2/+3
|
* FreeBSD: update ProcessChristian Göttsche2020-10-291-3/+2
|
* FreeBSD: update ProcessListChristian Göttsche2020-10-291-6/+6
|
* FreeBSD: rework tty process columnChristian Goettsche2020-10-291-1/+78
|
* Unify function argument namesChristian Göttsche2020-10-281-13/+13
| | | | | Name first argument of ProcessList_goThroughEntries consistently super Name first argument of ProcessList_new consistently userTable
* Drop duplicate assignmentChristian Göttsche2020-10-271-1/+0
|
* Hold only a const version of Settings in ProcessListChristian Göttsche2020-10-261-1/+1
|
* Hold only a const version of Settings in ProcessChristian Göttsche2020-10-261-1/+1
|
* Merge branch 'header_pause' of cgzones/htopDaniel Lange2020-10-201-1/+5
|\ | | | | | | Continue to update generic data in paused mode
| * Continue to update generic data in paused modeChristian Göttsche2020-10-191-1/+5
| | | | | | | | | | | | | | | | | | Generic data, as CPU and memory usage, are used by Meters. In paused mode they would stop receiving updates and especially Graph Meters would stop showing continuous data. Improves: #214 Closes: #253
* | Cache PAGE_SIZEChristian Göttsche2020-10-191-4/+5
|/ | | | | | man:sysconf(3) states: The values obtained from these functions are system configuration constants. They do not change during the lifetime of a process.
* Make all required includes explicitBenny Baumann2020-10-181-11/+14
| | | | Information as seen by IWYU 0.12 + clang 9 on Linux
* Refactor generating starttime string into Process classChristian Göttsche2020-10-161-7/+1
|
* Some more locations for ARRAYSIZEBenny Baumann2020-10-081-1/+2
|
* Enable -Wcast-qual compiler warningChristian Göttsche2020-10-061-0/+3
|
* Update License consistently to GPLv2 as per COPYING fileDaniel Lange2020-10-051-1/+1
|
* Fix FreeBSD compile issueBenny Baumann2020-09-291-1/+1
| | | | This issue was previously hidden as xSnprintf expanded to only one large command that didn't trigger the GCC formatting check.
* Fail travis CI on compiler warningsChristian Göttsche2020-09-181-7/+10
|
* Resolve unused variable on FreeBSDChristian Göttsche2020-09-181-2/+0
|
* Switch variable/field naming from WhiteList to MatchListNathan Scott2020-09-091-2/+2
|
* Consolidate repeated macro definitions into one headerNathan Scott2020-09-091-1/+1
| | | | | | | | The MIN, MAX, CLAMP, MINIMUM, and MAXIMUM macros appear throughout the codebase with many re-definitions. Make a single copy of each in a common header file, and use the BSD variants of MINIMUM/MAXIMUM due to conflicts in the system <sys/param.h> headers.
* Axe automated header generation.Zev Weiss2020-09-031-47/+0
| | | | | | | | | | | | | | Reasoning: - implementation was unsound -- broke down when I added a fairly basic macro definition expanding to a struct initializer in a *.c file. - made it way too easy (e.g. via otherwise totally innocuous git commands) to end up with timestamps such that it always ran MakeHeader.py but never used its output, leading to overbuild noise when running what should be a null 'make'. - but mostly: it's just an awkward way of dealing with C code.
* Unbreak with -fno-common on FreeBSDTobias Kortkamp2020-09-031-1/+2
| | | | | | | | | | | | GCC10 and Clang11 now default to -fno-common. ld: error: duplicate symbol: jail_errmsg >>> defined at Platform.c >>> freebsd/Platform.o:(jail_errmsg) >>> defined at FreeBSDProcessList.c >>> freebsd/FreeBSDProcessList.o:(.bss+0x90) Signed-off-by: Tobias Kortkamp <t@tobik.me>
* Fix build on FreeBSDGraham Inggs2020-08-211-11/+0
|
* Merge branch 'hishamhm-pull-920'3.0.0rc1Nathan Scott2020-08-201-14/+13
|\
| * Refactor openzfs_sysctl_init() and ZfsArcMeter...Ross Williams2019-09-031-1/+1
| | | | | | | | | | | | | | | | | | | | | | openzfs_sysctl_init() now returns void instead of int. The ZfsArcStats->enabled flag is set inside the init function now, instead of having to be set from its return value. Preparation for more flag setting in Compressed ARC commit. ZfsArcMeter_readStats() added and all Meter->values[] setting moved to it, eliminating duplicated code in {darwin,freebsd,linux,solaris}/Platform.c.
| * Refactor common OpenZFS sysctl accessRoss Williams2019-07-071-66/+11
| | | | | | | | | | Darwin and FreeBSD export zfs kstats through the same APIs, so moving functions into a common file.
| * Support ZFS ARC stats on FreeBSDRoss Williams2019-07-071-2/+46
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | New meter displays same ARC stats as FreeBSD top(1). Can be extended to other platforms that support ZFS. Pulling kstat.zfs.misc.arcstats.c_max as the meter total, so the meter has a meaningful value to work up to. The Text meter displays, first, the maximum ARC size (Meter.total), then second, the total ARC used, using the difference between Meter.maxItems and Meter.curItems to "hide" the used value from the Bar and Graph drawing functions by using an index in Meter.values[] that is beyond curItems - 1, but less than maxItems - 1.
| * Specify correct MIB lengthRoss Williams2019-07-061-1/+1
| | | | | | | | | | Could have resulted in a buffer overflow if the FreeBSD kernel returned more bytes than expected.
* | Merge branch 'hishamhm-pull-974'Nathan Scott2020-08-201-0/+8
|\ \
| * | Fix STARTTIME column on FreeBSD.Robert Crowston2019-12-311-0/+8
| |/
* / Fix memory statistics display on FreeBSD/powerpcTobias Kortkamp2018-12-241-18/+33
|/ | | | | | | | | | | | | Use the appropriate types when calling sysctl(). Currently, `unsigned long long int` is used for all sizes and on FreeBSD/powerpc this causes all sysctl() calls in scanMemoryInfo() to fail as they are actually of different sizes on powerpc, where (sizeof(unsigned long long int), sizeof(u_long)) == (8, 4) vs (8, 8) on amd64. This results in bogus memory sizes being reported by htop. Signed-off-by: Tobias Kortkamp <tobik@FreeBSD.org>
* Security review: check results of snprintf.Hisham Muhammad2017-07-271-1/+1
| | | | | Calls marked with xSnprintf shouldn't fail. Abort program cleanly if any of them does.

© 2014-2024 Faster IT GmbH | imprint | privacy policy