Re: Floppy disk strange behavior

From: Alan Cox (alan@lxorguk.ukuu.org.uk)
Date: Tue Jan 09 2001 - 16:37:07 EST


> dd bug. It tries to ftruncate() the output file and gets all upset when
> kernel refuses to truncate a block device (surprise, surprise).

Standards compliant but unexpected.

> Basically, dd(1) expects kernel to fake success for ftruncate() on the
> things that can't be truncated. Bad idea. 2.2 didn't bother to report

Actually its explicitly mentioned by the spec that truncate _may_ extend
a file but need not do so.

> Try to build GNU dd on other Unices and you will be able to trigger that
> bug on quite a few of them.

I think not

> ftruncate(2) is _not_ supposed to succeed on anything other than regular
> files. I.e. dd(1) should not call it and expect success if file is not
> regular. Plain and simple...

2.2 is least suprise 2.4 is most information, but misleading errno IMHO

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Mon Jan 15 2001 - 21:00:23 EST