News for hackers. Stuff that matters.
Re:Why bother with argv[0]? by ArchOversight on Tuesday September 03, 2024 @11:38AM (#41436016)
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...

Re:Why bother with argv[0]? by asveikau on Tuesday September 03, 2024 @12:02PM (#41436255)
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.
Re:Why bother with argv[0]? by account42 on Thursday September 05, 2024 @06:25AM (#41455262)
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.