From owner-freebsd-questions@FreeBSD.ORG Wed Mar 2 22:26:30 2005 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id EFFBE16A4CE for ; Wed, 2 Mar 2005 22:26:30 +0000 (GMT) Received: from web54002.mail.yahoo.com (web54002.mail.yahoo.com [206.190.36.226]) by mx1.FreeBSD.org (Postfix) with SMTP id 5D8D743D31 for ; Wed, 2 Mar 2005 22:26:30 +0000 (GMT) (envelope-from pm940@yahoo.com) Received: (qmail 82199 invoked by uid 60001); 2 Mar 2005 22:26:29 -0000 Comment: DomainKeys? See http://antispam.yahoo.com/domainkeys DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; b=UE9jhUCRTaCwgY51MM/JOSy63OfzDkZyHBdPeZju5/NOR7O7moZKCWhkKwgwWSPB2U/9ksjAeu3VZBvU5YtLOo4YhQZ50rLV5UBN4GqhNOcUbDwZrJMnNVgf2lzRxH0HSvVGuEQiqPlzz90Z+NSPptLQnqrDdpEhWlYysMcYIrk= ; Message-ID: <20050302222629.82196.qmail@web54002.mail.yahoo.com> Received: from [69.237.122.17] by web54002.mail.yahoo.com via HTTP; Wed, 02 Mar 2005 14:26:29 PST Date: Wed, 2 Mar 2005 14:26:29 -0800 (PST) From: Nine Forty To: freebsd-questions@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Subject: SUN_LEN(addr) vs. SUN_LEN(addr) + 1. X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 02 Mar 2005 22:26:31 -0000 /usr/include/sys/un.h says: /* * Definitions for UNIX IPC domain. */ struct sockaddr_un { u_char sun_len; /* sockaddr len including null */ u_char sun_family; /* AF_UNIX */ char sun_path[104]; /* path name (gag) */ }; ... but it also says: /* actual length of an initialized sockaddr_un */ #define SUN_LEN(su) \ (sizeof(*(su)) - sizeof((su)->sun_path) + strlen((su)->sun_path)) Which doesn't include the nul at the end of sun_path. When calling bind(2) or sendmsg(2), is SUN_LEN(addr) valid, or should it be SUN_LEN(addr) + 1? Various programs under /usr/src use plain SUN_LEN(addr). Is there a problem with the comment, the macro, the applications, or none of the above? Thanks. __________________________________ Celebrate Yahoo!'s 10th Birthday! Yahoo! Netrospective: 100 Moments of the Web http://birthday.yahoo.com/netrospective/