UNIX domain addressing for 4.2bsd IPC

Mark Callow msc at qubix.UUCP
Sat Dec 10 05:20:21 AEST 1983


The "4.2 IPC Primer" is long out of date.  The correct syntax for
binding a name to a socket in the Unix domain is as follows:

struct sockaddr socketname = { AF_UNIX, { "/dev/foo" } };

bind(s, &socketname, sizeof( socketname ));

where struct sockaddr is declared as follows:

struct sockaddr {
	u_short	sa_family;		/* address family */
	char	sa_data[14];		/* up to 14 bytes of direct address */
};
-- 
>From the Tardis of Mark Callow
msc at qubix.UUCP,  decwrl!qubix!msc at Berkeley.ARPA
...{decvax,ucbvax,ihnp4}!decwrl!qubix!msc, ...{ittvax,amd70}!qubix!msc



More information about the Comp.unix.wizards mailing list