Y
Hacker News
new
|
ask
|
show
|
jobs
by
ArchOversight
661 days ago
There's the `setproctitle` in FreeBSD that is designed exactly for a process to update the information that is presented to tools such as ps.
https://man.freebsd.org/cgi/man.cgi?query=setproctitle&aprop...
2 comments
asveikau
661 days ago
There's also getprogname(3) on a lot of systems, and the __progname variable. I seem to recall this is an area where various Unix like systems have slight variations.
link
account42
659 days ago
prctl(PR_SET_NAME) on Linux - sets the thread name, and the name of the main thread is shown as the process name in most tools.
link