;;;; ;;;; process.stk -- Process management for STklos ;;;; ;;;; Copyright © 2000-2011 Erick Gallesio - I3S-CNRS/ESSI ;;;; ;;;; ;;;; This program is free software; you can reistribute it and/or modify ;;;; it under the terms of the GNU General Public License as published by ;;;; the Free Software Foundation; either version 2 of the License, or ;;;; (at your option) any later version. ;;;; ;;;; This program is distributed in the hope that it will be useful, ;;;; but WITHOUT ANY WARRANTY; without even the implied warranty of ;;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ;;;; GNU General Public License for more details. ;;;; ;;;; You should have received a copy of the GNU General Public License ;;;; along with this program; if not, write to the Free Software ;;;; Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, ;;;; USA. ;;;; ;;;; Author: Erick Gallesio [eg@unice.fr] ;;;; Creation date: 12-Dec-2000 14:04 (eg) ;;;; Last file update: 27-May-2011 23:05 (eg) ;;;; #| |# (define (run-process . l) (define (filter-key-list l) (let Loop ((l l) (key '()) (other '())) (cond ((null? l) (values (reverse! key) (reverse! other))) ((keyword? (car l)) (if (null? (cdr l)) (error "value expected after keyword ~S" (car l))) (Loop (cddr l) (cons (cadr l) (cons (car l) key)) other)) (else (Loop (cdr l) key (cons (car l) other)))))) (define (run-process-parse :key input output error wait (fork #t) (args '())) ;; Call the C function (%run-process (vector input output error) wait fork args)) ;; ;; Code of the function RUN-PROCESS starts here ;; (call-with-values (lambda () (filter-key-list l)) (lambda (key other) (values (apply run-process-parse :args other key))))) #| |# (define (process-kill proc) (process-signal proc 'SIGTERM)) #| |# (define (process-stop proc) (process-signal proc 'SIGSTOP)) (define (process-continue proc) (process-signal proc 'SIGCONT)) ; LocalWords: SIGSTOP SIGCONT