Usenet comp.unix.osf.osf1 (1992-2004)
 help / color / mirror / Atom feed
From: nmm1@cus.cam.ac.uk (Nick Maclaren)
Subject: Re: _exit() function
Date: 1997/12/03	[thread overview]
Message-ID: <664l4i$1ek$1@lyra.csx.cam.ac.uk> (raw)
In-Reply-To: Dj40uPAfych0EwjK@RK-COMP.DEMON.CO.UK


In article <Dj40uPAfych0EwjK@RK-COMP.DEMON.CO.UK>,
Rob Kirkbride  <rob@rk-comp.demon.co.uk> 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



  reply	other threads:[~1997-12-03  5:00 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1997-12-03  5:00 _exit() function Rob Kirkbride
1997-12-03  5:00 ` Nick Maclaren [this message]
1997-12-04  5:00   ` Rob Kirkbride
read-only archive

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox