summaryrefslogtreecommitdiffstats
path: root/bin/dd/args.c
Commit message (Collapse)AuthorAgeFilesLines
* MFC r264059+264067:delphij2014-04-171-0/+14
| | | | | | | | | | | | 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
* Make dd's signal handler async safe.eadler2013-05-101-0/+1
| | | | | | | | | 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
* Add a "fillchar" command line argument to dd(1) that permits the userrwatson2004-08-151-0/+12
| | | | | | | 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)
* Remove clause 3 from the UCB licenses.markm2004-04-061-4/+0
| | | | OK'ed by: imp, core
* Teach dd(1) about parity bits.phk2004-03-051-0/+4
|
* 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-271-23/+24
| | | | | | -ansi, due to 'long long'. Reviewed by: green (slightly earlier version)
* Consistently use __FBSDIDobrien2002-06-301-2/+2
|
* Add semicolon to empty default case to silence warning.jedgar2002-05-111-0/+1
|
* Fix warnings inspired by lint, a commercial lint and WARNS=4.markm2002-02-221-0/+1
|
* Correct a logic bug that snuck in and broke multiplication of off_ts.green2002-02-071-1/+1
|
* o __P has been reovedimp2002-02-021-48/+32
| | | | | | | | | | | 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-251-56/+107
| | | | | debogosify some of the command-line string-number conversions into an unsigned and signed variant.)
* Allow negative seek offsets for files that can be seeked upon. Itgreen2000-10-221-2/+2
| | | | | makes dd(1) a more complete "filter", even if this functionality is limited to seekable streams.
* Various cleanups are made to reduce warnings and make code prettier :)green2000-07-011-2/+3
| | | | | Also, check for ftruncate() return value and die on failure, but only try to ftruncate() when the file is a regular file.
* Add iseek= and oseek= aliases for the preexisting skip= and seek=green2000-02-261-0/+2
| | | | | | | | | | | 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
* 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-071-4/+6
| | | | | | | 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.
* Make count=0 set cpy_cnt to -1, which is slight overloading, but makesgreen1999-09-161-0/+2
| | | | | | 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-131-5/+7
| | | | we're done (not yet!) :)
* Even more cleanups to dd(1). This is probably the culmination of thegreen1999-09-121-30/+46
| | | | | | | | | | | | | 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-111-24/+22
| | | | | 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.
* $Id$ -> $FreeBSD$peter1999-08-271-1/+1
|
* This is the second round of dd(1) changes. Some changes made/reversed bygreen1999-06-201-34/+65
| | | | | | | | 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-191-35/+23
| | | | | 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-081-2/+2
| | | | Submitted by: Philippe Charnier <charnier@xp11.frmug.org>
* Restore Lite-2 sccsid. Restore include of sys/types.h.charnier1998-05-131-2/+2
|
* Correct use of .Nm and other cosmetics. Add rcsid. Remove unused #inc.charnier1998-05-061-3/+4
|
* 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-111-1/+2
| | | | | | | things like diskless clients' swap files etc. Submitted by: pascal@zuo.dec.com (Pascal Pederiva) (ages ago, with many stylistic changes by me)
* 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>
* Revert $FreeBSD$ to $Id$peter1997-02-221-1/+1
|
* Make the long-awaited change from $Id$ to $FreeBSD$jkh1997-01-141-1/+1
| | | | | | | | 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-141-2/+2
|
* Bruce says: "You have been programming in the kernel for too long :-)."phk1996-11-131-3/+2
| | | | | | | | | | | | | | | | | 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-121-1/+2
| | | | Some heuristics to avoid overflow in calculation attempted.
* Added $Id$dg1994-09-241-0/+2
|
* Applied patch to make -Wall and -Dlint shut up.phk1994-09-201-1/+1
| | | | | Reviewed by: phk Submitted by: Josef Grosch <joeg@gagme.wwa.com>
* BSD 4.4 Lite bin Sourcesrgrimes1994-05-261-0/+386
OpenPOWER on IntegriCloud