Added hook to align cwd and umask for the S48 system.

This commit is contained in:
mainzelm 2001-12-19 09:14:15 +00:00
parent 6643c70391
commit 284d89fe12
3 changed files with 24 additions and 14 deletions

View File

@ -154,7 +154,9 @@
output-channel?
open-output-channel
channel-write
close-output-channel))
close-output-channel
set-with-fs-context-aligned*!))
(define-interface low-channels-interface
(export channel?
@ -172,17 +174,6 @@
open-channels-list))
(define-interface channels-interface
(export input-channel?
open-input-channel
channel-read
close-input-channel
output-channel?
open-output-channel
channel-write
close-output-channel))
(define-interface ports-interface
(export port?
make-port

View File

@ -16,14 +16,27 @@
(= (channel-status thing)
(enum channel-status-option special-output)))))
;;; Scsh changes umask and cwd lazily
;;; placeholder until scsh sets it
(define (with-fs-context-aligned* thunk)
(thunk))
(define (set-with-fs-context-aligned*! wpca*)
(set! with-fs-context-aligned* wpca*))
(define (open-input-channel filename)
(let ((channel (open-channel filename (enum channel-status-option input))))
(let ((channel (with-fs-context-aligned*
(lambda ()
(open-channel filename (enum channel-status-option input))))))
(if (channel? channel)
channel
(error "cannot open input file" filename))))
(define (open-output-channel filename)
(let ((channel (open-channel filename (enum channel-status-option output))))
(let ((channel (with-fs-context-aligned*
(lambda ()
(open-channel filename (enum channel-status-option output))))))
(if (channel? channel)
channel
(error "cannot open output file" filename))))

View File

@ -247,6 +247,12 @@
(initialize-umask)
(set-with-fs-context-aligned*! ; ensure S48 is aligned too
(lambda (thunk)
(with-cwd-aligned*
(lambda ()
(with-umask-aligned*
thunk)))))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;; Environment per thread