summaryrefslogtreecommitdiffstats
path: root/bin/dd/position.c
Commit message (Collapse)AuthorAgeFilesLines
* WARNS=4 fixes. This would be WARNS=9 if we were -std=99 instead ofmarkm2003-02-271-0/+1
| | | | | | -ansi, due to 'long long'. Reviewed by: green (slightly earlier version)
* Consistently use __FBSDIDobrien2002-06-301-2/+2
|
* o __P has been reovedimp2002-02-021-2/+2
| | | | | | | | | | | 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)
* Allow negative seek offsets for files that can be seeked upon. Itgreen2000-10-221-0/+8
| | | | | 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-3/+7
| | | | | Also, check for ftruncate() return value and die on failure, but only try to ftruncate() when the file is a regular file.
* Make count=0 set cpy_cnt to -1, which is slight overloading, but makesgreen1999-09-161-1/+1
| | | | | | 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.
* Even more dd(1) cleanups! Thanks to Bruce for staying on my case untilgreen1999-09-131-4/+8
| | | | we're done (not yet!) :)
* ISDISK -> ISSEEKgreen1999-09-121-2/+2
| | | | 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-121-8/+6
| | | | | | | | | | | | | 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-2/+10
| | | | | 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
|
* Implement seekability for disk devices (not just regular files).green1999-07-131-8/+4
| | | | | | 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-201-2/+1
| | | | | | | | 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-8/+11
| | | | | off_t, int, u_int64_t, etc.). dd(1) should now work properly with REALLY big amounts of data.
* Restore Lite-2 sccsid. Restore include of sys/types.h.charnier1998-05-131-2/+3
|
* Correct use of .Nm and other cosmetics. Add rcsid. Remove unused #inc.charnier1998-05-061-7/+4
|
* Fixed overflow for attempts to seek to offsets > ULONG_MAX. See thebde1997-04-301-2/+2
| | | | | | OpenBSD version for more complete fixes. E.g., to seek to offsets > INT_MAX using a block size of 1, block numbers need to be off_t's instead of u_long's.
* 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
|
* Added $Id$dg1994-09-241-0/+2
|
* BSD 4.4 Lite bin Sourcesrgrimes1994-05-261-0/+166
OpenPOWER on IntegriCloud