Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!romp!auschs!d75!awdprime!sandino.austin.ibm.com!jeffe From: jeffe@sandino.austin.ibm.com (Peter Jeffe 512.823.4091) Newsgroups: comp.unix.programmer Subject: Re: binding sockets Message-ID: <3580@awdprime.UUCP> Date: 19 Sep 90 18:26:29 GMT References: <1990Sep16.183730.18698@athena.mit.edu> <26618@mimsy.umd.edu> Sender: news@awdprime.UUCP Organization: IBM AWD, Austin, TX Lines: 16 In article <26618@mimsy.umd.edu> chris@mimsy.umd.edu (Chris Torek) writes: >In article <1990Sep16.183730.18698@athena.mit.edu> >jik@athena.mit.edu (Jonathan I. Kamens) writes: >> No, actually, the namelen parameter one passes to bind() should be the >>sizeof the sockaddr structure being passed into it ... > >Well, it `should' be 2+strlen(path), or (in 4.3BSD-reno) SUN_LEN: Not to quibble, but it `should' be "sizeof(name.sun_family)+strlen(path)"; or better yet, "sizeof(name)-sizeof(name.sun_path)+strlen(path)"; in any case, assuming the 2 bytes is not a good idea. ------------------------------------------------------------------------------- Peter Jeffe ...uunet!cs.utexas.edu!ibmaus!auschs!sandino.austin.ibm.com!jeffe first they want a disclaimer, then they make you pee in a jar, then they come for you in the night