descriptor
(encode-select-registry-mode mode))
(set-select-registry-length! registry #f))
+
+(define (get-select-registry-length registry)
+ (or (select-registry-length registry)
+ (let ((rl
+ ((ucode-primitive select-registry-length 1)
+ (select-registry-handle registry))))
+ (set-select-registry-length! registry rl)
+ rl)))
\f
(define (test-for-io-on-channel channel mode #!optional block?)
(test-for-io-on-descriptor (channel-descriptor-for-select channel)
(define (allocate-select-registry-result-vectors registry)
(let ((interrupt-mask (set-interrupt-enables! interrupt-mask/gc-ok)))
- (let ((n
- (or (select-registry-length registry)
- (let ((rl
- ((ucode-primitive select-registry-length 1)
- (select-registry-handle registry))))
- (set-select-registry-length! registry rl)
- rl))))
+ (let ((n (get-select-registry-length registry)))
(let loop ((rv select-registry-result-vectors))
(if (pair? rv)
(let ((vfd (caar rv))
(set! select-registry-result-vectors
(cons (cons vfd vmode) select-registry-result-vectors))))
(set-interrupt-enables! interrupt-mask)))
+
+(define (copy-select-registry! from to)
+ ((ucode-primitive copy-select-registry 2)
+ (select-registry-handle from)
+ (select-registry-handle to))
+ (set-select-registry-length! to (get-select-registry-length from)))
\f
;;;; Interface to dynamic loader