Mailinglist Archive: opensuse-programming (85 mails)

< Previous Next >
Re: [suse-programming-e] The meaning of atomic in write()
  • From: Jerry Feldman <gaf@xxxxxxx>
  • Date: Wed, 29 Mar 2006 11:52:54 -0500
  • Message-id: <200603291152.54145.gaf@xxxxxxx>
On Wednesday 29 March 2006 11:38 am, Anders Johansson wrote:
> On Wed, 2006-03-29 at 11:33 -0500, Jerry Feldman wrote:
> > The way it works:
> > open(2) opens a file and returns a file descriptor. The use count on
> > that file is incremented.
> > fork(2) replicates the file descriptors such that the parent and child
> > now have their own, and the use count is incremented.
> > At some point, the unlink(2) system call is called.
>
> No, the syscall is close(), not unlink()
>
> What confused me initially was that I fooled myself into thinking parent
> and child shared a single fd, which got closed. Obviously this is not
> the case
I added the unlink(2) to the mix showing that you can also write to (or read
from) a deleted file.
--
Jerry Feldman <gaf@xxxxxxx>
Boston Linux and Unix user group
http://www.blu.org PGP key id:C5061EA9
PGP Key fingerprint:053C 73EC 3AC1 5C44 3E14 9245 FB00 3ED5 C506 1EA9

< Previous Next >