Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.1 6/24/83; site philabs.UUCP Path: utzoo!linus!philabs!dal From: dal@philabs.UUCP (Dan Lorenzini) Newsgroups: net.unix-wizards,net.bugs.4bsd Subject: Socket(2) problems (who has a fix ?) Message-ID: <27560@philabs.UUCP> Date: Tue, 28-Aug-84 11:25:30 EDT Article-I.D.: philabs.27560 Posted: Tue Aug 28 11:25:30 1984 Date-Received: Thu, 30-Aug-84 08:43:33 EDT Organization: Philips Labs, Briarcliff Manor, NY Lines: 39 We are Philips Research Laboratory of Brussels, we are not (yet) on Usenet but we can thanks to the amiability of Dan Lorenzini of philabs post it to the net. Apparently, 4.2 hangs when: - a socket(2) is select(2)ed for accept(2) - another process does a connect(2) - the server exits before accepting the connect request Just run the following program: #include #include #define SOCKET "/tmp/sck" struct sockaddr sa={AF_UNIX,SOCKET}; int s,m,d; main() { unlink(SOCKET); if ((s = socket(AF_UNIX , SOCK_STREAM , 0)) < 0) perror("socket"); if (bind(s, &sa, 10) < 0) perror("bind"); if (listen(s, 1) < 0) perror("listen"); if (fork() == 0) { d = socket(AF_UNIX , SOCK_STREAM , 0); if (d < 0) perror("child socket"); if (connect(d, &sa, 10) < 0) perror("connect"); sleep(10); } m = 1 << s; if (select(20, &m, 0, 0, 0) < 0) perror("select"); exit(0); } ---------------------------------------------------------------------------- Please answer by mail. We can be reached by mail at the following addresses : ...!philabs!prlb2!heymans ...!decvax!cca!prlb2!heymans Franz Heymans