Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!swrinde!zaphod.mps.ohio-state.edu!usc!elroy.jpl.nasa.gov!forsight!jato!jpl-devvax!lwall From: lwall@jpl-devvax.JPL.NASA.GOV (Larry Wall) Newsgroups: comp.lang.perl Subject: Re: anybody getting joy from socketpair() ? Message-ID: <9320@jpl-devvax.JPL.NASA.GOV> Date: 28 Aug 90 22:10:15 GMT References: Reply-To: lwall@jpl-devvax.JPL.NASA.GOV (Larry Wall) Organization: Jet Propulsion Laboratory, Pasadena, CA Lines: 29 In article vixie@decwrl.dec.com (Paul A Vixie) writes: : This C program completes successfully: : : #define c(x) {int y=x; if (y) {printf("x returned %d\n", y); exit(1);}} : main() { : int sv[2]; : c(socketpair(1, 2, 0, sv)); : printf("sockets are %d, %d\n", sv[0], sv[1]); : c(close(sv[0])); : exit(0); : } : : This Perl program does not: : : #! /usr/local/bin/perl : socketpair(f1, f2, 1, 2, 0) || die "socketpair: $!"; : print "fd's are ".fileno(f1).",".fileno(f2)."\n"; : close(f1) || die "close f1: $!"; : exit 0; : : Does anybody know what I might be doing wrong? As usual, I've dug myself : a hole and the ladder out is missing some rungs... Ultrix pipes are not : based on sockets anymore and I need some socket-like pipes. The socketpair call is working fine. The only bug there is that close is returning a faulty indication of failure. It will be fixed in the next patch. Larry