From mboxrd@z Thu Jan 1 00:00:00 1970 From: Mike Waychison Date: Thu, 05 Feb 2004 02:08:08 +0000 Subject: Re: [PATCH] convert udevsend/udevd to using datagram sockets Message-Id: <4021A588.6060306@sun.com> List-Id: References: <40209893.8080109@sympatico.ca> In-Reply-To: <40209893.8080109@sympatico.ca> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: linux-hotplug@vger.kernel.org Chris Friesen wrote: > Mike Waychison wrote: > >> The addrlen parameter should still be sizeof(saddr), regarless of the >> contents of the abstract namespace address. The same would go for >> the sendto command. > > > Do you have any definitive references for this? I don't have any > references at home, but this style is all over the web. If you give > it the full length, then you waste time passing a bunch of zeros to > the kernel and then hashing over them. As long as the length is the > same on both sides, it should work just fine, no? I stand corrected and indeed, this is the method used all over the internet (heck, even docs.sun.com documents it as sizeof(addr.sun_family) + strlen(addr.sun_path)). I guess I'm so used to seeing sizeof(addr) in connects and binds that I took it for a hard rule. Another thing that I wasn't clear on when I posted was that I assumed that the abstract namespace used all 108 bytes of sun_path. I've tested this and you are right in that the length does infact differentiate the names. Sorry 'bout that :) -- Mike Waychison Sun Microsystems, Inc. 1 (650) 352-5299 voice 1 (416) 202-8336 voice mailto: Michael.Waychison@Sun.COM http://www.sun.com ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ NOTICE: The opinions expressed in this email are held by me, and may not represent the views of Sun Microsystems, Inc. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ------------------------------------------------------- The SF.Net email is sponsored by EclipseCon 2004 Premiere Conference on Open Tools Development and Integration See the breadth of Eclipse activity. February 3-5 in Anaheim, CA. http://www.eclipsecon.org/osdn _______________________________________________ Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net Linux-hotplug-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel