summaryrefslogtreecommitdiff
path: root/cfg.mk
diff options
context:
space:
mode:
authorPádraig Brady <P@draigBrady.com>2011-02-22 21:14:00 +0000
committerPádraig Brady <P@draigBrady.com>2011-03-05 02:33:53 +0000
commit5f3115535b32a9c0cc5aee5cf5b4001f684ad56e (patch)
tree601be66ec898ecbd0276d7258191c5468c775a6b /cfg.mk
parent433a7c614f0fbce3ba3346409af847d82670d284 (diff)
downloadcoreutils-5f3115535b32a9c0cc5aee5cf5b4001f684ad56e.tar.xz
dd: add a flag to discard cached data
* src/dd.c (FFS_MASK): A new macro (Find First Set) refactored from the following enum as it's now used twice. (usage): Mention the new 'nocache' flag. (cache_round): A new function to help ignore requests to drop cache, that are less than page_size. (invalidate_cache): A new function to call posix_fadvise() with the appropriate offset and length. Note we don't use fdadvise() so we can detect errors when count=0. (dd_copy): Call invalidate_cache() for the portions read. (iwrite): Likewise for the portions written. (main): Call invalidate_cache for page_size slop or for full file when count=0. * cfg.mk (sc_dd_O_FLAGS): Adjust to pass. * doc/coreutils.texi (dd invocation): Describe the 'nocache' flag, and give some examples of how it can be used. * tests/dd/nocache: A new test. * tests/Makefile.am: Reference the new test. * NEWS: Mention the new feature.
Diffstat (limited to 'cfg.mk')
-rw-r--r--cfg.mk4
1 files changed, 2 insertions, 2 deletions
diff --git a/cfg.mk b/cfg.mk
index e4f3faaad..c897dc45f 100644
--- a/cfg.mk
+++ b/cfg.mk
@@ -39,8 +39,8 @@ _hv_file ?= $(srcdir)/tests/misc/help-version
dd = $(srcdir)/src/dd.c
sc_dd_O_FLAGS:
@rm -f $@.1 $@.2
- @{ echo O_FULLBLOCK; perl -nle '/^ +\| (O_\w*)$$/ and print $$1' \
- $(dd); } | sort > $@.1
+ @{ echo O_FULLBLOCK; echo O_NOCACHE; \
+ perl -nle '/^ +\| (O_\w*)$$/ and print $$1' $(dd); } | sort > $@.1
@{ echo O_NOFOLLOW; perl -nle '/{"[a-z]+",\s*(O_\w+)},/ and print $$1' \
$(dd); } | sort > $@.2
@diff -u $@.1 $@.2 || diff=1 || diff=; \