Re: Changing argv[0] under Linux.

From: Valdis.Kletnieks@vt.edu
Date: Tue Jan 14 2003 - 17:04:05 EST


On Tue, 14 Jan 2003 21:55:02 GMT, Miquel van Smoorenburg <miquels@cistron.nl> said:

> If you want to modify argv[0] etc, loop over argv[], count howmuch
> space there is (strlen(argv[0] + 1 + strlen(argv[1] + 1 ... etc)
> and make sure you do NOT write a string longer than that. Also
> make sure that you end the string with a double \0

Or steal the code that's already been done - sendmail and wu-ftpd both have
code to do this....

-- 
				Valdis Kletnieks
				Computer Systems Senior Engineer
				Virginia Tech


- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Wed Jan 15 2003 - 22:00:52 EST