From 7bbc267ac361247f6110183a17f71c64148e46c5 Mon Sep 17 00:00:00 2001 From: Ralf Baechle Date: Thu, 5 Feb 2015 13:02:56 +0100 Subject: [PATCH] cacheflush.2: Update some portability details and bugs Signed-off-by: Michael Kerrisk --- man2/cacheflush.2 | 30 ++++++++++++++++++++++-------- 1 file changed, 22 insertions(+), 8 deletions(-) diff --git a/man2/cacheflush.2 b/man2/cacheflush.2 index 64e7ec059..99ffa5cd1 100644 --- a/man2/cacheflush.2 +++ b/man2/cacheflush.2 @@ -73,16 +73,30 @@ is not one of or .BR BCACHE . .SH CONFORMING TO -This Linux-specific system call is available only on MIPS-based systems. -.\" FIXME The cacheflush() system call was only on MIPS back in 1.2 days, -.\" but by now it is on a number of other architectures (but not i386). -.\" Investigate the details and update this page. -It should not be used in programs intended to be portable. -.\" Irix 6.5 appears to have a cacheflush() syscall -- mtk +Historically, this system calls was available on all MIPS UNIX variants +including RISC/os, IRIX, Ultrix, NetBSD, OpenBSD, and FreeBSD +(and also on some non-UNIX MIPS operating systems), so that +the existence of this call in MIPS operating systems is a de-facto +standard. +.SS Caveat +.BR cacheflush () +should not be used in programs intended to be portable. +On Linux, this call first appeared on the MIPS archititecture, +but nowadays, Linux provides a +.BR cacheflush () +system call on some other architectures, but with different arguments. .SH BUGS -The current implementation ignores the +Linux kernels older than version 2.6.11 ignore the .I addr and .I nbytes -arguments. +arguments, making this function fairly expensive. Therefore, the whole cache is always flushed. + +This function is always behaving as if +.BR BCACHE +has been passed for the +.I cache +argument and does not do any error checking on the +.I cache +argument.