Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 16 Mar 2012 10:10:04 -0700
From:      Chuck Swiger <cswiger@mac.com>
To:        Dimitry Andric <dim@FreeBSD.org>
Cc:        "freebsd-stable@freebsd.org Mailing List" <freebsd-stable@FreeBSD.org>
Subject:   Re: FreeBSD 9.0: Valgrind leaks memory
Message-ID:  <1C76E9AC-2AAC-4719-AFF2-6BEFF5F3C96B@mac.com>
In-Reply-To: <4F636FB0.3090305@FreeBSD.org>
References:  <CAPKAR4KGO31ZyJuZi0x=iF=UnUVfxXGWWnOLw7n9Nd7nhXhc3Q@mail.gmail.com> <4F636FB0.3090305@FreeBSD.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Mar 16, 2012, at 9:52 AM, Dimitry Andric wrote:
> For some reason, since the original BSD 4.4 Lite Lib Sources, the stdio
> files are only flushed, not closed, at exit.  In practice, it will not
> matter much, as the kernel will cleanup any left-overs when the process
> dies.

File descriptors get shared between parent and child processes...just because a child process terminates doesn't necessarily mean that you want to close everything.

Well, if POSIX 2008's O_CLOEXEC becomes more popular, folks can control whether a descriptor gets inherited an open() time, rather than needing fcntl()'s FD_CLOEXEC and deal with possible race conditions (especially multithreaded programs)...

Regards,
-- 
-Chuck




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?1C76E9AC-2AAC-4719-AFF2-6BEFF5F3C96B>