Re: Changing argv[0] under Linux.

Valdis.Kletnieks@vt.edu
Tue, 14 Jan 2003 17:04:05 -0500


--==_Exmh_-715193155P
Content-Type: text/plain; charset=us-ascii

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

--==_Exmh_-715193155P Content-Type: application/pgp-signature

-----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.1 (GNU/Linux) Comment: Exmh version 2.5 07/13/2001

iD8DBQE+JIlUcC3lWbTT17ARAgoFAKDodDJDGD9mvmp3m2r3P1QObP4ElwCg8M+l Qm9jIwcyd+aNbShO0ZNb9WY= =yqap -----END PGP SIGNATURE-----

--==_Exmh_-715193155P-- - 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/