This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]