truncate() error values (was Re: Floppy disk strange behavior)

2001-01-09 Thread Alexander Viro
On Wed, 10 Jan 2001 [EMAIL PROTECTED] wrote: > >> dd: advancing past 1 blocks in output file `/dev/fd0': Permission denied > > > dd bug. It tries to ftruncate() the output file and gets all upset when > > kernel refuses to truncate a block device (surprise, surprise). > > Yes. But EPERM means

Re: Floppy disk strange behavior

2001-01-09 Thread Alan Cox
> * dd(1) portability bug. Obviously there - ftruncate(2) is allowed > to fail on non-regular ones. Fix is trivial and it (or something equivalent) > should go into the fileutils. > * What should 2.4 do here? I would prefer -EINVAL - it is true > (requested action is invalid for the ar

Re: Floppy disk strange behavior

2001-01-09 Thread Andries . Brouwer
>> dd: advancing past 1 blocks in output file `/dev/fd0': Permission denied > dd bug. It tries to ftruncate() the output file and gets all upset when > kernel refuses to truncate a block device (surprise, surprise). Yes. But EPERM means that something is wrong with privileges. One would expect E

Re: Floppy disk strange behavior

2001-01-09 Thread Mathieu Chouquet-Stringer
Ok, I emailed [EMAIL PROTECTED] and got this response from Jim Meyering <[EMAIL PROTECTED]>: Thanks for the report. That's fixed in the latest test release. ftp://alpha.gnu.org/gnu/fetish/fileutils-4.0.35.tar.gz It's fixed in 4.0.33, too. [EMAIL PROTECTED] (Alexander Viro) writes: > On Tue,

Re: Floppy disk strange behavior

2001-01-09 Thread Alexander Viro
On Tue, 9 Jan 2001, Alan Cox wrote: > > 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. dd is supposed to be portable. On Solaris: % man ftruncate [snip]

Re: Floppy disk strange behavior

2001-01-09 Thread Alan Cox
> 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.

Re: Floppy disk strange behavior

2001-01-09 Thread Alexander Viro
On 9 Jan 2001, Mathieu Chouquet-Stringer wrote: > I use GRUB to boot my system. Basically, when you want to install GRUB on a > floppy disk, you do that: > > dd if=stage1 of=/dev/fd0 bs=512 count=1 > dd if=stage2 of=/dev/fd0 bs=512 seek=1 > > But since kernel 2.3.xx (I don't remember exactly)

Floppy disk strange behavior

2001-01-09 Thread Mathieu Chouquet-Stringer
Hi! I have switched a long time ago to linux-2.4 (and even 2.3 series) and I have a wierd problem. I use GRUB to boot my system. Basically, when you want to install GRUB on a floppy disk, you do that: dd if=stage1 of=/dev/fd0 bs=512 count=1 dd if=stage2 of=/dev/fd0 bs=512 seek=1