The setproctitle library routine sets the process title that appears on the ps(1) command.
The title is set from the executables 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 executables name is skipped.
If fmt is NULL, the process title is restored.
To set the title on a daemon to indicate its activity:
setproctitle("talking to %s", inet_ntoa(addr));
ps(1), w(1), kvm(3), kvm_getargv(3), printf(3)