summaryrefslogtreecommitdiffstats
path: root/bin/dd
Commit message (Collapse)AuthorAgeFilesLines
* mdoc(7) police: use the new features of the Nm macro.ru2000-11-201-2/+2
|
* Allow negative seek offsets for files that can be seeked upon. Itgreen2000-10-222-2/+10
| | | | | makes dd(1) a more complete "filter", even if this functionality is limited to seekable streams.
* Don't depend on <sys/stat.h> bogusly including <sys/time.h> (and therebywollman2000-10-101-0/+1
| | | | <time.h>).
* Make the comment regarding ftruncate() correct.green2000-07-201-2/+2
|
* Various cleanups are made to reduce warnings and make code prettier :)green2000-07-015-17/+29
| | | | | Also, check for ftruncate() return value and die on failure, but only try to ftruncate() when the file is a regular file.
* Fix ``dd if=/dev/zero of=/dev/daN'' on the Alpha by allowing the labelobrien2000-05-241-1/+8
| | | | | | to be overwritten. Submitted by: green
* After Bruce kindly explained the whole groff "sentence" idea to me, I'vegreen2000-03-011-2/+4
| | | | put the whitespace in the right place.
* Fix style bugs I introduced in the last revision.green2000-02-271-7/+7
| | | | Brucified by: bde
* Add iseek= and oseek= aliases for the preexisting skip= and seek=green2000-02-262-1/+13
| | | | | | | | | | | operands. Can _YOU_ tell skip= and seek= apart with 100% accuracy every time? This also seems to make us option-for-option compatible with the Solaris dd(1). Approved by: jkh Suggested by: peter
* Reflect that dd accepts octal and hexadecimal numbers (in addition to decimal).gsutter2000-02-181-1/+2
| | | | | PR: 16750 Submitted by: Giorgos Keramidas <keramida@ceid.upatras.gr>
* I've been Brucified! I did evil things with typedefs, but I'll do itgreen1999-12-081-4/+4
| | | | | | | the correct (but less aesthetic) way, now. New lesson: correctness and aestheticity may be mutually exclusive at times. Brucified by: bde
* Do proper constification in args.c. This shuts up -Wcast-qual (thanks,green1999-12-072-4/+8
| | | | | | | bfumerola for that pointer!) in GCC complaining about losing a const. While I'm here, might as well mark in the Makefile that I'm the ${MAINTAINER}. It seems like that's what everyone's doing these days.
* Nuke the FIODTYPE compatibility bits. It's time.green1999-10-031-3/+1
|
* Make count=0 set cpy_cnt to -1, which is slight overloading, but makesgreen1999-09-163-5/+18
| | | | | | what I was trying to do work much better (ie at all. I could have sworn it was working...) Fix a SEEK_SET to be SEEK_CUR, and make Bruce's lseek() test work correctly.
* Let count=-something fail, while count=0 may succeed, thus making dd(1)green1999-09-161-2/+2
| | | | | | | useful as a seeking-tool as well as its many other uses. Previously, dd(1) would succeed with count=0, but wouldn't get to the point that blocks were to be read/written. This is a more useful behavior, and this specific case doesn't seem to be handled by POSIX.
* Even more dd(1) cleanups! Thanks to Bruce for staying on my case untilgreen1999-09-136-37/+45
| | | | we're done (not yet!) :)
* ISDISK -> ISSEEKgreen1999-09-123-5/+5
| | | | Allow a device type of D_DISK or D_MEM to be ISSEEK.
* Even more cleanups to dd(1). This is probably the culmination of thegreen1999-09-127-120/+117
| | | | | | | | | | | | | BDEification process of dd(1). Most of the changes are from BDE's archive. Support for negative offsets is gone again, but the case where you lseek() onto byte -1 of something from a negative offset using seek/skip is fixed; if you end up on -1, you won't get a false positive lseek failure. The biggest changes are to data types (more size_t, for instance) and argument parsing. skip/seek on /dev/{,k}mem now occurs (instead of "read until you reach the offset") due to mem devices now being D_DISK. Some const things are now correctly declared as such, and the "case table" building is better. The only thing that seems to be left to make dd(1) everything TOG wants it to be is l10n.
* Make a bit more headway with dd's argument parsing, etc. get_bsz() isgreen1999-09-112-26/+32
| | | | | renamed get_num() since it's not just about block sizes. skip and seek can be any offset, including negative, now. Some style bogons are fixed.
* Relax things a bit. Not having FIODTYPE will be a warning for now.green1999-08-281-8/+12
| | | | | Pointy hat: green Pointed out by: peter
* $Id$ -> $FreeBSD$peter1999-08-2710-10/+10
|
* Use FIODTYPE to unbogosify much of the file type checking in dd.green1999-08-271-10/+15
|
* Implement seekability for disk devices (not just regular files).green1999-07-133-11/+13
| | | | | | Also, fix pos_out() to do the same checks pos_in() did. Done for: jdp, luigi, the good of the world
* This is the second round of dd(1) changes. Some changes made/reversed bygreen1999-06-207-83/+108
| | | | | | | | request of Bruce. More changes may follow later. 'g' multiplier has been added (i.e. dd seek=5g if=bigfile.) Some minor corrections were made as well. Noticed by: bde
* Miscellaneous dd(1) changes: mainly fixing variable types (size_t, ssize_t,green1999-06-197-105/+104
| | | | | off_t, int, u_int64_t, etc.). dd(1) should now work properly with REALLY big amounts of data.
* Various spelling/formatting changes.kris1999-05-082-5/+5
| | | | Submitted by: Philippe Charnier <charnier@xp11.frmug.org>
* First set of fixes to keep egcs happy. These include {} around singleimp1999-04-251-5/+6
| | | | | | | | | | statement if blocks[*] when the else could be ambiguous, not defaulting to int type and removal of some unused variables. [*] This is explicitly allowed by style(9) when the single statement spans more than one line. Reviewed by: obrien, chuckr
* Fixed printf format errors.bde1998-12-071-4/+4
|
* Describe `bs=n' more precisely. Fixed some English errors.bde1998-11-291-6/+8
| | | | Obtained from: OpenBSD
* Restore Lite-2 sccsid. Restore include of sys/types.h.charnier1998-05-136-12/+14
|
* Correct use of .Nm and other cosmetics. Add rcsid. Remove unused #inc.charnier1998-05-067-34/+33
|
* Exit with a nonzero status if we get killed by a SIGINT. POSIX.2bde1998-02-241-4/+5
| | | | | | | | | specifies exiting with a zero status if the file was copied successfully, and with a nonzero status if an error occurred. We are too sloppy to tell if the file was copied successfully when we get killed by a SIGINT, but it is unlikely to have been. Added a comment about related sloppiness (calling exit() from a signal handler).
* Fix printing for bytes read > 4G.asami1998-02-112-4/+4
| | | | Reviewed by: bde
* Oops, back out rev 1.5, it wasn't my intention to also commit thejoerg1998-01-071-2/+1
| | | | -g. ;)
* Use the correct value in the call to swab(3) with conv=swab. Previously,joerg1998-01-072-3/+4
| | | | | | | | | | dd if=/dev/zero of=/dev=null obs=23520 conv=swab coredumped. Please somebody review it, i'm not 105 % sure i'm understanding all this mess correctly. Detected by: Holm Tiffe <holm@geophysik.tu-freiberg.de>
* It's more portable to use <errno.h> than <sys/errno.h>eivind1997-12-151-2/+2
| | | | Pointed-out-by: bde (a long while ago)
* Sort "sparse" into alphabetical order, since dd's `conv' options needjoerg1997-11-111-2/+2
| | | | to be sorted. This temporarily broke the "osync" option.
* Teach dd(1) about an option to write sparse files. Can be useful forjoerg1997-10-114-7/+45
| | | | | | | things like diskless clients' swap files etc. Submitted by: pascal@zuo.dec.com (Pascal Pederiva) (ages ago, with many stylistic changes by me)
* Add <sys/errno.h>eivind1997-10-091-1/+2
|
* make signal handlers errno safeeivind1997-10-081-1/+3
| | | | Obtained from: OpenBSD (file rev 1.5) Theo de Raadt <deraadt@openbsd.org>
* Slightly improved fix compared to my insirationeivind1997-10-081-1/+3
| | | | | | | don't munge argv strings -- copy them first. avoids 'w' showing: deraadt p8 zeus.theos.com 8:26AM 3 dd if of bs Obtained from: OpenBSD (file rev 1.3) by Theo de Raadt <deraadt@openbsd.org>
* Pad the input buffer whenever sync is used, not just if the noerror flagjlemon1997-08-191-10/+12
| | | | | | | | | | is also set. Change osync to not to tack on an empty block if the input buffer is null, or an even multiple of the blocksize. Also change osync to pad the output with nulls/spaces depending whether this is a block-oriented conversion or not (same as sync). PR: 3818
* Fixed overflow for attempts to seek to offsets > ULONG_MAX. See thebde1997-04-301-2/+2
| | | | | | OpenBSD version for more complete fixes. E.g., to seek to offsets > INT_MAX using a block size of 1, block numbers need to be off_t's instead of u_long's.
* Change spelling of ECBDIC to EBCDIC. Closes PR #3402steve1997-04-281-2/+2
| | | | Submitted by: h-nokubi@nmit.mt.nec.co.jp
* Revert $FreeBSD$ to $Id$peter1997-02-2210-10/+10
|
* Make the long-awaited change from $Id$ to $FreeBSD$jkh1997-01-1410-10/+10
| | | | | | | | This will make a number of things easier in the future, as well as (finally!) avoiding the Id-smashing problem which has plagued developers for so long. Boy, I'm glad we're not using sup anymore. This update would have been insane otherwise.
* -Wall cleaning.steve1996-12-146-15/+15
|
* Bruce says: "You have been programming in the kernel for too long :-)."phk1996-11-135-40/+25
| | | | | | | | | | | | | | | | | and he's right ... I forgot about this floating point stuff you can use in user-land :-) Increase precision of duration to microseconds. No heuristics to avoid overflow in calculation needed - just depend on DBL_MAX being a bit larger than LONG_MAX. Use double instead of `struct timeval' in dd.h so that everything doesn't have to include <sys/time.h>. Fixed style bugs in recent and old FreeBSD changes. Reviewed by: phk Submitted by: bde
* Increase precision of duration to milliseconds.phk1996-11-125-14/+34
| | | | Some heuristics to avoid overflow in calculation attempted.
* Add setlocale LC_CTYPEache1995-10-231-1/+3
|
OpenPOWER on IntegriCloud