Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re: How do I change my program's name under ps? ($0='abc' is messed up)

by rpc (Monk)
on May 25, 2001 at 04:37 UTC ( #83188=note: print w/replies, xml ) Need Help??


in reply to How do I change my program's name under ps? ($0='abc' is messed up)

This is because when the process is created, the first argument is allocated to be the size of the actual process name. Try appending a \0 to your fake process name.
  • Comment on Re: How do I change my program's name under ps? ($0='abc' is messed up)

Replies are listed 'Best First'.
Re: Re: How do I change my program's name under ps? ($0='abc' is messed up)
by entropy (Sexton) on May 30, 2001 at 00:56 UTC
    \0 doesn't help on linux... On FreeBSD it seems to work with or without the \0 (in addition to displaying the original process name).

    If the memory is pre-allocated, then do I have to worry about overflowing it?

      Nope, you don't have to worry about overflowing it in Perl. You do however, when dealing with argv[0] in C, etc.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://83188]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others rifling through the Monastery: (7)
As of 2023-01-30 11:13 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?