From owner-freebsd-net Sun Nov 21 7:25: 4 1999 Delivered-To: freebsd-net@freebsd.org Received: from mailman.zeta.org.au (mailman.zeta.org.au [203.26.10.16]) by hub.freebsd.org (Postfix) with ESMTP id 8434514D0E; Sun, 21 Nov 1999 07:24:56 -0800 (PST) (envelope-from bde@zeta.org.au) Received: from p100-ts5.syd2.zeta.org.au (beefcake.zeta.org.au [203.26.10.12]) by mailman.zeta.org.au (8.8.7/8.8.7) with ESMTP id CAA15065; Mon, 22 Nov 1999 02:31:58 +1100 Date: Mon, 22 Nov 1999 02:24:32 +1100 (EST) From: Bruce Evans X-Sender: bde@alphplex.bde.org To: Jeroen Ruigrok/Asmodai Cc: Assar Westerlund , net@FreeBSD.org, cvs-committers@FreeBSD.org Subject: Re: Patches for socket.h In-Reply-To: <19991121141950.F48139@daemon.ninth-circle.org> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-net@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org On Sun, 21 Nov 1999, Jeroen Ruigrok/Asmodai wrote: > -On [19991121 04:00], Assar Westerlund (assar@sics.se) wrote: > >Jeroen Ruigrok/Asmodai writes: > > > >> One caveat for now is the sa_family_t type, which would be the type for > >> sa_family in the sockaddr struct. > > > >typedef u_char sa_family_t or is it more complicated than that? > > Sorry for not correctly answering it last night. > > No, that's not it. > > According to SUSv2: > > The header defines the unsigned integral type > sa_family_t. > > So there will be a typedef unsigned int sa_family_t; and not of u_char. integral != int. u_char is unsigned integral. `unsigned int' is consintently (mis)spelled `u_int' in . > Wrt socklen_t, the spec wants it to be at least 32 bits in size, so I > could choose it to be u_int32_t or unsigned int, I am still somewhat in > doubt what to prefer. For now I settled on POSIX compliant types. It has to be u_int32_t or u_long to meet the spec. u_int is only guaranteed to be 16 bits by POSIX and/or ISO C. The spec requires changing int to an unsigned integral type in many places. This may cause sign extension bugs. Bruce To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-net" in the body of the message