Mail Archives: cygwin/2004/08/20/09:50:47
On Aug 20 14:56, Pim Zandbergen wrote:
> >>mt -f /dev/st0 setblk 16384
> >>dd if=/dev/zero of=/dev/st0 bs=16k count=1
Thanks for the simple testcase :-)
Actually we have two problems in one here.
The first is that your above `dd' statement should not work! See on
Linux:
$ mt setblk 16384
$ dd if=/dev/zero of=/dev/st0 bs=512 count=32
dd: writing `/dev/st0': Invalid argument
1+0 records in
0+0 records out
The reason is that writes on tape devices must always be in multiple of
the blocksize set in the device driver. So, only that should work:
$ dd if=/dev/zero of=/dev/st0 bs=16384 count=1
1+0 records in
1+0 records out
or, FWIW, that:
$ dd if=/dev/zero of=/dev/st0 bs=32768 count=1
1+0 records in
1+0 records out
Note that it's the same on Windows. WriteFile calls on raw devices must
write in multiples of the blocksize set in the device driver.
So far so good. Unfortunately, the first `dd' statement really didn't
return. I've debugged it and found that the low level tape write function
in Cygwin missed to return -1 on error. As a result, the write(2) call
returned 0 instead of -1 to the calling function in `dd', even though the
Win32 WriteFile call returned an ERROR_INVALID_PARAMETER. I've fixed that
in current CVS. So the next Cygwin version has the same behaviour as Linux:
$ dd if=/dev/zero of=/dev/st0 bs=512 count=32
dd: writing `/dev/st0': Invalid argument
1+0 records in
0+0 records out
$ dd if=/dev/zero of=/dev/st0 bs=16384 count=1
1+0 records in
1+0 records out
Again, thanks for the testcase,
Corinna
--
Corinna Vinschen Please, send mails regarding Cygwin to
Cygwin Project Co-Leader mailto:cygwin AT cygwin DOT com
Red Hat, Inc.
--
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
Problem reports: http://cygwin.com/problems.html
Documentation: http://cygwin.com/docs.html
FAQ: http://cygwin.com/faq/
- Raw text -