Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.1 6/24/83 (MC830919); site haring.UUCP Path: utzoo!linus!security!genrad!decvax!mcvax!haring!jim From: jim@haring.UUCP (Jim McKie) Newsgroups: net.unix-wizards Subject: Re: UNIX domain addressing for 4.2bsd IPC Message-ID: <109@haring.UUCP> Date: Sat, 10-Dec-83 21:07:44 EST Article-I.D.: haring.109 Posted: Sat Dec 10 21:07:44 1983 Date-Received: Tue, 13-Dec-83 02:00:37 EST References: <170@ut-ngp.UUCP> Organization: CWI, Amsterdam Lines: 26 Here is a sample fragment of code which does the trick, the IPC primer is wrong. .... #include #include #include #define SOCKET "NameOfSomeFile" .... struct sockaddr_un socket; .... socket.sun_family = AF_UNIX; sprintf(socket.sun_path, "%s", SOCKET); if((s = socket(AF_UNIX, SOCK_DGRAM, 0)) == -1){ perror("program: socket"); exit(1); } (void) unlink(socket.sun_path); if(bind(s, &socket, strlen(socket.sun_path)+2) == -1){ perror("program: bind"); exit(1); } .... Jim McKie Mathematisch Centrum, Amsterdam ....mcvax!jim