Finding where an executable was run

David Goodenough dg at lakart.UUCP
Sat May 21 00:11:26 AEST 1988


Net-people:

	I am wrong - I am wrong - I am wrong - I admit it. I have had more
mail telling me this than you can shake a stick at. Two points:

A) Valid objection: with a path == ( . /bin /usr/bin /usr/local )
	I get into trouble. This is a real problem, because it happens
	whenever I fire up something that is not a full path, or not in
	the current directory (i.e. /bin/cat).

B) Less often a problem, but still irritating - things like csh / sh / getty
	whose argv[0] is something real weird (e.g. - -u or whatever). This
	rarely happens for user programs, except when doing a su perhaps.

An interesting notion :-)

On BSD 4.3, most binaries are demand page loaded. This means that the
"text image" is very closely linked to the executable (Let's forget
shell scripts for a moment :-). Does this mean that the kernel's
process tables have some reference to the filesystem and inode number
of the executable, because if so you could do a real neato job with
find - popen("find /filesystem -inum %d", "r");		:-) :-) :-) 
-- 
	dg at lakart.UUCP - David Goodenough		+---+
							| +-+-+
	....... !harvard!adelie!cfisun!lakart!dg	+-+-+ |
						  	  +---+



More information about the Comp.unix.wizards mailing list