summaryrefslogtreecommitdiffstats
path: root/bin/dd
Commit message (Collapse)AuthorAgeFilesLines
* 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
* IFP4 change 222074.brooks2013-04-031-0/+7
| | | | | | | | | | Introduce an explicit close of the output descriptor so that work done on close is accounted for in the summary output triggered at exit (implicit close()s occur after atexit() hooks). This is useful because some devices such as cfi(4) may perform signficant work after a close occurs (e.g. erasing and rewriting a block of flash).
* More -Wmissing-variable-declarations fixes.ed2012-10-201-0/+5
| | | | | | | | | | In addition to adding missing `static' keywords: - bin/dd: Pull in `extern.h' to guarantee consistency with source file. - libexec/rpc.rusersd: Move shared globals into an extern.h. - libexec/talkd: Move `debug' and `hostname' into extern.h. - usr.bin/cksum: Put counters in extern.h, as they are used by ckdist/mtree. - usr.bin/m4: Move `end_result' into extern.h. - usr.sbin/services_mkdb: Move shared globals into an extern.h.
* Rework all non-contributed files that use `struct timezone'.ed2012-09-012-3/+3
| | | | | | | | | | | | | | This structure is not part of POSIX. According to POSIX, gettimeofday() has the following prototype: int gettimeofday(struct timeval *restrict tp, void *restrict tzp); Also, POSIX states that gettimeofday() shall return 0 (as long as tzp is not used). Remove dead error handling code. Also use NULL for a nul-pointer instead of integer 0. While there, change all pieces of code that only use tv_sec to use time(3), as this provides less overhead.
* Bump .Dd for r187609keramida2009-01-301-1/+1
|
* Add an example of using bs=2048 to duplicate data CD-ROMs.keramida2009-01-231-0/+5
| | | | | | | | | | | This should be a bit useful for users who look at the manpage and then try to copy data CD-ROM disks using dd. A lot of us know that bs=2048 is required, but it still manages to cause a bit of grief to those who haven't heard about it. PR: bin/130857 Submitted by: Tri Brotoharsono < mail at tribrotoharsono.net > MFC after: 3 days
* More inactive maintainers.markm2006-07-091-2/+0
|
* Spell "protections" correctly.keramida2005-07-281-1/+1
|
* Sort sections.ru2005-06-141-8/+8
| | | | Approved by: re (blanket)
* Document problems with writing to disks under GEOM.scottl2005-04-071-1/+10
|
* Add the new standard EXIT STATUS section where appropriate.ru2005-01-161-2/+2
| | | | Sort standard sections in the (documented) preferred order.
* /*- or .\"- or #- to begin license clauses.imp2005-01-102-1/+2
|
* Scheduled mdoc(7) sweep.ru2005-01-091-5/+8
|
* Add a "fillchar" command line argument to dd(1) that permits the userrwatson2004-08-155-2/+32
| | | | | | | to specify an alternative padding character when using a conversion mode, or when using noerror with sync and an input error occurs. This facilities reading old and error-prone media by allowing the user to more effectively mark error blocks in the output stream.
* Allow for capital letters as size suffixes.pjd2004-07-311-8/+20
| | | | | Inspired by: le Approved by: green (maintainer)
* Bump document date for the latest functional change.ru2004-05-161-6/+10
| | | | Minor markup tweaks.
* Style fixes and add gen to CLEANFILES.njl2004-04-091-12/+15
| | | | Submitted by: bde
* Remove clause 3 from the UCB licenses.markm2004-04-069-36/+0
| | | | OK'ed by: imp, core
* Remove a.out at the end of 'make test'ache2004-03-081-1/+1
|
* Fixed some style bugs (mainly unsorting and tab lossage in previous commit).bde2004-03-061-16/+15
|
* Add a.out to CLEANFILESache2004-03-061-0/+1
|
* Change locale name from non-existent ASCII to en_US.US-ASCIIache2004-03-061-2/+2
|
* Teach dd(1) about parity bits.phk2004-03-059-21/+157
|
* Add a test-target and reference vectors for the character converions.phk2004-03-0511-0/+194
|
* Get this area compiling with the highest WARNS= that it works with.markm2003-06-131-1/+0
| | | | | | | Obsolete WFORMAT= junk also removed where possible. OK'ed by: obrien Tested on: sparc64, alpha, i386
* Quiet warnings about copyright[].obrien2003-05-011-2/+2
|
* ssize_t is not required to be the same width as size_t by theru2003-03-151-4/+6
| | | | | | specs, so cast to intmax_t where appropriate. Pointed out by: bde
* Fixed (soon might be fatal) -Wformat warnings.ru2003-03-151-2/+2
|
* WARNS=4 fixes. This would be WARNS=9 if we were -std=99 instead ofmarkm2003-02-278-47/+50
| | | | | | -ansi, due to 'long long'. Reviewed by: green (slightly earlier version)
* Don't call DIOCWLABEL on disks, it is not implemented, and calling itphk2003-01-261-7/+1
| | | | like this negated any practical value of the feature.
* mdoc(7) police:ru2002-11-261-1/+1
| | | | | | | | Revert to using the .Tn POSIX and .Tn ANSI instead of \*[Px] and \*[Ai] strings; using these strings is unsafe in troff mode, as they include a change in a font size. Approved by: re
* Consistently use __FBSDIDobrien2002-06-306-12/+12
|
* Replace <strings.h> with <string.h>. No functions from the former arekeramida2002-06-091-1/+1
| | | | | | | used in this file, and strlen() needs to be prototyped by the latter, for this to compile without warnings. Reviewed by: mike
* mdoc(7) police: replace the XXX with the correct width.ru2002-05-291-2/+1
|
* Add semicolon to empty default case to silence warning.jedgar2002-05-111-0/+1
|
* Various mdoc fixes, including a change that corrects spacing askeramida2002-03-311-43/+53
| | | | | | | | described in PR docs/36461. PR: docs/36461 Noticed by: Gary W. Swearingen <swear@blarg.net> Submitted by: ru
* 1) Rev.1.35 of dd.c has a more serious regression. It backs out rev.1.31,markm2002-03-071-1/+2
| | | | | | | | thus breaking systems with unpolluted <sys/stat.h>'s. 2) Back out an initialisation of a variable in BSS. Reported by: bde (1), many(2)
* Fix warnings inspired by lint, a commercial lint and WARNS=4.markm2002-02-223-7/+3
|
* Correct a logic bug that snuck in and broke multiplication of off_ts.green2002-02-071-1/+1
|
OpenPOWER on IntegriCloud