Date: Tue, 14 Sep 2010 15:11:20 -0500 From: CyberLeo Kitsana <cyberleo@cyberleo.net> To: FreeBSD Questions <questions@freebsd.org> Cc: CyberLeo <cyberleo@cyberleo.net> Subject: Discard file cache Message-ID: <4C912868.6090403@cyberleo.net>
next in thread | raw e-mail | index | archive | help
Hi! I'm helping port a utility [1] to program the EyeFi card [2] and I seem to be running into problems properly manipulating the configuration. The card is programmed by writing encoded commands to certain hidden files on the card, and reading the coded responses back from other files. Since the card modifies the data in these files independently of the host operating system, there is a need to avoid all caching (read and write) whenever interacting with the card's interface. fsync(2) works for eliminating write caching, so that's no issue. While the Linux port of the software successfully accomplishes avoiding read caching by utilizing posix_fadvise and POSIX_FADV_DONTNEED to clear the caches for a particular file, the same does not appear to function on FreeBSD. I have also tried using msync with MS_INVALIDATE, but this doesn't appear to work either. Is there an official (or at least consistent) API for discarding a file's cached read data, so that it may be fetched afresh from the backing store? Thanks! [1] http://git.cyberleo.net/eyefi-config.git [2] http://www.eye.fi/ -- Fuzzy love, -CyberLeo Technical Administrator CyberLeo.Net Webhosting http://www.CyberLeo.Net <CyberLeo@CyberLeo.Net> Furry Peace! - http://wwww.fur.com/peace/
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?4C912868.6090403>