freebsd-ports/sysutils/wmmemfree/Makefile
Alexey Dokuchaev c8bcf96c00 sysutils/wmmemfree: modernize, unbreak, undeprecate the port (+)
When I ported this dockapp 20 years ago, it was not uncommon to
peek inside ``struct vmmeter'' and other kernel structures with
kvm_read(3) to obtain various data (e.g. page counters).

These interfaces had always been fragile and potentially unsafe
(due to sgid-to-kmem requirement), so let's switch to sysctl(3)
instead as it provides the same data via documented, stable API.

Address another problem while here: the dockapp tried to update
the window from the signal handler, and no Xlib function can be
safely called within a signal handler*.  Do as advised and only
raise a "need update" flag upon receiving a signal, then gather
new data and redraw the window in the main loop.  This approach,
however, cannot work without modifying process_events() because
of the blocking nature of XNextEvent(3) -- put another select(2)
call in front so it can relinquish control to the outer loop.

[*] http://www-h.eng.cam.ac.uk/help/tpl/graphics/X/signals.html
2023-07-26 14:10:34 +00:00

24 lines
557 B
Makefile

PORTNAME= wmmemfree
PORTVERSION= 0.7
PORTREVISION= 4
CATEGORIES= sysutils windowmaker
MASTER_SITES= SUNSITE/X11/xutils
MAINTAINER= danfe@FreeBSD.org
COMMENT= Memory and swap monitoring dockapp
LICENSE= GPLv2+
USES= localbase tar:bzip2 xorg
USE_XORG= x11 xext xpm
PLIST_FILES= bin/${PORTNAME} man/man1/${PORTNAME}.1.gz
post-patch:
@${CP} ${FILESDIR}/mem_freebsd.* ${WRKSRC}
do-install:
${INSTALL_PROGRAM} ${WRKSRC}/${PORTNAME} ${STAGEDIR}${PREFIX}/bin
${INSTALL_MAN} ${WRKSRC}/${PORTNAME}.1 ${STAGEDIR}${MANPREFIX}/man/man1
.include <bsd.port.mk>