History log of /freebsd-10.1-release/bin/dd/args.c
Revision Date Author Comments
(<<< Hide modified files)
(Show modified files >>>)
# 272461 02-Oct-2014 gjb

Copy stable/10@r272459 to releng/10.1 as part of
the 10.1-RELEASE process.

Approved by: re (implicit)
Sponsored by: The FreeBSD Foundation

# 264577 16-Apr-2014 delphij

MFC r264059+264067:

Implement GNU's extension of 'status' operand. The GNU syntax is
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


# 256281 10-Oct-2013 gjb

Copy head (r256279) to stable/10 as part of the 10.0-RELEASE cycle.

Approved by: re (implicit)
Sponsored by: The FreeBSD Foundation


# 250469 10-May-2013 eadler

Make dd's signal handler async safe.

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


# 133762 15-Aug-2004 rwatson

Add a "fillchar" command line argument to dd(1) that permits the user
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.


# 132933 31-Jul-2004 pjd

Allow for capital letters as size suffixes.

Inspired by: le
Approved by: green (maintainer)


# 127958 06-Apr-2004 markm

Remove clause 3 from the UCB licenses.

OK'ed by: imp, core


# 126667 05-Mar-2004 phk

Teach dd(1) about parity bits.


# 112265 15-Mar-2003 ru

ssize_t is not required to be the same width as size_t by the
specs, so cast to intmax_t where appropriate.

Pointed out by: bde


# 112254 15-Mar-2003 ru

Fixed (soon might be fatal) -Wformat warnings.


# 111629 27-Feb-2003 markm

WARNS=4 fixes. This would be WARNS=9 if we were -std=99 instead of
-ansi, due to 'long long'.

Reviewed by: green (slightly earlier version)


# 99109 30-Jun-2002 obrien

Consistently use __FBSDID


# 96383 11-May-2002 jedgar

Add semicolon to empty default case to silence warning.


# 91079 22-Feb-2002 markm

Fix warnings inspired by lint, a commercial lint and WARNS=4.


# 90331 07-Feb-2002 green

Correct a logic bug that snuck in and broke multiplication of off_ts.


# 90108 02-Feb-2002 imp

o __P has been reoved
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)


# 89788 25-Jan-2002 green

Commit general cleanups (separate get_num() and get_off_t() functions to
debogosify some of the command-line string-number conversions into
an unsigned and signed variant.)


# 67451 22-Oct-2000 green

Allow negative seek offsets for files that can be seeked upon. It
makes dd(1) a more complete "filter", even if this functionality is
limited to seekable streams.


# 62311 01-Jul-2000 green

Various cleanups are made to reduce warnings and make code prettier :)
Also, check for ftruncate() return value and die on failure, but only
try to ftruncate() when the file is a regular file.


# 57523 26-Feb-2000 green

Add iseek= and oseek= aliases for the preexisting skip= and seek=
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


# 54278 08-Dec-1999 green

I've been Brucified! I did evil things with typedefs, but I'll do it
the correct (but less aesthetic) way, now. New lesson: correctness
and aestheticity may be mutually exclusive at times.

Brucified by: bde


# 54245 07-Dec-1999 green

Do proper constification in args.c. This shuts up -Wcast-qual (thanks,
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.


# 51335 16-Sep-1999 green

Make count=0 set cpy_cnt to -1, which is slight overloading, but makes
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.


# 51326 16-Sep-1999 green

Let count=-something fail, while count=0 may succeed, thus making dd(1)
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.


# 51249 13-Sep-1999 green

Even more dd(1) cleanups! Thanks to Bruce for staying on my case until
we're done (not yet!) :)


# 51208 12-Sep-1999 green

Even more cleanups to dd(1). This is probably the culmination of the
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.


# 51137 10-Sep-1999 green

Make a bit more headway with dd's argument parsing, etc. get_bsz() is
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.


# 50471 27-Aug-1999 peter

$Id$ -> $FreeBSD$


# 48051 20-Jun-1999 green

This is the second round of dd(1) changes. Some changes made/reversed by
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


# 48026 19-Jun-1999 green

Miscellaneous dd(1) changes: mainly fixing variable types (size_t, ssize_t,
off_t, int, u_int64_t, etc.). dd(1) should now work properly with REALLY
big amounts of data.


# 46684 08-May-1999 kris

Various spelling/formatting changes.

Submitted by: Philippe Charnier <charnier@xp11.frmug.org>


# 36007 13-May-1998 charnier

Restore Lite-2 sccsid. Restore include of sys/types.h.


# 35773 06-May-1998 charnier

Correct use of .Nm and other cosmetics. Add rcsid. Remove unused #inc.


# 31120 11-Nov-1997 joerg

Sort "sparse" into alphabetical order, since dd's `conv' options need
to be sorted. This temporarily broke the "osync" option.


# 30312 11-Oct-1997 joerg

Teach dd(1) about an option to write sparse files. Can be useful for
things like diskless clients' swap files etc.

Submitted by: pascal@zuo.dec.com (Pascal Pederiva) (ages ago, with many
stylistic changes by me)


# 30230 08-Oct-1997 eivind

Slightly improved fix compared to my insiration

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>


# 22988 22-Feb-1997 peter

Revert $FreeBSD$ to $Id$


# 21673 14-Jan-1997 jkh

Make the long-awaited change from $Id$ to $FreeBSD$

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.


# 20420 14-Dec-1996 steve

-Wall cleaning.


# 19720 13-Nov-1996 phk

Bruce says: "You have been programming in the kernel for too long :-)."

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


# 19694 12-Nov-1996 phk

Increase precision of duration to milliseconds.
Some heuristics to avoid overflow in calculation attempted.


# 3044 24-Sep-1994 dg

Added $Id$


# 2923 20-Sep-1994 phk

Applied patch to make -Wall and -Dlint shut up.

Reviewed by: phk
Submitted by: Josef Grosch <joeg@gagme.wwa.com>


# 1557 26-May-1994 rgrimes

This commit was generated by cvs2svn to compensate for changes in r1556,
which included commits to RCS files with non-trunk default branches.


# 1556 26-May-1994 rgrimes

BSD 4.4 Lite bin Sources