Changeset 27293 in project
- Timestamp:
- 08/24/12 16:42:35 (9 years ago)
- Location:
- release/4/unix-sockets
- Files:
-
- 4 edited
- 1 copied
Legend:
- Unmodified
- Added
- Removed
-
release/4/unix-sockets/tags/1.7/unix-sockets.scm
r24851 r27293 43 43 unix-close 44 44 unix-listener? 45 unix-listen) 45 unix-listen 46 unix-pair) 46 47 47 48 ;; TODO: errno should be accessed using the proper API? … … 127 128 return s2; 128 129 } 130 131 static int 132 create_socket_pair(___out int *s2) 133 { 134 int s1, rc; 135 int pair[2]; 136 rc = socketpair(PF_LOCAL, SOCK_STREAM, 0, pair); 137 if (rc < 0) return -1; 138 s1 = pair[0]; 139 *s2 = pair[1]; 140 return s1; 141 } 142 129 143 <# 130 144 … … 152 166 (unix-error 'unix-connect "can not connect" filename) 153 167 (io-ports 'unix-connect n) ) ) ) 168 169 (define (unix-pair) 170 (let-values (((s1 s2) (create_socket_pair))) 171 (if (negative? s1) 172 (unix-error 'unix-pair "cannot create socket pair") 173 (let-values (((i1 o1) (io-ports 'unix-pair s1)) 174 ((i2 o2) (io-ports 'unix-pair s2))) 175 (values i1 o1 i2 o2))))) 154 176 155 177 (define-constant +buffer-size+ 1024) -
release/4/unix-sockets/tags/1.7/unix-sockets.setup
r24851 r27293 8 8 'unix-sockets 9 9 '("unix-sockets.so" "unix-sockets.import.so") 10 '((version 1. 6)))10 '((version 1.7))) -
release/4/unix-sockets/trunk/unix-sockets.scm
r24851 r27293 43 43 unix-close 44 44 unix-listener? 45 unix-listen) 45 unix-listen 46 unix-pair) 46 47 47 48 ;; TODO: errno should be accessed using the proper API? … … 127 128 return s2; 128 129 } 130 131 static int 132 create_socket_pair(___out int *s2) 133 { 134 int s1, rc; 135 int pair[2]; 136 rc = socketpair(PF_LOCAL, SOCK_STREAM, 0, pair); 137 if (rc < 0) return -1; 138 s1 = pair[0]; 139 *s2 = pair[1]; 140 return s1; 141 } 142 129 143 <# 130 144 … … 152 166 (unix-error 'unix-connect "can not connect" filename) 153 167 (io-ports 'unix-connect n) ) ) ) 168 169 (define (unix-pair) 170 (let-values (((s1 s2) (create_socket_pair))) 171 (if (negative? s1) 172 (unix-error 'unix-pair "cannot create socket pair") 173 (let-values (((i1 o1) (io-ports 'unix-pair s1)) 174 ((i2 o2) (io-ports 'unix-pair s2))) 175 (values i1 o1 i2 o2))))) 154 176 155 177 (define-constant +buffer-size+ 1024) -
release/4/unix-sockets/trunk/unix-sockets.setup
r24851 r27293 8 8 'unix-sockets 9 9 '("unix-sockets.so" "unix-sockets.import.so") 10 '((version 1. 6)))10 '((version 1.7)))
Note: See TracChangeset
for help on using the changeset viewer.