IOCTL using <ddk/ntddser.h>

Bert dsboiz@gmail.com
Wed Mar 11 23:00:00 GMT 2009


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/



More information about the Cygwin mailing list