aboutsummaryrefslogtreecommitdiff
path: root/coreutils/dd.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
* dd: fix handling of 'conv=notrunc seek=N'Ron Yorston2020-05-201-3/+22
| | | | | | | | | | | | | | | | | | Commit e6680912a (dd: create a sparse file when seek=N is used) broke the use of 'conv=notrunc seek=N' to modify existing files. Rename seek_sparse() to make_sparse() and: - add an argument to specify the start of the sparse region; - call make_sparse() before ftruncate(); - call make_sparse() only if: * we can determine the size of the file; * the file is not open in append mode; * the file is being extended. This should fix GitHub issue #186.
* dd: create a sparse file when seek=N is usedRon Yorston2020-03-241-0/+3
| | | | | | | When the seek=N argument is used mark the file as sparse and set the range that is sparse. See https://stackoverflow.com/questions/4011508/how-to-create-a-sparse-file-on-ntfs
* Merge branch 'busybox' into mergeRon Yorston2019-05-271-13/+13
|\
| * dd: fix handling of short result of full_write(), closes 11711Denys Vlasenko2019-05-141-13/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | $ dd bs=1G <sda1 of=/dev/sda1 dd: error writing '/dev/sda1': No space left on device 1+0 records in 0+0 records out 999292928 bytes (953.0MB) copied, 0.784617 seconds, 1.2GB/s function old new delta write_and_stats 99 102 +3 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* | Merge branch 'busybox' into mergeRon Yorston2019-03-121-6/+10
|\|
| * dd: add 'oflag=append'Rostislav Skudnov2019-02-141-6/+10
| | | | | | | | | | Signed-off-by: Rostislav Skudnov <rostislav@tuxera.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* | Merge branch 'busybox' into mergeRon Yorston2019-01-101-1/+1
|\|
| * config: update size informationDenys Vlasenko2018-12-281-1/+1
| | | | | | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* | Merge branch 'busybox' into mergeRon Yorston2018-11-281-22/+43
|\|
| * dd: do not have 'ocount' variable if ibs/obs support is not enabledDenys Vlasenko2018-10-301-13/+20
| | | | | | | | | | | | | | | | | | | | function old new delta packed_usage 32964 32961 -3 dd_main 1033 1021 -12 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 0/2 up/down: 0/-15) Total: -15 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * dd: add 'oflag=seek_bytes'Rostislav Skudnov2018-10-301-9/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Allow specifying position in the output file in bytes instead of obs-sized blocks, improve compatibility with GNU dd. function old new delta dd_main 1632 1693 +61 packed_usage 33130 33150 +20 static.oflag_words - 12 +12 ------------------------------------------------------------------------------ (add/remove: 1/0 grow/shrink: 2/0 up/down: 93/0) Total: 93 bytes Signed-off-by: Rostislav Skudnov <rostislav@tuxera.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* | win32: save a few bytes in device file supportRon Yorston2018-03-231-6/+1
| |
* | win32: restrict visibility of special devicesRon Yorston2018-03-151-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Handling of the special devices /dev/zero and /dev/urandom was inconsistent: - they could be used as arguments to 'cat' but not 'od'; - they could not be used in shell redirection. Restrict the use of these devices to two places: - as input files to 'dd' with the 'if=' argument; - internally within 'shred'. See GitHub issue #98.
* | dd: mention /dev/zero and /dev/urandom in help messageRon Yorston2018-03-061-0/+3
| |
* | dd: use new device handling to implement /dev/zero and /dev/urandomRon Yorston2018-02-221-13/+10
| | | | | | | | | | | | Replace internal support for /dev/zero with the newly introduced device handling in open/read. This reduces the differences between busybox-w32 and upstream.
* | Merge branch 'busybox' into mergeRon Yorston2018-02-131-13/+31
|\|
| * dd: add 'fullblock' iflagNicholas Clark2018-01-251-10/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Adds a fullblock iflag for improved compatibility with GNU dd. The new iflag can be used to ensure that dd calls retrieve the expected amount of data when reading from pipes or unusual filesystems. function old new delta packed_usage 32249 32334 +85 dd_main 1582 1632 +50 static.iflag_words 12 22 +10 ------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 3/0 up/down: 145/0) Total: 145 bytes Signed-off-by: Nicholas Clark <nicholas.clark@gmail.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * dd: fixed partial count logicDenys Vlasenko2018-01-101-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | $ busybox dd if=/dev/zero of=/dev/loop0 bs=100M count=8; echo $? 8+0 records in 7+0 records out <=========== FIXED, was 7+1 805220352 bytes (767.9MB) copied, 0.464010 seconds, 1.6GB/s 1 function old new delta write_and_stats 97 99 +2 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * dd: exit with 1 if last write was incompleteDenys Vlasenko2018-01-101-5/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | $ busybox dd if=/dev/zero of=/dev/loop0 bs=100M count=8; echo $? 8+0 records in 7+1 records out 805220352 bytes (767.9MB) copied, 0.464010 seconds, 1.6GB/s 1 <=========== FIXED function old new delta write_and_stats 96 97 +1 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* | dd: silence warning on 64-bit systemsRon Yorston2017-08-311-3/+3
| | | | | | | | | | | | | | | | | | | | | | On 64-bit systems size_t may be larger than unsigned long, resulting in a warning when -1L is cast to size_t. There's little to be gained from allowing obs and ibs take values larger than will fit in a signed long as the subsequent malloc will probably fail. Limit their range to ULONG_MAX/2. Signed-off-by: Ron Yorston <rmy@pobox.com>
* | Merge branch 'busybox' into mergeRon Yorston2017-08-221-1/+1
|\|
| * config: do not use `a' quoting in help textsDenys Vlasenko2017-08-021-1/+1
| | | | | | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* | Merge branch 'busybox' into mergeRon Yorston2017-07-241-16/+16
|\|
| * config: deindent all help textsDenys Vlasenko2017-07-211-15/+15
| | | | | | | | | | | | Those two spaces after tab have no effect, and always a nuisance when editing. Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * Update menuconfig items with approximate applet sizesDenys Vlasenko2017-07-181-1/+1
| | | | | | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* | Merge branch 'busybox' into mergeRon Yorston2017-07-181-4/+3
|\|
| * dd: fix status=none. Closes 10066Denys Vlasenko2017-07-141-4/+3
| | | | | | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* | Merge branch 'busybox' into mergeRon Yorston2017-05-291-4/+4
|\|
| * dd: call fsync() only once before exiting if conv=fsync is specifiedRostislav Skudnov2017-03-161-4/+4
| | | | | | | | | | Signed-off-by: Rostislav Skudnov <rostislav@tuxera.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* | Merge branch 'busybox' into mergeRon Yorston2017-02-081-2/+2
|\|
| * Big cleanup in config help and descriptionDenys Vlasenko2017-01-101-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | Redundant help texts (one which only repeats the description) are deleted. Descriptions and help texts are trimmed. Some config options are moved, even across menus. No config option _names_ are changed. Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* | Merge branch 'busybox' into mergeRon Yorston2016-11-291-2/+4
|\|
| * Convert all coreutils/* applets to "new style" applet definitionsDenys Vlasenko2016-11-231-2/+4
| | | | | | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* | Merge branch 'busybox' into mergeRon Yorston2016-05-161-1/+3
|\|
| * *: add most of the required setup_common_bufsiz() callsDenys Vlasenko2016-04-211-0/+1
| | | | | | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * libbb: make bb_common_bufsiz1 1 kbyte, add capability to use bss tail for itDenys Vlasenko2016-04-211-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The config item is FEATURE_USE_BSS_TAIL. When it is off (default): function old new delta read_config 210 228 +18 doCommands 2279 2294 +15 ipneigh_list_or_flush 763 772 +9 ipaddr_list_or_flush 1256 1261 +5 display_process_list 1301 1306 +5 conspy_main 1378 1383 +5 do_lzo_compress 352 355 +3 do_lzo_decompress 565 567 +2 push 46 44 -2 inetd_main 2136 2134 -2 uevent_main 421 418 -3 addLines 97 92 -5 bb_common_bufsiz1 8193 1024 -7169 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 8/5 up/down: 62/-7181) Total: -7119 bytes text data bss dec hex filename 829850 4086 9080 843016 cdd08 busybox_old 829901 4086 1904 835891 cc133 busybox_unstripped FEATURE_USE_BSS_TAIL=y: read_config 210 228 +18 doCommands 2279 2294 +15 ipneigh_list_or_flush 763 772 +9 ipaddr_list_or_flush 1256 1261 +5 display_process_list 1301 1306 +5 conspy_main 1378 1383 +5 do_lzo_compress 352 355 +3 do_lzo_decompress 565 567 +2 inetd_main 2136 2134 -2 bb_common_bufsiz1 8193 - -8193 ------------------------------------------------------------------------------ (add/remove: 0/1 grow/shrink: 8/1 up/down: 62/-8195) Total: -8133 bytes text data bss dec hex filename 829850 4086 9080 843016 cdd08 busybox_old 829911 4086 880 834877 cbd3d busybox_unstripped FIXME: setup_common_bufsiz() calls are missing. Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* | Merge branch 'busybox' into mergeRon Yorston2016-02-221-27/+51
|\|
| * dd: support iflag=skip_bytesRafał Miłecki2016-02-011-27/+51
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It allows specifying amount of bytes directly (not only amount of blocks) is also supported by GNU's Coreutils. function old new delta parse_comma_flags - 93 +93 static.iflag_words - 12 +12 dd_main 1569 1580 +11 packed_usage 30591 30600 +9 ------------------------------------------------------------------------------ (add/remove: 2/0 grow/shrink: 2/0 up/down: 125/0) Total: 125 bytes Signed-off-by: Rafał Miłecki <zajec5@gmail.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* | Merge branch 'busybox' into mergeRon Yorston2015-10-191-2/+2
|\|
| * libiproute: rename invarg(a,b) to invarg_1_to_2(a,b)Denys Vlasenko2015-10-141-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | invarg(a,b) - "invalid argument", but how a and b enter the message? invarg_1_to_2(a,b) is somewhat easier to read: "invalid argument 'a' to 'b'" Audit of usage revealed a number of bad uses, with too long messages. text data bss dec hex filename 938848 932 17448 957228 e9b2c busybox_old 938788 932 17448 957168 e9af0 busybox_unstripped Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* | Merge branch 'busybox' into mergeRon Yorston2015-03-231-25/+6
|\|
| * dd: move suffix struct to xatonum.cAri Sundholm2015-03-221-25/+6
| | | | | | | | | | | | | | This way it can be used by other applets without duplication. Signed-off-by: Ari Sundholm <ari@tuxera.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* | Post-merge fixesRon Yorston2015-03-141-1/+1
| |
* | Merge branch 'busybox' into mergeRon Yorston2015-03-141-32/+111
|\| | | | | | | | | | | Conflicts: coreutils/od_bloaty.c libbb/lineedit.c
| * dd: add optional support for status=noxfer/noneAri Sundholm2015-02-071-32/+111
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | While at it, added 'B' number suffixes, upstream compat function old new delta dd_main 1469 1543 +74 dd_suffixes 88 112 +24 packed_usage 30156 30176 +20 dd_output_status 372 388 +16 static.status_words - 13 +13 ------------------------------------------------------------------------------ (add/remove: 1/0 grow/shrink: 4/0 up/down: 147/0) Total: 147 bytes Signed-off-by: Ari Sundholm <ari@tuxera.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
* | Merge branch 'busybox' into mergeRon Yorston2013-08-271-37/+78
|\|
| * dd: code shrinkDenys Vlasenko2013-08-201-3/+4
| | | | | | | | | | | | | | function old new delta dd_main 1475 1469 -6 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * dd: code shrinkDenys Vlasenko2013-08-201-2/+2
| | | | | | | | | | | | | | function old new delta dd_main 1487 1475 -12 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * dd: code shrinkDenys Vlasenko2013-08-201-5/+6
| | | | | | | | | | | | | | | | | | | | | | function old new delta write_and_stats 78 99 +21 dd_main 1496 1487 -9 full_write_or_warn 42 - -42 ------------------------------------------------------------------------------ (add/remove: 0/1 grow/shrink: 1/1 up/down: 21/-51) Total: -30 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
| * dd: remove FIXME comment which is fixed now. No code changesDenys Vlasenko2013-08-201-4/+1
| | | | | | | | Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>