diff options
author | Antti-Juhani Kaijanaho <ajk@debian.org> | 2006-02-26 00:54:21 +0100 |
---|---|---|
committer | Antti-Juhani Kaijanaho <ajk@debian.org> | 2006-02-26 00:54:21 +0100 |
commit | eb7a671fd1a46d551ae365eb3423d3aa9f8cd7f5 (patch) | |
tree | ce8c219468aecee5d2b3634a79d962213059f12d /sort-dctrl.c | |
parent | 3ecdfa5d2ce8e020d7ef2bcbd80adcba59a31ae7 (diff) | |
download | dctrl-tools-eb7a671fd1a46d551ae365eb3423d3aa9f8cd7f5.tar.gz |
Fix #348540; also do some related additional changes
* Closes: #348540 (grep-dctrl: stores whole input in memory)
Reported by Christoph Berg <myon@debian.org>.
- fsaf.c: Prefer reusing the current buffer instead of enlarging it,
when not using mmap(2).
- fsaf.h,fsaf.c: Fix invalidation for non-mmap buffers.
* fsaf.h,fsaf.c: Make it possible to turn off mmapping.
* fsaf.h,fsaf.c: Preallocate a 64KB buffer when not mmapping.
* grep-dctrl.c,sort-dctrl.c,tbl-dctrl.c:
Make mmap optional (defaults to no mmapping; new option --mmap).
Diffstat (limited to 'sort-dctrl.c')
-rw-r--r-- | sort-dctrl.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/sort-dctrl.c b/sort-dctrl.c index b9556f6..5a4c8b1 100644 --- a/sort-dctrl.c +++ b/sort-dctrl.c @@ -27,6 +27,7 @@ #include "sorter.h" #define OPT_SILENT 256 +#define OPT_MMAP 257 const char * argp_program_version = "sort-dctrl (dctrl-tools) " VERSION; const char * argp_program_bug_address = MAINTAINER; @@ -35,6 +36,7 @@ static struct argp_option options[] = { { "copying", 'C', 0, 0, N_("Print out the copyright license.") }, { "errorlevel", 'l', N_("LEVEL"), 0, N_("Set debugging level to LEVEL.") }, { "key-spec", 'k', N_("KEYSPEC"), 0, N_("Specify sort keys.") }, + { "mmap", OPT_MMAP, 0, 0, N_("Attempt mmapping input files") }, { 0 } }; @@ -101,6 +103,10 @@ static error_t parse_opt (int key, char * arg, struct argp_state * state) debug_message("parse_opt: l", 0); } break; + case OPT_MMAP: + debug_message("parse_opt: mmap", 0); + fsaf_mmap = 1; + break; case ARGP_KEY_ARG: debug_message("parse_opt: argument", 0); { |