From 9e9821715a753602454a2890494e99201a141b45 Mon Sep 17 00:00:00 2001 From: Ricardo Wurmus Date: Mon, 26 Apr 2021 00:03:44 +0200 Subject: low: wait: Return more useful values. * drmaa/v1/low.scm (wait): Dereference string pointer for job identifier; return list of plain exit values instead of the opaque bytestructure. --- drmaa/v1/low.scm | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/drmaa/v1/low.scm b/drmaa/v1/low.scm index 55fe3fd..09628ed 100644 --- a/drmaa/v1/low.scm +++ b/drmaa/v1/low.scm @@ -499,7 +499,7 @@ TIMEOUT (an integer) specifies the number of seconds to block. If it is not provided or is #FALSE this procedure will block forever. This procedure returns three values: the identifier of the job that -has completed, the status code of the job (an opaque value), and an +has completed, a list of keyword-indexed status information, and an alist of resource usage statistics." (let ((timeout (or timeout (DRMAA 'TIMEOUT_WAIT_FOREVER))) @@ -523,8 +523,14 @@ alist of resource usage statistics." (pointer-to rusage) error-message (DRMAA 'ERROR_STRING_BUFFER)) - (values job-id-out - status-code + (values (char*->string job-id-out) + (let ((code (fh-object-ref status-code))) + (list #:exit-status (w-exit-status code) + #:coredump? (w-coredump? code) + #:exited? (w-if-exited? code) + #:aborted? (w-if-aborted? code) + #:signaled? (and (w-if-signaled? code) + (w-termsig code)))) (map (lambda (value) (or (and=> (string-index value #\=) (lambda (split-point) -- cgit v1.2.3