Startup and top changed so that -e entry points get the whole command line,
including the program name. syscalls.scm has a trivial documentation upgrade.
This commit is contained in:
parent
e45e9a6b0d
commit
26b8de258e
|
@ -50,15 +50,15 @@
|
||||||
|
|
||||||
(define (scsh-stand-alone-resumer start)
|
(define (scsh-stand-alone-resumer start)
|
||||||
(usual-resumer ;sets up exceptions, interrupts, and current input & output
|
(usual-resumer ;sets up exceptions, interrupts, and current input & output
|
||||||
(lambda (args)
|
(lambda (args) ; VM gives us our args, but not our program.
|
||||||
(init-scsh-hindbrain #t) ; Whatever. Relink & install scsh's I/O system.
|
(init-scsh-hindbrain #t) ; Whatever. Relink & install scsh's I/O system.
|
||||||
(call-with-current-continuation
|
(call-with-current-continuation
|
||||||
(lambda (halt)
|
(lambda (halt)
|
||||||
(set! %full-command-line args)
|
(set! %vm-prog-args (cons "scsh" args)) ; WRONG -- use image.
|
||||||
(set-command-line-args! (cons "" args)) ; WRONG.
|
(set-command-line-args! %vm-prog-args)
|
||||||
(with-handler (simple-condition-handler halt (error-output-port))
|
(with-handler (simple-condition-handler halt (error-output-port))
|
||||||
(lambda ()
|
(lambda ()
|
||||||
(let ((exit-val (start command-line-arguments)))
|
(let ((exit-val (start (command-line))))
|
||||||
(if (integer? exit-val) exit-val 0))))))))) ; work around bug.
|
(if (integer? exit-val) exit-val 0))))))))) ; work around bug.
|
||||||
|
|
||||||
(define %full-command-line #f)
|
(define %vm-prog-args #f)
|
||||||
|
|
|
@ -1072,11 +1072,11 @@
|
||||||
(define-errno-syscall (%fcntl-read fd command) %fcntl-read/errno value)
|
(define-errno-syscall (%fcntl-read fd command) %fcntl-read/errno value)
|
||||||
(define-errno-syscall (%fcntl-write fd command val) %fcntl-write/errno)
|
(define-errno-syscall (%fcntl-write fd command val) %fcntl-write/errno)
|
||||||
|
|
||||||
;;; fcntl()'s F_GETFD and F_SETFD.
|
;;; fcntl()'s F_GETFD and F_SETFD. Note that the SLEAZY- prefix on the
|
||||||
;;; Note that the SLEAZY- prefix on the CALL/FDES isn't an optimisation.
|
;;; CALL/FDES isn't an optimisation; it's *required* for the correct behaviour
|
||||||
;;; Straight CALL/FDES modifies unrevealed file descriptors by clearing
|
;;; of these procedures. Straight CALL/FDES modifies unrevealed file
|
||||||
;;; their CLOEXEC bit when it reveals them -- so it would interfere with
|
;;; descriptors by clearing their CLOEXEC bit when it reveals them -- so it
|
||||||
;;; the reading.
|
;;; would interfere with the reading and writing of that bit!
|
||||||
|
|
||||||
(define (fdes-flags fd/port)
|
(define (fdes-flags fd/port)
|
||||||
(sleazy-call/fdes fd/port
|
(sleazy-call/fdes fd/port
|
||||||
|
|
|
@ -214,9 +214,9 @@
|
||||||
name))
|
name))
|
||||||
|
|
||||||
|
|
||||||
(define (parse-switches-and-execute args context)
|
(define (parse-switches-and-execute all-args context)
|
||||||
(receive (switches term-switch term-val top-entry args)
|
(receive (switches term-switch term-val top-entry args)
|
||||||
(parse-scsh-args args)
|
(parse-scsh-args (cdr all-args))
|
||||||
((with-new-session context ; "Log in" user.
|
((with-new-session context ; "Log in" user.
|
||||||
(current-input-port) (current-output-port)
|
(current-input-port) (current-output-port)
|
||||||
args
|
args
|
||||||
|
@ -231,7 +231,7 @@
|
||||||
(if (string? term-val)
|
(if (string? term-val)
|
||||||
term-val ; Script file.
|
term-val ; Script file.
|
||||||
"file-descriptor-script"); -s<num>
|
"file-descriptor-script"); -s<num>
|
||||||
"scsh")
|
(car all-args))
|
||||||
args))
|
args))
|
||||||
|
|
||||||
;; Set HOME-DIRECTORY and EXEC-PATH-LIST,
|
;; Set HOME-DIRECTORY and EXEC-PATH-LIST,
|
||||||
|
|
Loading…
Reference in New Issue