From owner-freebsd-hackers@FreeBSD.ORG Sat Oct 25 08:13:07 2008 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 615421065682 for ; Sat, 25 Oct 2008 08:13:07 +0000 (UTC) (envelope-from jdc@koitsu.dyndns.org) Received: from QMTA06.emeryville.ca.mail.comcast.net (qmta06.emeryville.ca.mail.comcast.net [76.96.30.56]) by mx1.freebsd.org (Postfix) with ESMTP id 430368FC14 for ; Sat, 25 Oct 2008 08:13:07 +0000 (UTC) (envelope-from jdc@koitsu.dyndns.org) Received: from OMTA07.emeryville.ca.mail.comcast.net ([76.96.30.59]) by QMTA06.emeryville.ca.mail.comcast.net with comcast id WwAA1a0051GXsucA6wD6pd; Sat, 25 Oct 2008 08:13:06 +0000 Received: from koitsu.dyndns.org ([69.181.141.110]) by OMTA07.emeryville.ca.mail.comcast.net with comcast id WwD51a0052P6wsM8TwD6gC; Sat, 25 Oct 2008 08:13:06 +0000 X-Authority-Analysis: v=1.0 c=1 a=Gia_n1T2EukA:10 a=q0bofQMocTIA:10 a=QycZ5dHgAAAA:8 a=Ji1h3VfYJHYNj2sNrvwA:9 a=Nr8YgLJMuuMBNKjT8jRQhoHBDCcA:4 a=EoioJ0NPDVgA:10 a=LY0hPdMaydYA:10 Received: by icarus.home.lan (Postfix, from userid 1000) id A1EFDC9419; Sat, 25 Oct 2008 01:13:05 -0700 (PDT) Date: Sat, 25 Oct 2008 01:13:05 -0700 From: Jeremy Chadwick To: en0f Message-ID: <20081025081305.GA55683@icarus.home.lan> References: <539c60b90810241534l6bedc5e3s1c2e3162c2a7ff38@mail.gmail.com> <4902CC86.8030408@bokey.mine.nu> <20081025075648.GB55339@icarus.home.lan> <4902D1FA.3070003@bokey.mine.nu> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4902D1FA.3070003@bokey.mine.nu> User-Agent: Mutt/1.5.18 (2008-05-17) Cc: freebsd-hackers Subject: Re: neophyte: tcsetattr() gives 22 error in i386, not in amd64? X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 25 Oct 2008 08:13:07 -0000 On Sat, Oct 25, 2008 at 06:29:54PM +1030, en0f wrote: > Jeremy Chadwick wrote: > > On Sat, Oct 25, 2008 at 06:06:38PM +1030, en0f wrote: > >> Nate Eldredge wrote: > >>> 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. > >> Strange freebsd doesnt document error numbers. On POSIX, errno 22 is > >> EINVAL as well (documented in errno(3)). Is this applicable to freebsd? > > > > /usr/include/errno.h isn't documentation of error numbers? > > Gahhhhh! But Jeremy, I dont have magic brains to work me way out of > source code :) You're confusing me. :P The errors in errno.h are commented, and it's quite readable. Of course, it matches what's in errno(3). If you're wanting to track down how/why tcsetattr(3) results in EINVAL, using truss or ktrace might come in handy. Otherwise, you literally will have to throw some debugging code into the ucom(4) driver to try and figure out what function is kicking out code 22. -- | Jeremy Chadwick jdc at parodius.com | | Parodius Networking http://www.parodius.com/ | | UNIX Systems Administrator Mountain View, CA, USA | | Making life hard for others since 1977. PGP: 4BD6C0CB |