On Jul 13, 2016, at 8:36 PM, Sebastian Lackner sebastian@fds-team.de wrote:
On 14.07.2016 00:46, Ken Thomases wrote:
Please correct me if I'm wrong, but to my knowledge, the "ugly" shift string method which depends on the exact memory layout only makes sense on Linux. On all other operating systems the cmdline is obtained in a different way and it does not matter what is stored in the process.
That's what I thought at first, too, but no. Shifting the strings is what affects the output of ps on macOS, too. The call to setprogname() affects some other process metadata query APIs (e.g. libproc), but I'm not aware of built-in commands which demonstrate their output.
The setproctitle() docs I've found online suggest that modifying argv (at least, argv[0]) works on FreeBSD, too. It's just that setproctitle() is preferred. https://www.freebsd.org/cgi/man.cgi?query=setproctitle&sektion=3
-Ken
Okay, if its unclear what else we might break then its probably better to keep it in the version you already have. Thanks for the explanation. ;)
You're welcome. Thank you for reviewing. :)
-Ken