Commit Graph

30 Commits

Author SHA1 Message Date
Gaël Bonithon
8abbd3bd3a build: Add GLib requirement
For consistency with other components and for the GLib macros set by
XDT_CHECK_PACKAGE when building with xfce4-dev-tools >= 4.17.1.
2023-02-03 21:07:37 +01:00
Klemens Nanni
c456487917 Do not treat missing swap as error on OpenBSD and NetBSD
https://man.openbsd.org/swapctl.2 `SWAP_NSWAP` is always successful.

Do not treat a count of zero as error such that the task manager becomes
usable on systems without any swap configured.

Fix #67.
2022-12-25 18:39:06 +04:00
Jan Ziak
bed04577a5 Add support for MemAvailable (!10)
MemAvailable is in /proc/meminfo since Linux 3.14.

This aligns the reported memory usage with the memory usage
reported by xfce4-systemload-plugin.

Closes !10
2020-10-12 14:57:23 -03:00
Landry Breuil
993ef78b81 Switch back all bzero() calls to use memset()
Even if it's uglier to use memset, bzero seems deprecated.
2018-06-03 17:56:31 +02:00
rim
01abcbdd73 Properly bzero args (bug 14401) 2018-05-30 21:52:10 +02:00
rim
bbee897079 use a 1k buffer for the initial argv malloc (bug 14401) 2018-05-30 21:51:50 +02:00
rim
1c09b7329b Use the proper types, add casts where necessary (bug 14401) 2018-05-30 21:46:29 +02:00
rim
8e1b48f8de Move getpwuid() from backends to gui, use getpwuid_r(), call only once on task add. (bug 14401) 2018-05-30 21:31:01 +02:00
rim
ceb5a7d347 Make pid type: GPid (bug 14401) 2018-05-30 21:28:35 +02:00
Landry Breuil
159c3c1d0c Sort the task list by pid, as we're going to use bsearch() (bug 14403) 2018-05-26 23:52:46 +02:00
rim
704411a38b Properly use float for constants where appropriate (bug 14401, bug 14403) 2018-05-26 23:51:32 +02:00
rim
2329f243fb Properly zero memory where appropriate (bug 14401, bug 14403) 2018-05-26 23:40:11 +02:00
Landry Breuil
58d67dbada Check against SSTOP status to decide if the process was stopped
Sleeping doesnt have the same semantics as on linux..
Fixes Stop/Continue actions on a process
2014-12-23 21:43:49 +01:00
Landry Breuil
a6fc195392 remove unused variable 2014-12-20 11:25:02 +01:00
Landry Breuil
58689d2683 Fix random crash on an ugly string handling in bsd backend.
Replace an horrible strlcat loop + g_snprintf by g_strjoinv + g_strlcpy.
Assert that the buffer is valid UTF8, blow otherwise.
2014-12-18 22:57:52 +01:00
Landry Breuil
a554ff2e8b Repair memory and swap size calculation on OpenBSD. 2014-12-04 20:35:17 +01:00
Landry Breuil
69f56371ba Silently and gracefully handle the case when a process disappears before we try to get its argv 2014-12-03 18:30:34 +01:00
Landry Breuil
bf7ad9f99e include <sys/vmmeter.h> for struct vmtotal, probably needed on NetBSD 2014-11-29 10:33:49 +01:00
Martin Pieuchot
9d85be6016 On OpenBSD, prefer the UVM way to the vmmeter one to get memory stats. 2014-11-29 10:33:10 +01:00
Landry Breuil
e293a72e0f Include <sys/proc.h> for P_ZOMBIE & SSLEEP macros definition. 2014-01-09 22:10:09 +01:00
Landry Breuil
0984dd8aa3 OpemBSD removed KERN_PROC2/KINFO_PROC2 some months ago, do the #ifdef dance
Effectively merges http://www.openbsd.org/cgi-bin/cvsweb/ports/x11/xfce4/xfce4-taskmanager/patches/patch-src_task-manager-bsd_c?rev=1.1
Keep the old code for NetBSD/DragonflyBSD.
2012-04-23 10:47:49 +02:00
Mike Massonnet
97d2f77ee6 [openbsd] Don't provide memory/swap values in KiB 2010-05-21 13:37:35 +02:00
Landry Breuil
ee9bd057fd Merge branch 'master' of ssh://git.xfce.org/git/apps/xfce4-taskmanager
Conflicts:
	src/task-manager-bsd.c
2010-05-16 12:56:06 +02:00
Landry Breuil
00d6107972 Implement pid_is_sleeping() and fix send_signal_to_pid() 2010-05-16 12:53:50 +02:00
Mike Massonnet
b961822ba4 Move POSIX code to task-manager.c
The functions send_signal_to_pid() and set_priority_to_pid() are using
POSIX functions and “should” be safe in task-manager.c. Still keep the
enumeration as a bridge between virtual values and real values, there is
no benefit removing them (wasting minutes) and it won't make the code
look better (or worse).

The functions have been removed from the Linux and BSD implementations.
2010-05-16 12:30:37 +02:00
Landry Breuil
a721cda4be Set Task name from p_comm field, and cmdline from KERN_PROC_ARGV 2010-05-13 20:07:35 +02:00
Landry Breuil
44dc437214 correctly implement set_priority/send_signal_to_pid() 2010-05-13 19:57:37 +02:00
Landry Breuil
10247249eb Implement fetching of swap stats 2010-05-13 19:56:51 +02:00
Landry Breuil
e5ad1842bf Fix missing includes, remove unused variables 2010-05-13 19:56:10 +02:00
Landry Breuil
3acd330400 WIP on OpenBSD support
- update wrt new Task structure
- handle zombie processes
- get full cmdline
rework
2010-05-13 18:36:17 +02:00