[Haskell-cafe] how to change a process name

Donn Cave donn at avvanta.com
Thu Jul 7 16:17:06 CEST 2011


Quoth Kazu Yamamoto (=?iso-2022-jp?B?GyRCOzNLXE9CSScbKEI=?=) <kazu at iij.ad.jp>,

> I would like to know how to change a process name in Haskell. When we
> are programming in C, we can change it by overriding argv on Unix.
> But I cannot find the same way to do in Haskell. Can anyone suggest
> how in Haskell? I'm not talking about the result of
> System.Environment.getProgName but talking about the process name
> which we can see by the "ps" command.

If you mean, while the program is running - I don't agree that we can
change it by overriding argv on UNIX.  This might work on some specific
operating systems, but not on all of them.  I believe POSIX does not
specify any way to do this, and in fact there is no reasonably portable
way to do it.  That's probably why Haskell doesn't support it.

Now, if you mean argv[0] in execve(2), through which the caller
determines the name for the new process ... I can't explain why
Haskell's System.Posix.Process.executeFile doesn't support that,
it looks like gratuitous breakage to me.

	Donn



More information about the Haskell-Cafe mailing list