lkml.org 
[lkml]   [1996]   [Dec]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectSerial Patch


/*

I installed the latest tty patch. The call to open a non-existant
terminal device no longer crashes. However, it now returns a valid
handle even if the device does not exist. In this example, there
are only TWO RS-232C ports on this machine! An attempt to open
/dev/cua3 should return with -1 and the error set to something appropriate.

Interesting that it returns -1 with /dev/cua4, however. I checked to
see if there was, perhaps, a "motherboard UART" that I didn't know about.

UARTs exist at 0x2f8 and 0x3f8 only on this machine.


*/

#include <stdio.h>
#include <unistd.h>
#include <errno.h>
#include <sys/fcntl.h>

main()
{
int fd;

fd = open("/dev/cua3", O_RDWR|O_NONBLOCK, 0);
fprintf(stdout, "Open() returned %d, (%s)\n", fd, strerror(errno));
return 0;
}



Cheers,
Dick Johnson
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Richard B. Johnson
Project Engineer
Analogic Corporation
Voice : (508) 977-3000 ext. 3754
Fax : (508) 532-6097
Modem : (508) 977-6870
Ftp : ftp@boneserver.analogic.com
Email : rjohnson@analogic.com, johnson@analogic.com
Penguin : Linux version 2.1.15 on an i586 machine.
Warning : It's hard to remain at the trailing edge of technology.
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-


\
 
 \ /
  Last update: 2005-03-22 13:38    [W:0.036 / U:0.888 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site