delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2008/08/19/10:28:47

X-Recipient: archive-cygwin AT delorie DOT com
X-Spam-Check-By: sourceware.org
MIME-Version: 1.0
Subject: ioctl in cygwin
Date: Tue, 19 Aug 2008 09:27:59 -0500
Message-ID: <E05F1FD208D5AA45B78B3983479ECF08023EC2FC@saturn.p3corpnet.pivot3.com>
In-Reply-To: <1KVLws-1iowvw0@fwd25.aul.t-online.de>
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>
From: "Chen, Lihong" <Lihongc AT pivot3 DOT com>
To: <cygwin AT cygwin DOT com>
X-IsSubscribed: yes
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Unsubscribe: <mailto:cygwin-unsubscribe-archive-cygwin=delorie DOT com AT cygwin DOT com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
X-MIME-Autoconverted: from quoted-printable to 8bit by delorie.com id m7JESjR8008812

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.

Lihong

--
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 -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019