Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com Date: Fri, 20 Aug 2004 15:51:05 +0200 From: Corinna Vinschen To: cygwin AT cygwin DOT com Subject: Re: 1.5.10-3 + mt 2.3 scsi tape problems Message-ID: <20040820135105.GB24367@cygbert.vinschen.de> Reply-To: cygwin AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com References: <4122275D DOT 6010101 AT macroscoop DOT nl> <20040817155426 DOT GN1689 AT cygbert DOT vinschen DOT de> <4124BD84 DOT 4020304 AT macroscoop DOT nl> <20040819154822 DOT GB10590 AT cygbert DOT vinschen DOT de> <4125F4E4 DOT 3010902 AT macroscoop DOT nl> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4125F4E4.3010902@macroscoop.nl> User-Agent: Mutt/1.4.2i 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/