Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.2 9/18/84; site watdcsu.UUCP Path: utzoo!watmath!watnot!watdcsu!broehl From: broehl@watdcsu.UUCP (Bernie Roehl) Newsgroups: net.micro.pc Subject: Re: Sidekick vs. Microsoft C Message-ID: <1747@watdcsu.UUCP> Date: Fri, 11-Oct-85 09:42:08 EDT Article-I.D.: watdcsu.1747 Posted: Fri Oct 11 09:42:08 1985 Date-Received: Sat, 12-Oct-85 16:24:26 EDT References: <962@vax2.fluke.UUCP> Reply-To: broehl@watdcsu.UUCP (Bernie Roehl) Distribution: net Organization: U of Waterloo, Ontario Lines: 20 In article <962@vax2.fluke.UUCP> sota@fluke.UUCP (Bruce White) writes: >... >Sidekick is loaded, the above program is executed, and then Ctrl-ALT is pressed >to invoke Sidekick. The computer emits 5 slow beeps, and then continues. A >similar version of the program, (using fgets(string,80,stdin)), compiled with >C86 did the same thing. > >Any ideas? > Sidekick beeps like that if you try to invoke it while a DOS function call is being executed. The reason is simple; DOS (at least up to 3.1) is not designed to be re-entrant. If Sidekick were to try and read its notepad, help file, appointment calendar, etc, it would wind up calling DOS and possibly using the same routine that was already running as result of the DOS call. This would cause massive screwups in the stack and any global data areas. In most C libraries for the PC, stdin and stdout (as used by gets and puts) go through DOS (as they should) to get characters; your program is clearly i/o bound, and spends most of its life sitting in gets(). Sidekick therefore complains.