Added hook to align cwd and umask for the S48 system.
This commit is contained in:
parent
6643c70391
commit
284d89fe12
|
@ -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
|
||||
|
|
|
@ -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))))
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue