Path: utzoo!attcan!uunet!ginosko!usc!rutgers!att!cbnews!holtman From: holtman@cbnews.ATT.COM (James P. Holtman) Newsgroups: comp.lang.c Subject: Re: entry at other than main (was want to know) Message-ID: <9182@cbnews.ATT.COM> Date: 24 Aug 89 20:45:06 GMT References: <785@skye.ed.ac.uk> Reply-To: holtman@cbnews.ATT.COM (James P. Holtman,59474,cb,3B370,6148602214) Organization: AT&T Bell Laboratories Lines: 20 It is hard to understand why all the concern about starting up the program at someplace other than 'main'. With some linkers, the load module is always started at location 0, so if you wanted some arbitrary program to have initial control, you had a 'jump' instruction linked into location 0 to effect the transfer. If you really want 'xyz' to have control in C, then get your own version of the c startup routine (which sets up argc and argv amoung other things) and which right now calls 'main', and change it to call 'xyz'. If you want to do it dynamically, then have your 'make' file create the startup routine with the name you specify and then link it in. People should be asking 'what is the program that I am trying to solve', and not 'how do I want to solve it'. Every system has some constraints in it that we have to live with, but in most cases it does not prevent you from doing what you want to do, if you just take a different view of the situation. Jim Holtman