X-Recipient: archive-cygwin AT delorie DOT com X-Spam-Check-By: sourceware.org Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Subject: RE: ioctl in cygwin Date: Tue, 19 Aug 2008 10:38:09 -0500 Message-ID: In-Reply-To: <20080819151356.GF1738@ednor.casa.cgf.cx> References: <1KV3KS-06K7k00 AT fwd26 DOT aul DOT t-online DOT de> <20080819030025 DOT GA4204 AT ednor DOT casa DOT cgf DOT cx> <20080819032227 DOT GC4204 AT ednor DOT casa DOT cgf DOT cx> <1KVLws-1iowvw0 AT fwd25 DOT aul DOT t-online DOT de> <20080819151356 DOT GF1738 AT ednor DOT casa DOT cgf DOT cx> From: "Chen, Lihong" To: X-IsSubscribed: yes Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: 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 Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by delorie.com id m7JFd6nq019822 Thanks, Christopher. This is my first time post a message, I appreciate your guidance and support. I will try to do better next time I post my message. If you have any suggestions, please feel free to let me know. Thanks again. -----Original Message----- From: Christopher Faylor [mailto:cgf-use-the-mailinglist-please AT cygwin DOT com] Sent: Tuesday, August 19, 2008 10:14 AM To: cygwin AT cygwin DOT com Subject: Re: ioctl in cygwin On Tue, Aug 19, 2008 at 09:27:59AM -0500, Chen, Lihong wrote: >Hi, >I need to be able to open a device using the POSIX reference in Cygwin >and issue IOCTL calls to it. SCSI commands specifically. > >The following is some code: > >struct sg_io_hdr io_hdr; > > int fd = open("/dev/sdc", O_RDWR); > > ret = ioctl(fd, SG_IO, &io_hdr); > > >I put in my own sg_io_hdr in the file which I copied from the sg.h. > >I had return code = -1 which is error. > >Could someone please give me some ideas about how to do this right. >Thanks. 1) Please don't piggyback on an ongoing email thread. 2) If the ioctl value that you need isn't already in the system headers that means that it isn't implemented. Copying the value from some other system is not going to work. cgf -- 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/ -- 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/