SunOS 3.5 dd (ibs == obs) != bs

Chris Torek chris at mimsy.UUCP
Thu Nov 10 21:47:56 AEST 1988


In article <37 at eplrx7.UUCP> mcneill at eplrx7.UUCP (mcneill) writes:
>I looked at the System V source for dd and saw something like:
>   if (bs) ibs = obs = bs;
>which leads me to believe that setting bs should do the same thing as 
>setting both ibs & obs.
>
>Does BSD do something different which makes this feature or did I miss
>something in the source.

You missed something in the source.  (Caveat: I am guessing that the
SV dd is based on the V7 dd.)  There is a flag called `fflag' that is
set by `bs=' but not by `ibs=' nor `obs='.  fflag causes dd to use
a `fast' loop, which preserves record boundaries on those files that
have records (pipes, sockets, ttys, tapes):

	while ((n = read(...)) > 0)
		(void) write(..., n);

while in other cases, dd completely fills its input buffer before
copying to its output.

Yes, the manual makes no attempt to explain this.
-- 
In-Real-Life: Chris Torek, Univ of MD Comp Sci Dept (+1 301 454 7163)
Domain:	chris at mimsy.umd.edu	Path:	uunet!mimsy!chris



More information about the Comp.unix.questions mailing list