From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: fee84,51bd7bf3e09f50bd X-Google-Attributes: gidfee84,public From: nmm1@cus.cam.ac.uk (Nick Maclaren) Subject: Re: _exit() function Date: 1997/12/03 Message-ID: <664l4i$1ek$1@lyra.csx.cam.ac.uk>#1/1 X-Deja-AN: 294972807 References: Organization: University of Cambridge, England Newsgroups: comp.unix.osf.osf1 In article , Rob Kirkbride wrote: > >I understood the _exit throws away all buffered output and the process >should exit straight away. What I find is that a call to the _exit is >made but the executable does not finish terminating until a printer is >turned back on to allow the output to flush. All the threads in the >program have shut down properly it just seems to be waiting for the >printer output to clear. You are mistaken - the _exit call IS working as described, but the underlying system is not doing what you expect. All _exit does is to return control to the operating system, which then has the job of cleaning up. You lose buffered output because the C run-time system is not called to write it. Most files are closed fairly quickly, though there can be problems with NFS, but the problem you are seeing is with closing sockets. These are a Berkeleyism, and have been kludged up most horribly on all Unices. One of the effects is that it isn't always possible to do an emergency close from either end - you have to wait for the other end to close the socket. Sorry, but all you can do is to moan at your vendor, who will make evasive noises. You MAY get them to implement another kludge, with the hope of reducing the frequency of this effect. Nick Maclaren, University of Cambridge Computer Laboratory, New Museums Site, Pembroke Street, Cambridge CB2 3QG, England. Email: nmm1@cam.ac.uk Tel.: +44 1223 334761 Fax: +44 1223 334679