summaryrefslogtreecommitdiffstats
path: root/bin/dd
Commit message (Collapse)AuthorAgeFilesLines
* o __P has been reovedimp2002-02-026-91/+68
| | | | | | | | | | | o Old-style K&R declarations have been converted to new C89 style o register has been removed o prototype for main() has been removed (gcc3 makes it an error) o int main(int argc, char *argv[]) is the preferred main definition. o Attempt to not break style(9) conformance for declarations more than they already are. Approved by: arch@, new style(9)
* Commit general cleanups (separate get_num() and get_off_t() functions togreen2002-01-253-59/+109
| | | | | debogosify some of the command-line string-number conversions into an unsigned and signed variant.)
* Default to WARNS=2. Binary builds that cannot handle this must explicitlyobrien2001-12-041-0/+1
| | | | | | set WARNS=0. Reviewed by: mike
* mdoc(7) police: utilize the new .Ex macro.ru2001-08-151-3/+1
|
* mdoc(7) police: s/BSD/.Bx/ where appropriate.ru2001-08-141-2/+6
|
* Use __unused for non-used variables.green2001-06-292-2/+2
| | | | Submitted by: Mike Barcroft <mike@q9media.com>
* Previous commit broke dd(1)'s I/O summary when it's terminated by add2001-06-251-0/+1
| | | | | | | | | signal. Fix it by adding an explicit call to summary() in terminate() (it was previously called implicitly by exit() because summary() was registered with atexit()). summary() is supposed to be signal-safe-- it handles SIGINFO almost exclusively--so this should be safe. Submitted by: bde
* Don't call exit(3) from a signal handler.dd2001-06-241-2/+1
| | | | Obtained from: OpenBSD
* Add more headers that are required with -fno-builtin (stdlib and strings)des2001-06-191-0/+2
|
* 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>
OpenPOWER on IntegriCloud