Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!unmvax!ncar!tank!shamash!com50!pwcs!stag!daemon From: to_stdnet@stag.UUCP Newsgroups: comp.sys.atari.st Subject: argv[0] and Sozobon C Message-ID: <737@stag.UUCP> Date: 10 Mar 89 03:03:39 GMT Sender: daemon@stag.UUCP Lines: 120 From: thelake!steve@stag.UUCP (Steve Yelvington) John Clark writes... > I have had your MT C-shell as well as the Micro C-shell for sometime > now. I have recently downloaded the Sozobon C stuff. The *.TTP > programs work under the Micro C-shell but not under MT C-shell. > Atfer some investigation it appears that the Sozobon startup uses > some interresting methods to find the name of the program that was > 'pexec-ed'. I would like to know if this code uses standard things > 'everyone knows' in the atari world or do I have an old version of > MT C-Shell or this is what I get for using 'free' stuff. > > Thank You > John Clark > Internet: pa2183@sdcc15.ucsd.edu The argv[0] work is done by dLibs, not by Sozobon's compiler. They are not standard things that everybody knows; Dale Schumacher and John Stanley had to do some detective work to get the argv[0] information correctly filled out. Mark Williams C apparently leaves argv[0] empty; some other compilers on the ST fill in a bogus word such as ya.out. Try: #include main(argc, argv) int argc; char **argv; { printf("argv[0] = %s\n", argv[0]); } ... and you'll get some interesting answers, depending on who wrote your C libraries. If you use dLibs, you get the real current name of the program, including the path (c:\cstuff\argv.tos, for example). Problems with MT C-Shell are not peculiar to Sozobon C and/or dLibs; Mark Williams provides a conversion program to get MWC-compiled software running under the Beckemeyer product. /* * UUCP: {uunet!rosevax,amdahl!bungia,chinet,killer}!orbit!thelake!steve * ARPA: crash!orbit!thelake!steve@nosc.mil * #member The ST Developers Network */ From MAILER-DAEMON Thu Mar 9 14:16:50 1989 remote from stag Received: by stag.UUCP (5.9/smail2.5/03-21-87) id AB17658; Thu, 9 Mar 89 14:10:15 CST Date: Thu Mar 9 13:25:56 1989 CST From: MAILER-DAEMON@stag.UUCP (Mail Delivery Subsystem) Subject: Returned mail: User unknown Message-Id: <8903092010.AB17658@stag.UUCP> To: thelake!steve ----- Transcript of session follows ----- 550 atari.st... User unknown ----- Unsent message follows ----- Received: by stag.UUCP (5.9/smail2.5/03-21-87) id AA17658; Thu, 9 Mar 89 14:10:15 CST Path: thelake!steve Date: Thu Mar 9 13:25:56 1989 CST To: atari.st@stag From: thelake!steve@stag.UUCP (Steve Yelvington) Message-Id: <0209891325560632@thelake.UUCP> Reply-To: thelake!steve@stag.UUCP X-Member-Of: STdNet, the ST Developers' Network Organization: Otter Lake Leisure Society > I have had your MT C-shell as well as the Micro C-shell for sometime > now. I have recently downloaded the Sozobon C stuff. The *.TTP > programs work under the Micro C-shell but not under MT C-shell. > Atfer some investigation it appears that the Sozobon startup uses > some interresting methods to find the name of the program that was > 'pexec-ed'. I would like to know if this code uses standard things > 'everyone knows' in the atari world or do I have an old version of > MT C-Shell or this is what I get for using 'free' stuff. > > Thank You > John Clark > Internet: pa2183@sdcc15.ucsd.edu The argv[0] work is done by dLibs, not by Sozobon's compiler. They are not standard things that everybody knows; Dale Schumacher and John Stanley had to do some detective work to get the argv[0] information correctly filled out. Mark Williams C apparently leaves argv[0] empty; some other compilers on the ST fill in a bogus word such as ya.out. Try: #include main(argc, argv) int argc; char **argv; { printf("argv[0] = %s\n", argv[0]); } ... and you'll get some interesting answers, depending on who wrote your C libraries. If you use dLibs, you get the real current name of the program, including the path (c:\cstuff\argv.tos, for example). David Brooks suggests that you may have been bitten by a bug in memcpy(). His replacement for the function appears in the next message. By the way, problems with MT C-Shell are not peculiar to Sozobon C and/or dLibs; Mark Williams provides a conversion program to get MWC-compiled software running under the Beckemeyer product. /* * UUCP: {uunet!rosevax,amdahl!bungia,chinet,killer}!orbit!thelake!steve * ARPA: crash!orbit!thelake!steve@nosc.mil * #member The ST Developers Network */