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]

IOCTL using <ddk/ntddser.h>


When compiled on Cygwin's gcc the code below (which asks the baud rate of a
serial port) shows the error "Funtion Not Implemented".

I tried several serial port ioctl functions in <ddk/ntddser.h> - all gave the
same error.  


I hope I'm doing something really dumb, any tips?


#include <stdio.h>	
#include <fcntl.h>  		
#include <sys/ioctl.h>			
#include <ddk/ntddser.h>	

int main() {

  int fd, result; 
  SERIAL_BAUD_RATE x; /* baud rate structure in ntddser.h */

  fd = open ( "/dev/com4" , O_RDWR | O_NOCTTY | O_NDELAY);
  if ( fd<0 ) { perror ("Can't open port - "); exit(-1); }

  result=ioctl(fd,IOCTL_SERIAL_GET_BAUD_RATE,&x,sizeof(x));

  if(result<0){perror("IOCTL failed because "); exit(-1);}

  else printf ( "Baud rate is %d.\n", result, x.BaudRate );
}




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