[Wisp-cvs] wisp/src/builtin dictbase.wisp,1.245,1.246 sys.wisp,1.115,1.116
Status: Alpha
Brought to you by:
digg
From: <di...@us...> - 2002-09-18 20:58:10
|
Update of /cvsroot/wisp/wisp/src/builtin In directory usw-pr-cvs1:/tmp/cvs-serv26569/src/builtin Modified Files: dictbase.wisp sys.wisp Log Message: Moved file descriptor set manipulation from the Wisp level to the Worth level. Index: dictbase.wisp =================================================================== RCS file: /cvsroot/wisp/wisp/src/builtin/dictbase.wisp,v retrieving revision 1.245 retrieving revision 1.246 diff -u -d -r1.245 -r1.246 --- dictbase.wisp 18 Sep 2002 20:55:16 -0000 1.245 +++ dictbase.wisp 18 Sep 2002 20:58:07 -0000 1.246 @@ -139,6 +139,10 @@ (local string? (asm NN_string_huh)) (local symbol? (asm NN_symbol_huh)) (local sys:exit (asm NN_sys_exit)) +(local sys:fd-clr! (asm NN_sys_fd_clr)) +(local sys:fd-isset? (asm NN_sys_fd_isset)) +(local sys:fd-set! (asm NN_sys_fd_set)) +(local sys:fd-zero! (asm NN_sys_fd_zero)) (local sys:getegid (asm NN_sys_getegid)) (local sys:geteuid (asm NN_sys_geteuid)) (local sys:getgid (asm NN_sys_getgid)) Index: sys.wisp =================================================================== RCS file: /cvsroot/wisp/wisp/src/builtin/sys.wisp,v retrieving revision 1.115 retrieving revision 1.116 diff -u -d -r1.115 -r1.116 --- sys.wisp 18 Sep 2002 20:55:16 -0000 1.115 +++ sys.wisp 18 Sep 2002 20:58:07 -0000 1.116 @@ -168,16 +168,16 @@ (signal-system-error res `(sys:tcsetattr ,fd))))))) (define (make-fdset) - (make-string (system-constant 'size-of 'fd_set) #\U+00)) + (my buffer (make-c8string (sys:fd-zero!)) + (sys:fd-zero! buffer) + buffer)) (define (fdset-ref set fd (:= new-val)) - (if (not (and (integer? fd) (<= 0 fd) - (< fd (system-constant 'size-of 'FD_SETSIZE)))) - (raise 'range fd)) - (my pos (logical-xor fd 7) ; FIXME: this is specific to Linux and ia32 - (if :=? - (set! (bitstring-ref set pos) new-val) - (bitstring-ref set pos)))) + (if :=? + (if new-val + (sys:fd-set! fd set) + (sys:fd-clr! fd set)) + (sys:fd-isset? fd set))) (define (pack-struct-flock type whence start length (pid 0)) (if (symbol? type) |