bind(2) in bsd4.2 UNIX

Jay Roth jayr at well.UUCP
Sun Jan 5 07:26:21 AEST 1986


I have created a socket as:

	s = socket(AF_UNIX, SOCK_DGRAM, 0)

and now I'd like to name it.  However, there is some discrepancy between
the manual and the 4.2bsd Interprocess Communication Primer DRAFT (7/27/83).
The manual indicates that bind should take these args:

	struct sockaddr *name;
	...
	bind(s, name, namelen);

And the Primer says:

	bind(s, "/dev/foo", sizeof("/dev/foo") - 1);

This leads to 2 qns: 1) Which is right (I have tried both, and the manual
seems to be right, at least in my implementation) and 2) If the manual is
right, how can you specify socket names longer than the size specified in
sa_data field of the sockaddr structure?



More information about the Comp.unix mailing list