richard@calvin.EE.CORNELL.EDU (Richard Brittain) (07/05/89)
Hello, can anyone explain how to find out the name of a program under DOS 3+ (i.e. how does C set argv[0]). I know it isn't possible for earlier version of DOS, and I have actually looked at the Turbo-C startup code, but it doesn't seem to make much sense. Turbo-C seems to look beyond the end of the environment block, but I can't find anything there. What I actually want to do is to find out the name of a program, given it's PSP address. thanks Richard Brittain, School of Elect. Eng., Upson Hall Cornell University, Ithaca, NY 14853 ARPA: richard@calvin.spp.cornell.edu UUCP: {uunet,uw-beaver,rochester,cmcl2}!cornell!calvin!richard
richard@calvin.EE.CORNELL.EDU (Richard Brittain) (07/07/89)
Many thanks to all who replied to me on this. It seems that you cannot get to the program name in Turbo-C by following the environ[] pointers, but it worked just fine if you go directly from the _psp variable. Richard Brittain