[racket] Can raco exe assign a name other than "racket"?

From: Matthew Flatt (mflatt at cs.utah.edu)
Date: Mon Mar 28 09:28:54 EDT 2011

At Sat, 26 Mar 2011 16:13:02 -0400, Neil Van Dyke wrote:
> Greg Hendershott wrote at 03/26/2011 12:14 PM:
> > $ raco exe -o foo foo.rkt
> > $ ./foo &
> > $ ps  #shows it as "racket" not as "foo".
> > $ top  #shows it as "racket" not as "foo".
> >
> > Is there way I can make it show up as "foo"?
> >   
> 
> You can often do this in C on Unix variants by mutating the string 
> buffers pointed to by "argv" argument as passed to the "main" function. 

That probably doesn't work under Linux, or maybe it would affect the
output of `ps a'.

But `ps a' already reports a more useful result, so that may be the
immediate answer, Greg. Probably there's a way to make `top' show the
same information as `ps a'.

To change the name shown by `ps', it looks like Racket could call
prctl() with PR_SET_NAME --- at least for Linux (2.6.9 and up). I'll
look into that more.



Posted on the users mailing list.