Path: utzoo!utgpu!news-server.csri.toronto.edu!clyde.concordia.ca!uunet!decwrl!bacchus.pa.dec.com!vixie From: vixie@decwrl.dec.com (Paul A Vixie) Newsgroups: comp.lang.perl Subject: anybody getting joy from socketpair() ? Message-ID: Date: 27 Aug 90 00:36:47 GMT Sender: news@wrl.dec.com (News) Organization: DEC Western Research Lab Lines: 39 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. [vixie:vax] perl -v $Header: perly.c,v 3.0.1.5 90/03/27 16:20:57 lwall Locked $ Patch level: 18 [...] [vixie:vax] 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; fd's are 3,4 close f1: Bad file number at - line 2. -- Paul Vixie DEC Western Research Lab Palo Alto, California ...!decwrl!vixie