diff options
author | Peter Bex <peter@more-magic.net> | 2016-09-24 13:18:13 +0200 |
---|---|---|
committer | Peter Bex <peter@more-magic.net> | 2016-09-24 13:18:13 +0200 |
commit | d349f7fd7668515b52e8c887b228dee31fe8e0cc (patch) | |
tree | b5740f3e5aab452304cc167359db034c1d26dc89 | |
parent | f2a51566b911176e47d482cd1ebf0c3634cbc8f9 (diff) | |
download | scsh-process-d349f7fd7668515b52e8c887b228dee31fe8e0cc.tar.gz |
Add proc:pid, proc?, signal-process and process-sleep for improved compat
Thanks to Joerg Wittenberger for the suggestion to add proc:pid and
signal-process.
-rw-r--r-- | scsh-process.scm | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/scsh-process.scm b/scsh-process.scm index a741177..ce70290 100644 --- a/scsh-process.scm +++ b/scsh-process.scm @@ -11,7 +11,7 @@ ;; WARNING: Don't mix with threading unless you're using ;; Chicken 4.8.1 rev 47b5be71 or later. ;; -;;; Copyright (c) 2012-2015, Peter Bex +;;; Copyright (c) 2012-2016, Peter Bex ;; All rights reserved. ; ; Redistribution and use in source and binary forms, with or without @@ -46,7 +46,7 @@ run/collecting run/string run/strings run/port run/file run/sexp run/sexps || && (& run-final-thunk maybe->string) (run maybe->string) (exec-epf maybe->string) - process? wait) + process? proc? wait signal-process process-sleep) (import chicken scheme data-structures) @@ -66,6 +66,10 @@ (define-record scsh-process pid exit-status ok?) +(define proc:pid scsh-process-pid) +(define proc? scsh-process?) + +;; Deprecated (define process? scsh-process?) (define *scsh-pending-processes* (make-hash-table)) @@ -143,6 +147,10 @@ (hash-table-keys *scsh-pending-processes*)) (when old-handler (old-handler signal))))))) +(define (signal-process proc sig) + (process-signal (scsh-process-pid proc) sig)) + +(define process-sleep sleep) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; Execution and forking helpers ;; |