From 2f8ef980d6a95f89647ce9f356cb9925420c0e73 Mon Sep 17 00:00:00 2001 From: Alex Shinn Date: Sun, 14 Jul 2013 14:30:10 +0900 Subject: [PATCH] Adding an interface to socketpair. --- lib/chibi/net.sld | 2 +- lib/chibi/net.stub | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/lib/chibi/net.sld b/lib/chibi/net.sld index 000a9fe7..a1cd1dea 100644 --- a/lib/chibi/net.sld +++ b/lib/chibi/net.sld @@ -1,7 +1,7 @@ (define-library (chibi net) (export sockaddr? address-info? get-address-info make-address-info - socket connect bind accept listen + socket connect bind accept listen open-socket-pair with-net-io open-net-io make-listener-socket address-info-family address-info-socket-type address-info-protocol address-info-address address-info-address-length address-info-next diff --git a/lib/chibi/net.stub b/lib/chibi/net.stub index b5cda7d9..2049765e 100644 --- a/lib/chibi/net.stub +++ b/lib/chibi/net.stub @@ -48,6 +48,12 @@ (define-c int connect (fileno sockaddr int)) +;;> Returns a list of 2 new sockets, the input and output end of a new +;;> pipe, respectively. + +(define-c errno (open-socket-pair "socketpair") + (int int int (result (array fileno 2)))) + (define-c-const int (address-family/unix "AF_UNIX")) (define-c-const int (address-family/inet "AF_INET")) (define-c-const int (socket-type/stream "SOCK_STREAM"))