Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!uunet!seismo!mcvax!mhres!jv From: jv@mhres.mh.nl (Johan Vromans) Newsgroups: comp.unix.wizards Subject: Using argv to show process status Message-ID: <1217@mhres.mh.nl> Date: Thu, 20-Aug-87 04:41:26 EDT Article-I.D.: mhres.1217 Posted: Thu Aug 20 04:41:26 1987 Date-Received: Sat, 22-Aug-87 09:44:55 EDT Organization: Multihouse NV, the Netherlands Lines: 31 Keywords: argv ps Some UN*X implementations allow a process to change its argv, which subsequently shows up when doing a "ps". This can be used to reveal a process' continuation status and such. I have found out, that the process should execute something like strcpy (argv[0], "Hi there, I'm doing fine."); changing argv with argv[0] = "Hello, world!"; does not work. My questions: - How does this work? Does it work only on BSD type systems, any others? - Whose memory is the process writing into? What happens if the process writes more bytes than the caller specified in the command line? - How can the remainder of the command line be blanked. Filling with a few null-characters seems not to be sufficient. Thanks in advance. -- Johan Vromans | jv@mh.nl via European backbone Multihouse N.V., Gouda, the Netherlands | uucp: ..{seismo!}mcvax!mh.nl!jv "It is better to light a candle than to curse the darkness"