At 3:00 PM +0100 3/18/03, Juergen Boemmels wrote:
Benjamin Goldberg <[EMAIL PROTECTED]> writes:
"JüRgen BöMmels" wrote:
[snip]
> void
> PIO_unix_flush(theINTERP, ParrotIOLayer *layer, ParrotIO *io)
> {
> -# if 0
> fsync(io->fd);
> -# endif
> }
AFAIK, for disk files, fsync has (should have) no visible effect from
the point of view of any user program -- all it does is tell the OS to
start writing the OS-level cache for that handle to disk, and it blocks
until all is copied.
I think this is correct.
So... it is a slow system call, with no visible
effect -- why do we do it?
Deepends on the semantics we want to have for flush. I thought of
flush to disk, but just flush to OS is also a valid asumption. This is
what fflush also does.
Given that we're not going to be using the C std library except in
the most extraordinary of circumstances, I don't know that there's
much point in a flush that doesn't actually force the write to the
disk.
--
Dan
--------------------------------------"it's like this"-------------------
Dan Sugalski even samurai
[EMAIL PROTECTED] have teddy bears and even
teddy bears get drunk