Controlling the name of a forked process
I'd like to have control over the name a of a process that is forked from a Perl script. Ideally it would go something like this:
./forker.pl | ... | | fork("forked.pl"); |\ 开发者_如何学JAVA | \ | `--------\ | \ forker.pl forked.pl
...as seen by by top
or ps
.
Is this possible?
If the OS permits it at all,
$0 = 'forked.pl';
Perchance can this module help you: http://metacpan.org/pod/Sys::Prctl . This under the assumption that you are on a Linux platform.
精彩评论