Unix Programming - Re: When does the Solaris kernel flush data to a file descriptor that is close()'ed?

This is Interesting: Free IT Magazines  
Home > Archive > Unix Programming > January 2005 > Re: When does the Solaris kernel flush data to a file descriptor that is close()'ed?





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author Re: When does the Solaris kernel flush data to a file descriptor that is close()'ed?
Casper H.S. Dik

2005-01-14, 7:51 am

Matty <matty@daemons.net> writes:

>I have been digging through books for the past few days trying to find
>out how the Solaris kernel handles a close() operation. Given the
>following sequence of system calls:


>fd = open("logfile", O_APPEND);
>write(fd, "blah", 4);
>close(fd);
>exit(0);


>When would "blah" actually get written to the file referenced by fd? Do
>the UFS delayed write algorithms kick in here? Does the close() force
>data to be flushed to the file referenced by fd? I can't seem to find a
>definitive answer for this in the close(2) man page, Solaris Systems
>Programming, or Solaris Kernel Internals (If I missed it, please let me
>know. I will wander off and read).


It's a property of the filesystem; as far as I know, Solaris ufs
decides that on last close the data should be flushed so ti will be
written somewhere in the near future.

Casper
--
Expressed in this posting are my opinions. They are in no way related
to opinions held by my employer, Sun Microsystems.
Statements on Sun products included here are not gospel and may
be fiction rather than truth.
Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com