how to flush out cache.?

Stephan Uphoff ups at tree.com
Wed Apr 21 14:38:27 PDT 2004


mmap() and msync(..MS_INVALIDATE..) should work.

	Stephan

> 
> Ok so I have an application where I need to 
> reread a file I have just written to ensure that it went to disk
> correctly..
> 
> Other than reading a few GB of data, is there a way to flush
> out the cache copy of a file I've written?
> 
> possibilities include:
> 
> a file flag saying "don't keep a copy after it's written to disk"?
> a syscall discard_cached_blocks(fd);
> 
> 
> ?
> any other suggestions?
> 
> julian
> (BTW this would be for 4.x initially)
> 
> 
> _______________________________________________
> freebsd-hackers at freebsd.org mailing list
> http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
> To unsubscribe, send any mail to "freebsd-hackers-unsubscribe at freebsd.org"
> 




More information about the freebsd-hackers mailing list