Justin Pryzby wrote:
> On Sun, Jan 07, 2007 at 11:27:07AM -0800, Michael Kerrisk wrote:
>> Justin Pryzby wrote:
>>> On Sat, Jan 06, 2007 at 03:57:30PM -0800, Michael Kerrisk wrote:
>>>> Hello Justin,
>>>>
>>>>> Linux 2.6.5 fs/open.c source indicates that close() can return 
>>>>> essentially any
>>>>> file error:
>>>>>
>>>>> |int filp_close(struct file *filp, fl_owner_t id)
>>>>> | /* Report and clear outstanding errors */
>>>>> |asmlinkage long sys_close(unsigned int fd)
>>>>> |         return filp_close(filp, files);
>>>>>
>>>>> manpages already alludes to this ("It is quite possible that errors on
>>>>> a previous write(2) operation are first reported at the final
>>>>> close()."); included is a patch making it explicit.
>>>> I don't see this code in fs/open.c in 2.6.19.  Can you clarify please.
>>> 2.6.18 has comparable sys_close and filp_close, but the new filp_close does 
>>> an
>>> fflush() on the file.  fflush(3) indicates that this is where all the 
>>> previous
>>> write() errors are picked up.  
>> fflush(3) is a library routine.
> There is necessarily a kernel componenent too; drivers get to specify
> their own implementation.

Justin -- either you are confused, or I am misunderstanding you (I believe
the former ;-)).  There is no relationship between fflush(3) and the flush
method implemented in the kernel.  They are operating on totally distinct
buffers.  Calling fflush3(3) does not result in a call to the kernel flush
method for the underlying device.

Cheers,

Michael

-- 
Michael Kerrisk
maintainer of Linux man pages Sections 2, 3, 4, 5, and 7

Want to help with man page maintenance?  Grab the latest tarball at
http://www.kernel.org/pub/linux/docs/manpages/
read the HOWTOHELP file and grep the source files for 'FIXME'.


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to