neophyte: tcsetattr() gives 22 error in i386, not in amd64?
Steve Franks
stevefranks at ieee.org
Fri Oct 24 22:34:32 UTC 2008
Hi,
I'm getting a 22 errno from tcsetattr() on 7-STABLE i386 in code which
was working under 7-STABLE amd64. Serial device is a ucom (silabs
cp2103). Permissions on /dev/cuaU0 look fine. Cutecom/Minicom
appears to open the port without error...
Ideas?
Thanks,
Steve
if(cfsetspeed(&IspEnvironment->newtio,(speed_t)
strtol(IspEnvironment->baud_rate,NULL,10))) {
DebugPrintf(1, "baudrate %s not supported\n",
IspEnvironment->baud_rate);
exit(3);
};
switch (atol(IspEnvironment->baud_rate))
{
case 1152000: NEWTERMIOS_SETBAUDARTE(B1152000); break;
default:
{
DebugPrintf(1, "unknown baudrate %s\n",
IspEnvironment->baud_rate);
exit(3);
}
}
IspEnvironment->newtio.c_iflag = IGNPAR | IGNBRK | IXON | IXOFF;
IspEnvironment->newtio.c_oflag = 0;
/* set input mode (non-canonical, no echo,...) */
IspEnvironment->newtio.c_lflag = 0;
cfmakeraw(&IspEnvironment->newtio);
IspEnvironment->newtio.c_cc[VTIME] = 1; /* inter-character
timer used */
IspEnvironment->newtio.c_cc[VMIN] = 0; /* blocking read
until 0 chars received */
tcflush(IspEnvironment->fdCom, TCIFLUSH);
int err = tcsetattr(IspEnvironment->fdCom, TCSANOW, &IspEnvironment->newtio);
More information about the freebsd-hackers
mailing list