summaryrefslogtreecommitdiff
path: root/src/dd.c
AgeCommit message (Collapse)Author
2004-04-15(ROUND_UP_OFFSET, PTR_ALIGN): Remove.Jim Meyering
All uses replaced by ptr_align.
2004-04-08(flags, usage): Remove noctty flag.Jim Meyering
(main): Always use O_NOCTTY when opening files.
2004-04-08(set_fd_flags): Undo part of today's change: it's a littleJim Meyering
cleaner -- and more efficient in the common case -- to go ahead and OR in the -1 when fcntl fails.
2004-04-08(dd_copy): Mark two diagnostics for translations.Jim Meyering
2004-04-08(LONGEST_SYMBOL): Tweak comment.Jim Meyering
2004-04-08(set_fd_flags): Don't OR in -1 when fcntl fails.Jim Meyering
Rename parameter, flags, to avoid shadowing global.
2004-04-08New dd conv= symbols nocreat, excl, fdatasync, fsync,Jim Meyering
and new dd options iflag= and oflag=. (usage): Document. (fdatasync) [!HAVE_FDATASYNC]: New macro. (C_NOCREAT, C_EXCL, C_FDATASYNC, C_FSYNC): New macros. (input_flags, output_flags): New vars. (LONGEST_SYMBOL): New macro. (struct symbol_value): Renamed from struct conversion. Members symbol and value renamed from convname and conversion. The symbol value is now an array instead of a pointer; this saves a bit of space and time in practice. All uses changed. (conversions): Add nocreat, excl, fdatasync, fsync. Now const. (flags): New constant array. (iflag_error_msgid, oflag_error_msgid): New constants. (parse_symbols): Renamed from parse_conversion and generalized to handle either conversion or flag symbols. (scanargs): Adjust uses of parse_symbols accodingly. Add support for iflag= and oflag=. Reject attempts to use both excl and nocreat. (set_fd_flags): New function. (dd_copy): Just return X rather than calling quit (X), since our caller invokes quit with the returned value. Add support for fdatasync and fsync. (main): Add support for iflags=, oflags=, and new conv= symbols.
2004-01-21(usage): Use EXIT_SUCCESS, not 0, for clarity.Jim Meyering
(dd_copy): Exit with status EXIT_FAILURE, not 2, on errors. (write_output, skip, dd_copy): Don't assume EXIT_FAILURE == 1, as POSIX doesn't require it.
2003-12-20(apply_translations): Don't prohibit conv=unblock,sync.Jim Meyering
2003-11-05Cast NULL to `(char *)' in call to variadic function,Jim Meyering
parse_long_options, so that it works even on systems for which sizeof char* != sizeof int.
2003-10-18Most .c files (AUTHORS): Revert the WRITTEN_BY/AUTHORS changeJim Meyering
of 2003-09-19. Now, AUTHORS is a comma-separated list of strings. Update the call to parse_long_options so that `AUTHORS, NULL' are the last parameters. * src/true.c (main): Append NULL to version_etc argument list. * src/sys2.h (case_GETOPT_VERSION_CHAR): Likewise.
2003-09-18(WRITTEN_BY): Rename from AUTHORS.Jim Meyering
Begin each WRITTEN_BY string with `Written by ' and end it with `.'. Mark each WRITTEN_BY string as translatable.
2003-09-18revert previous changeJim Meyering
2003-09-18Update AUTHORS definition to be a comma-separated list of strings and/or updateJim Meyering
the call to parse_long_options so that `AUTHORS, NULL' are the last parameters.
2003-07-25(usage): Document the fact that SIGUSR1 makes ddJim Meyering
output its current record counts. Reported by Jurriaan.
2003-07-23Don't include headers already included by system.h:Jim Meyering
Don't include closeout.h.
2003-06-17(main): Call initialize_main.Jim Meyering
2003-05-14(usage): Don't use `,' as the thousands separatorJim Meyering
in e.g. 1,000,000 and 1,048,576. Instead, do this: `SIZE may be ..., MB 1000*1000, M 1024*1024 and so on...'
2002-11-10(interrupt_handler): Use raise, rather than kill+getpid.Jim Meyering
2002-11-05(print_stats, main):Jim Meyering
Use primitives from inttostr.h, not human.h, to print large numbers simply.
2002-10-06(scanargs): Ensure that specified block sizes (specifiedJim Meyering
via ibs=N, obs=N, and bs=N) are no larger than SSIZE_MAX. (skip, dd_copy): Adapt to new safe_read ABI.
2002-09-22Remove all inclusions of inttypes.h,Jim Meyering
since it's already included from sys2.h via system.h.
2002-09-14(main, skip): Add casts to avoid warnings aboutJim Meyering
`comparison between signed and unsigned'.
2002-08-31Change `exit (0)' to `exit (EXIT_SUCCESS)',Jim Meyering
`exit (1)' to `exit (EXIT_FAILURE)', and `usage (1)' to `usage (EXIT_FAILURE)'.
2002-08-30Change `error (1, ...' to `error (EXIT_FAILURE, ...'.Jim Meyering
2002-07-02(usage): Use the PACKAGE_BUGREPORT e-mail address, rather than hard-coding it.Jim Meyering
2002-04-25Avoid warnings from gcc.Jim Meyering
Declare input_file and output_file to be `const'. (skip): Declare `file' parameter to be `const', too.
2001-12-21(usage, parse_integer): Prefer K to k for 1024.Jim Meyering
2001-12-11(buggy_lseek_support): Remove function.Jim Meyering
(skip_via_lseek) [__linux__]: New function. (skip): Use skip_via_lseek, not buggy_lseek_support.
2001-12-02Use new macros, HELP_OPTION_DESCRIPTION and VERSION_OPTION_DESCRIPTIONJim Meyering
instead of hard-coding --help and --version descriptions.
2001-12-02Don't emulate dd's skip=N for *all* character devices; lseek worksJim Meyering
just fine on non-tape character devices like /dev/mem and /dev/kmem. (buggy_lseek_support) [__linux__]: Emulate `skip=N' behavior using reads, not lseek for Linux tape devices (major == 9). Kernel lseek support for tapes is broken, up to and including linux-2.4.16. Reported by Herbert Xu.
2001-11-23Split usage strings so that --help and --versionJim Meyering
descriptions are alone in their own string.
2001-11-23(usage): Split --help output into smaller pieces.Jim Meyering
Use fputs, not printf.
2001-10-24Remove as many instances of 'unsigned' asJim Meyering
possible, as some of them were not conforming to ANSI C, and they made the code hard to read. Avoiding 'unsigned' cuts down on the number of casts. (newline_character, space_character, save_char): Now char, not unsigned char. (obuf): Now char *, not unsigned char *. (ascii_to_ebcdic, ascii_to_ibm, ebcdic_to_ascii): Now char[], not unsigned char[]. (translate_charset, translate_buffer, swab_buffer, skip, copy_simple, copy_with_block, copy_with_unblock): Arg now points to char, not unsigned char. All callers changed. (translate_charset, parse_conversion, apply_translations): Use int index, not unsigned int. (bit_count): Arg is now int, not unsigned int. Callers not changed, as they already assumed this. (translate_buffer): Cast char to unsigned char before using it as a subscript. (swab_buffer): Returns char *, not unsigned char *. (dd_copy): Use char, not unsigned char, for buffers. Use size_t for possibly-large index, not unsigned int.
2001-08-31Include full-write.h.Jim Meyering
(full_write): Remove decl; not needed. (open_fd): Don't assume read and write size fits in int.
2001-08-14(AUTHORS): Mark string for translation, since it contains the English word ↵Jim Meyering
`and'.
2001-04-23(dd_copy): When using sync with either block or unblock,Jim Meyering
pad with spaces.
2001-04-22fix typo in --help outputJim Meyering
2001-04-22(usage): Mention that sync makes dd pad with spaces (rather than NULs)Jim Meyering
when used with block or unblock.
2001-03-06(S_TYPEISSHM): Rename parameter to reflect its type.Jim Meyering
(main): Pass a `struct stat *', not stat.st_mode to S_TYPEISSHM.
2001-03-04(output_char): Reformat so each statement is on a separate line.Jim Meyering
2001-01-17(main): Likewise.Jim Meyering
2000-12-02(skip, dd_copy): Use ssize_t to store result ofJim Meyering
safe_read, to avoid overflow e.g. on 64-bit Solaris sparc. (dd_copy): Remove unnecessary cast.
2000-12-02Undo most of the changes since 2000-11-24, since we'veJim Meyering
documented a standard way to do it. (skip_bytes, seek_bytes): Remove. (usage): Remove B suffix. (scanargs, skip, dd_copy, main): Remove support for B suffix.
2000-11-26(skip): Perform the `records < blocksize' testJim Meyering
at the top of the loop, not at the bottom.
2000-11-26(skip): New arg COUNT_BYTES. Read with BLOCKSIZEJim Meyering
bytes, but consider RECORDS to be a byte count if COUNT_BYTES is nonzero.
2000-11-26(skip_bytes, seek_bytes): Now booleans, not counts.Jim Meyering
(seek_records): Renamed from seek_record, for consistency with skip_records and max_records. All uses changed. (usage, scanargs): Remove bseek=n and bskip=n; instead, use seek=nB and skip=nB. (enum Unit, Unit): Remove. (skip, dd_copy, main): Undo most recent change. (dd_copy, main): Pass blocksize of 1 as appropriate when skip_bytes or seek_bytes is nonzero. (main): Rework ftruncate failure diagnostic to always use byte count.
2000-11-25more post-merge clean-up.Jim Meyering
Fix a merge bug exposed by new test.
2000-11-25remove bskipJim Meyering
adapt skip to skip either by bytes or by blocks
2000-11-25(S_TYPEISSHM): New macro.Jim Meyering
(main): Report failed fstat. Complain only when ftruncate fails on a regular file, a directory, or a shared memory object.