The setproctitle() library routine sets the process title that appears on the ps(1) command.
The setproctitle_init() library routine only needs to be called (before any call to setproctitle() and with main() arguments), if the automatic constructor support has not been linked in through the libbsd-ctor pkgconf file.
The title is set from the executable's name, followed by the result of a printf(3) style expansion of the arguments as specified by the fmt argument. If the fmt argument begins with a “-” character, the executable's name is skipped.
If fmt is NULL, the process title is restored.
Examples
To set the title on a daemon to indicate its activity:
setproctitle("talking to %s", inet_ntoa(addr));
Releases
5 releases since Debian 10 (Buster); the text changed 3 times.