Re: 2.4.0-test10 truncate() change broke `dd'

2000-11-17 Thread Andries Brouwer
On Thu, Nov 16, 2000 at 03:02:31AM -0500, Alexander Viro wrote: : On Thu, 16 Nov 2000, Mikael Pettersson wrote: : :: dd implements the seek=NNN option by calling ftruncate() before :: starting the write. This is where 2.4.0-test10 breaks, since :: ftruncate on a block device now provokes an EACCE

Re: 2.4.0-test10 truncate() change broke `dd'

2000-11-16 Thread Andries Brouwer
On Thu, Nov 16, 2000 at 06:53:30AM -0500, Alexander Viro wrote: > > I didn't know about notrunc. Yet another GNU invention? > > Maybe, but I doubt it. Anyway, it made its way into 4.4BSD, it's present > in Solaris, it's in SuS and AFAIK in POSIX. Yes (for 1003.2-1992). It is not in 4.3BSD. - To

Re: 2.4.0-test10 truncate() change broke `dd'

2000-11-16 Thread Alexander Viro
On Thu, 16 Nov 2000, Mikael Pettersson wrote: > On Thu, 16 Nov 2000, Alexander Viro wrote: > > > And what kind of meaning would you assign to truncate on floppy? > > On a block or char device, truncate == lseek seems reasonable. Huh? On regular files ftruncate() doesn't modify the current po

Re: 2.4.0-test10 truncate() change broke `dd'

2000-11-16 Thread Mikael Pettersson
On Thu, 16 Nov 2000, Alexander Viro wrote: > And what kind of meaning would you assign to truncate on floppy? On a block or char device, truncate == lseek seems reasonable. My guess is that dd uses ftruncate because that's correct for regular files and has happened to also work (as an alias for

Re: 2.4.0-test10 truncate() change broke `dd'

2000-11-15 Thread Alexander Viro
On Thu, 16 Nov 2000, Mikael Pettersson wrote: > I noticed because I needed to build a boot floppy with an > initial ram disk under 2.4.0-test11pre5. The standard recipe > (Documentation/ramdisk.txt) basically goes: > - dd if=bzImage of=/dev/fd0 bs=1k > notice how many blocks dd reported (NNN)