summaryrefslogtreecommitdiffstats
path: root/bin/dd
Commit message (Collapse)AuthorAgeFilesLines
* MFC r316430vangyzen2017-05-011-5/+5
| | | | | | | | | | | | Fix indentation in dd(1) Quoting http://mdocml.bsd.lv/mdoc/details/width.html Do not use macros in the argument specifying the width, since that's not portable. While GNU troff can handle it, mandoc cannot. Sponsored by: Dell EMC
* Add history section for dd(1)sevan2017-02-031-1/+6
| | | | | | | | | First version of UNIX to include dd found using TUHS http://minnie.tuhs.org/cgi-bin/utree.pl?file=V5/usr/source/s1/dd.c PR: 211777 Approved by: bcr (mentor) Differential Revision: https://reviews.freebsd.org/D8104
* Merge ^/user/ngie/release-pkg-fix-tests to unbreak how test files are installedngie2016-05-041-4/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | after r298107 Summary of changes: - Replace all instances of FILES/TESTS with ${PACKAGE}FILES. This ensures that namespacing is kept with FILES appropriately, and that this shouldn't need to be repeated if the namespace changes -- only the definition of PACKAGE needs to be changed - Allow PACKAGE to be overridden by callers instead of forcing it to always be `tests`. In the event we get to the point where things can be split up enough in the base system, it would make more sense to group the tests with the blocks they're a part of, e.g. byacc with byacc-tests, etc - Remove PACKAGE definitions where possible, i.e. where FILES wasn't used previously. - Remove unnecessary TESTSPACKAGE definitions; this has been elided into bsd.tests.mk - Remove unnecessary BINDIRs used previously with ${PACKAGE}FILES; ${PACKAGE}FILESDIR is now automatically defined in bsd.test.mk. - Fix installation of files under data/ subdirectories in lib/libc/tests/hash and lib/libc/tests/net/getaddrinfo - Remove unnecessary .include <bsd.own.mk>s (some opportunistic cleanup) Document the proposed changes in share/examples/tests/tests/... via examples so it's clear that ${PACKAGES}FILES is the suggested way forward in terms of replacing FILES. share/mk/bsd.README didn't seem like the appropriate method of communicating that info. MFC after: never probably X-MFC with: r298107 PR: 209114 Relnotes: yes Tested with: buildworld, installworld, checkworld; buildworld, packageworld Sponsored by: EMC / Isilon Storage Division
* MFHgjb2016-03-101-0/+11
|\ | | | | | | Sponsored by: The FreeBSD Foundation
| * DIRDEPS_BUILD: Connect MK_TESTS.bdrewery2016-03-091-0/+11
| | | | | | | | Sponsored by: EMC / Isilon Storage Division
* | MFHgjb2016-03-025-7/+60
|\ \ | |/ | | | | Sponsored by: The FreeBSD Foundation
| * Add speed limit to dd(1). This is useful for testing RCTL disk io limitstrasz2016-02-285-7/+60
| | | | | | | | | | | | | | | | | | (when they actually get committed, that is), and might also come in handy in other situations. Reviewed by: wblock@ (man page) MFC after: 1 month Sponsored by: The FreeBSD Foundation
* | MFHgjb2016-02-226-27/+53
|\ \ | |/ | | | | Sponsored by: The FreeBSD Foundation
| * Make the "invalid numeric value" error message actually displayabletrasz2016-02-211-8/+6
| | | | | | | | | | | | | | | | | | (was a dead code before). Submitted by: bde@ (earlier version) Reviewed by: bde@ MFC after: 1 month Sponsored by: The FreeBSD Foundation
| * Reorganize the handling all-zeroes terminal block in sparse modethomas2016-02-185-19/+47
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The intent of the previous code in that case was to force an explicit write, but the implementation was incorrect, and as a result the write was never performed. This new implementation instead uses ftruncate(2) to extend the file with a trailing hole. Also introduce regression tests for these cases. PR: 189284 (original PR whose fix introduced this bug) PR: 207092 Differential Revision: D5248 Reviewed by: sobomax,kib MFC after: 2 weeks
* | MFHgjb2016-02-101-6/+8
|\ \ | |/ | | | | Sponsored by: The FreeBSD Foundation
| * Improve comment to reflect recent changes.trasz2016-02-091-2/+4
| | | | | | | | | | MFC after: 1 month Sponsored by: The FreeBSD Foundation
| * Use a proper type for return value of postfix_to_mult(); the way it'strasz2016-02-091-2/+2
| | | | | | | | | | | | | | | | being used wouldn't work if the value returned didn't fit in intmax_t. Submitted by: bde@ MFC after: 1 month Sponsored by: The FreeBSD Foundation
| * Use proper functions for parsing the numeric values.trasz2016-02-091-2/+2
| | | | | | | | | | | | Submitted by: bde@ MFC after: 1 month Sponsored by: The FreeBSD Foundation
* | Explicitly add unmarked bin/ binaries to the runtime package.gjb2016-02-091-0/+1
| | | | | | | | | | | | | | | | Note: tcsh(1) has a MK_TCSH=no test, so this should be a separate package, which requires pre-install/post-install scripts, to be added later. Sponsored by: The FreeBSD Foundation
* | MFHgjb2016-02-082-50/+47
|\ \ | |/ | | | | Sponsored by: The FreeBSD Foundation
| * Add 't' and 'p' postfixes to dd(1).trasz2016-02-042-2/+13
| | | | | | | | | | MFC after: 1 month Sponsored by: The FreeBSD Foundation
| * Reduce code duplication.trasz2016-02-041-48/+34
| | | | | | | | | | MFC after: 1 month Sponsored by: The FreeBSD Foundation
* | First pass to fix the 'tests' packages.gjb2016-02-021-0/+4
|/ | | | Sponsored by: The FreeBSD Foundation
* Integrate contrib/netbsd-tests/bin/dd into the FreeBSD test suite asngie2015-10-182-0/+13
|\ | | | | | | | | | | | | | | | | | | bin/dd/tests Ensure fdescfs is mounted on /dev/fd/ for the length testcase as it's used in validating the characters read from /dev/zero MFC after: 2 weeks Sponsored by: EMC / Isilon Storage Division
| * Integrate contrib/netbsd-tests/bin/dd into the FreeBSD test suite as ↵ngie2015-10-182-0/+13
|/ | | | bin/dd/tests
* Mention the dd-like recoverdisk(1) to help folks find this great BSD command.obrien2015-07-161-0/+1
|
* Add META_MODE support.sjg2015-06-131-0/+18
|\ | | | | | | | | | | | | | | | | | | | | Off by default, build behaves normally. WITH_META_MODE we get auto objdir creation, the ability to start build from anywhere in the tree. Still need to add real targets under targets/ to build packages. Differential Revision: D2796 Reviewed by: brooks imp
| * dirdeps.mk now sets DEP_RELDIRsjg2015-06-081-2/+0
| |
| * Merge from head@274682sjg2014-11-191-1/+6
| |\ | |/ |/|
| * Updated dependenciessjg2014-05-161-1/+0
| |
| * Updated dependenciessjg2014-05-101-0/+2
| |
| * Merge from headsjg2014-05-084-38/+62
| |\
| * \ Merge headsjg2014-04-284-32/+67
| |\ \
| * \ \ Merge head@256284sjg2013-10-131-3/+3
| |\ \ \
| * \ \ \ Merge from headsjg2013-09-056-21/+23
| |\ \ \ \
| * \ \ \ \ sync from headsjg2013-04-121-0/+7
| |\ \ \ \ \
| * | | | | | Updated dependenciessjg2013-03-111-0/+1
| | | | | | |
| * | | | | | Updated dependenciessjg2013-02-161-2/+0
| | | | | | |
| | | | | | |
| | \ \ \ \ \
| *-. \ \ \ \ \ Sync from headsjg2012-11-043-3/+8
| |\ \ \ \ \ \ \
| * | | | | | | | Sync FreeBSD's bmake branch with Juniper's internal bmake branch.marcel2012-08-221-0/+19
| | |/ / / / / / | |/| | | | | | | | | | | | | | | | | | | | | | Requested by: Simon Gerraty <sjg@juniper.net>
* | | | | | | | bin/dd: revert 273734, as it fails on 32bit platformspi2014-10-275-46/+54
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Revert: insufficient testing on 32bit platforms PR: 191263
* | | | | | | | bin/dd: Fix incorrect casting of argumentspi2014-10-275-54/+46
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | dd(1) casts many of its numeric arguments from uintmax_t to intmax_t and back again to detect whether or not the original arguments were negative. This caused wrong behaviour in some boundary cases: $ dd if=/dev/zero of=/dev/null count=18446744073709551615 dd: count cannot be negative After the fix: $ dd if=/dev/zero of=/dev/null count=18446744073709551615 dd: count: Result too large PR: 191263 Submitted by: will@worrbase.com Approved by: cognet@
* | | | | | | | Update the date for last example.imp2014-08-301-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Sponsored by: Netflix
* | | | | | | | Add canonical population of a disk / thumb drive from an imageimp2014-08-281-0/+5
| |_|_|_|_|_|/ |/| | | | | | | | | | | | | | | | | | | | example.
* | | | | | | Incorporate feedback from bde and jilles regarding r265472 to dd(1).asomers2014-05-083-15/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Don't use sysexits.h. Just exit 1 on error and 0 otherwise. * Don't sacrifice precision by converting the output of clock_gettime() to a double and then comparing the results. Instead, subtract the values of the two clock_gettime() calls, then convert to double. * Don't use CLOCK_MONOTONIC_PRECISE. It's an unportable synonym for CLOCK_MONOTONIC. * Use more appropriate names for some local variables. * In the summary message, round elapsed time to the nearest microsecond. Reported by: bde, jilles MFC after: 3 days X-MFC-With: 265472
* | | | | | | (dd_out): Fix handling of all-zeroes block at end of input withthomas2014-05-071-24/+43
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | conv=sparse. This change fixes two separate issues observed when the last output block is all zeroes, and conv=sparse is in use. In this case, care must be taken to roll back the last seek and write the entire last zero block at the original offset where it should have occurred: when the destination file is a block device, it is not possible to roll back by just one character as the write would then not be properly aligned. Furthermore, the buffer used to write this last all-zeroes block needs to be properly zeroed-out. This was not the case previously, resulting in a junk data byte appearing instead of a zero in the output stream. PR: bin/189174 PR: bin/189284 Reviewed by: kib MFC after: 2 weeks
* | | | | | | dd(1) uses gettimeofday(2) to compute the throughput statistics. However,asomers2014-05-062-12/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | gettimeofday returns the system clock, which may jump forward or back, especially if NTP is in use. If the time jumps backwards, then dd will see negative elapsed time, round it up to 1usec, and print an absurdly fast transfer rate. The solution is to use clock_gettime(2) with CLOCK_MONOTONIC_PRECISE as the clock_id. That clock advances steadily, regardless of changes to the system clock. Reviewed by: delphij MFC after: 3 days Sponsored by: Spectra Logic
* | | | | | | Minor comment fix: dbsz is the block size as set by bs/ibs/obs,thomas2014-05-031-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | not the size of the buffer.
* | | | | | | Minor comment fix.thomas2014-05-031-1/+1
| |_|_|_|_|/ |/| | | | |
* | | | | | Make C_* contants fit in 32 bits again by using 4 unused bits.delphij2014-04-033-32/+32
| | | | | | | | | | | | | | | | | | | | | | | | Noticed by: bde
* | | | | | Implement GNU's extension of 'status' operand. The GNU syntax isdelphij2014-04-036-34/+69
| |_|_|_|/ |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | borrowed where syntax status=noxfer means no transfer statistics and status=none means no status information at all. This feature is useful because the statistics information can sometimes be annoying, and redirecting stderr to /dev/null would mean error messages also gets silenced. Obtained from: OpenBSD MFC after: 2 weeks
* | | | | Sweep man pages replacing ad -> ada.pluknet2013-10-011-3/+3
| |_|_|/ |/| | | | | | | | | | | | | | | | | | | Approved by: re (blackend) MFC after: 1 week X-MFC note: stable/9 only
* | | | Make dd's signal handler async safe.eadler2013-05-106-20/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | PR: bin/75258 Submitted by: "Oleg V. Nauman" <oleg@reis.zp.ua> Arrival Date: Sun Dec 19 14:50:21 GMT 2004 Reviewed by: mjg, jhb Reviewed by: jilles (earlier version) MFC after: 1 week
* | | | Literally follow POSIX:kib2013-04-231-1/+1
| |_|/ |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If the bs= expr operand is specified and no conversions other than sync, noerror, or notrunc are requested, the data returned from each input block shall be written as a separate output block. In particular, when both bs=size and conv=sparce were specified, the resulted file was fully filled, instead of sparce. PR: standards/177742 Submitted by: Matthew Rezny <mrezny@hexaneinc.com> MFC after: 2 weeks
OpenPOWER on IntegriCloud