neophyte: tcsetattr() gives 22 error in i386, not in amd64?

Nate Eldredge neldredge at math.ucsd.edu
Fri Oct 24 23:30:36 UTC 2008


On Fri, 24 Oct 2008, Steve Franks wrote:

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

I don't see anything obviously wrong, but I'd bet a bug related to 
32/64-bit types.  Can you post a complete piece of code that can be 
compiled and run and demonstrates the problem?  Also, try compiling with 
-Wall -W and investigate any warnings that are produced.

By the way, errno 22 is EINVAL, "Invalid argument".  perror() is your 
friend.

[snip code]

-- 

Nate Eldredge
neldredge at math.ucsd.edu


More information about the freebsd-hackers mailing list