From owner-freebsd-questions Mon Nov 20 02:11:59 1995 Return-Path: owner-questions Received: (from root@localhost) by freefall.freebsd.org (8.6.12/8.6.6) id CAA22526 for questions-outgoing; Mon, 20 Nov 1995 02:11:59 -0800 Received: from gate1.internet-eireann.ie (gate1.internet-eireann.ie [194.9.0.1]) by freefall.freebsd.org (8.6.12/8.6.6) with ESMTP id CAA22513 for ; Mon, 20 Nov 1995 02:11:51 -0800 Received: from mip1.networx.ie (networx.internet-eireann.ie [194.9.33.49]) by gate1.internet-eireann.ie (8.6.12/8.6.9) with SMTP id KAA02245 for ; Mon, 20 Nov 1995 10:11:41 GMT Received: from home by mip1.networx.ie Date: Sun, 19 Nov 1995 22:56:08 GMT From: Michael Ryan Subject: socketpair() won't work To: FreeBSD Support Message-Id: Priority: Normal Mime-Version: 1.0 Content-Type: TEXT/PLAIN; CHARSET=US-ASCII Sender: owner-questions@freebsd.org Precedence: bulk Hi all, I hope this isn't a stupid question, or a stupid oversight on my part, but I can't get socketpair() to work. I'm porting an application to FreeBSD and I need to get this working. The following code fragment works under Mips Unix but fails under FreeBSD. Can anybody see what's wrong? #include #include #include extern int errno; main () { int rc; int sd[2]; if ((rc=socketpair(AF_UNIX, SOCK_STREAM, 0, sd)) != 0) { perror("fail"); fprintf(stderr, "rc = %d, errno = %d\n", rc, errno); } } The above program produces this output: fail: Undefined error: 0 rc = 3, errno = 0 Thanks for any suggestions, Mike