summaryrefslogtreecommitdiff
path: root/bin/dd/misc.c
AgeCommit message (Collapse)Author
2021-10-09dd: clean up function summaryrillig
No functional change. Ideally the binary would have stayed the same, but GCC 10.3.0 inserts a nop and reorders the code.
2021-10-09dd: fix lint error about 'return expr' from void functionrillig
No change to the resulting binary. The 'return' statements are necessary for GCC to generate the exact same object code, even though they can be removed without affecting the functionality, as seen before the 'else'.
2021-09-10bin: remove unnecessary lint comment CONSTCONDrillig
Since 2021-01-31, lint no longer warns about 'do ... while (0)'. No functional change.
2011-11-07As suggested by Enami, rework the msgfmt logic a bit:jym
- error out when an unknown specifier is used. Do this in f_msgfmt(), before dd(1) starts operation. - allow buffer_write() to flush the internal buffer even when NULL is passed as parameter. Some whitespace fixes too.
2011-11-06Add a new command to dd(1): msgfmt. The command modifies thejym
output of the information summary returned by dd(1). This can be used to specify messages in a more usable (or parseable) format like human-readable values. My intent is to re-use this for building image files and quick I/O benchmarking. Reviewed by tsutsui@ on tech-userlevel. See also http://mail-index.netbsd.org/tech-userlevel/2010/12/03/msg004179.html Some examples: $ dd if=/dev/zero of=/dev/null bs=1m count=1 msgfmt=human 1+0 records in 1+0 records out 1048576 bytes (1,0 MB) transferred in 0.001 secs (1048576000 bytes/sec - 1,0 GB/sec) $ dd if=/dev/zero of=/dev/null count=1 msgfmt=' > <speed>%E</speed> > <time>%s</time> > <bytes>%b</bytes> > ' <speed>500 KB/sec</speed> <time>0.001</time> <bytes>512</bytes>
2007-10-05Convert to using raise_default_signal(3).lukem
2007-07-03In the SIGINT handler, explicitly display a summary and then raise thelukem
default SIGINT handler to exit, rather than exit(0) and relying upon the atexit() to display the summary. Per SUS6.
2004-01-17add support for conv=sparsedbj
inspired by freebsd, although this patch attempts to avoid some potential bugs in their implementation.
2004-01-04remove unused code left from printescaped() backput as pointed out by Jeffjschauma
Ito in PR bin/23969 and PR bin/23970.
2003-09-14Following private discussion with kleink@ and hubertf@ and public discussionjschauma
on tech-userlevel@, back out printescaped() functionality. kleink: ``We sell rope.''
2003-08-07Move UCB-licensed code from 4-clause to 3-clause licence.agc
Patches provided by Joel Baker in PR 22249, verified by myself.
2003-08-04As discusses a little while back on tech-userlevel:jschauma
If stdout is a tty, use vis(3) to print any filenames to prevent garbage from being printed if the filename contains control- or other non-printable characters. While here, sprinkle some EXIT_FAILURE and NOTREACHED where appropriate.
2001-11-26a bit more cosmetic changes.enami
2001-11-25- Use u_longlong_t instead of u_quad_t, u_long, or int for various buffer sizeslukem
- Add strsuftoull(), which parses a number into a u_longlong_t, with multiplication support, and support for 'g' (GB) and 't' (TB) suffices. If an error occurs, print to stderr and exit. Based on get_blk() from args.c and strsufto*() (in other programs) - Add strsuftoullx(), which acts as per strsuftoull() but returns the error in the supplied buffer instead (if the returned buffer != "", an error occurred) - Replace get_bsz() use with strsuftoull() - Remove (now) unnecessary argument validation - Remove unused {f,p,s,t}_stats fields in struct IO
2001-11-25- ANSI KNFlukem
- WARNS=2 (mainly converting some "char *" -> "const char *")
2001-04-28In the words of Our Fearless Leader, I am "utterly sick" of dd(1)ross
lying to me about transfer rates. Do some fixed point frobbing to get stuff like: 2486864 bytes transferred in 0.272 secs (9142882 bytes/sec)
2001-01-04use more standard %ll_ in favour of %q_lukem
1999-07-29Add "progress=1" switch to show a sign of life by printing a '.' forhubertf
every block written to the output file.
1998-07-28Delint.mycroft
1998-02-06quads must be cast to long long for printing.thorpej
1998-02-04Use u_quad_t instead of u_long to define struct STAT.bytes, whichenami
is used to count bytes transfered, so that it won't overflow even if transfer is more than 4Gbytes.
1997-07-20Fix compiler warnings.christos
Add WARNS=1
1995-03-21convert to new RCS id conventions.cgd
1994-09-22Merge 4.4-Lite version.mycroft
1993-08-01Add RCS identifiers.mycroft
1993-05-04added dd(1) from ftp.uu.net:bsd-sources; torching GNU ddglass