From d349f7fd7668515b52e8c887b228dee31fe8e0cc Mon Sep 17 00:00:00 2001 From: Peter Bex Date: Sat, 24 Sep 2016 13:18:13 +0200 Subject: 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. --- scsh-process.scm | 12 ++++++++++-- 1 file 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 ;; -- cgit v1.2.3