3 ms·
It may work for top, but not ps among others. The only reliable way is clobbering argv. That's just the way it is. In my opinion, glibc should finally provide s
by gobblegobble2 2y ago
It may work for top, but not ps among others. The only reliable way is clobbering argv. That's just the way it is. In my opinion, glibc should finally provide setproctitle(), so programs like postgresql or chrome (https://source.chromium.org/chromium/chromium/src/+/main:base/process/set_process_title_linux.cc;l=77 https://source.chromium.org/chromium/chromium/src/+/main:bas...) don't have to resort to argv hacks.
- GoblinSlayer 2y agoThere's prctl https://man7.org/linux/man-pages/man2/PR_SET_NAME.2const.html https://man7.org/linux/man-pages/man2/PR_SET_NAME.2const.htm... that writes to /proc/self/comm