binding sockets
Peter Jeffe 512.823.4091
jeffe at sandino.austin.ibm.com
Thu Sep 20 04:26:29 AEST 1990
In article <26618 at mimsy.umd.edu> chris at mimsy.umd.edu (Chris Torek) writes:
>In article <1990Sep16.183730.18698 at athena.mit.edu>
>jik at 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
More information about the Comp.unix.programmer
mailing list