4 ms·
Sorta-related: there's an effort to use libxo to make this kind of thing nicer: https://wiki.freebsd.org/LibXo https://wiki.freebsd.org/LibXo
by yjftsjthsd-h 6y ago
Sorta-related: there's an effort to use libxo to make this kind of thing nicer: https://wiki.freebsd.org/LibXo https://wiki.freebsd.org/LibXo
- JdeBP 6y agoAgain, though, viraptor was talking about the APIs used in C programming, not what one has in shell script programming. When it comes to shell script programming, the obvious mechanism has already existed in FreeBSD for quite a while now. It's vis (vis(1), unvis(1), vis(3)). I have an alternative to ps that vis-encodes the fields in its output, and from experience most and possibly all of the well-known and widely-documented (by Greg Wooledge and others) pitfalls that are warned about do indeed go away with simple application of vis encoding. It does the same on Linux-based operating systems, too, although one has to go and get an unvis tool from somewhere. Yes, the code to read the process table on Linux in the first place does indeed involve decoding human-readable strings from stat files into machine form. (-: * https://unix.stackexchange.com/a/593198/5132 https://unix.stackexchange.com/a/593198/5132