Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
A
asdf
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
16
Issues
16
List
Boards
Labels
Service Desk
Milestones
Merge Requests
8
Merge Requests
8
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
asdf
asdf
Commits
8f9db9ed
Commit
8f9db9ed
authored
Sep 25, 2016
by
Elias Pipping
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Export process-info-pid
parent
c44bd7b3
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
6 deletions
+7
-6
test/test-run-program-unix-internal.script
test/test-run-program-unix-internal.script
+2
-2
uiop/run-program.lisp
uiop/run-program.lisp
+5
-4
No files found.
test/test-run-program-unix-internal.script
View file @
8f9db9ed
...
...
@@ -409,12 +409,12 @@
:wait t :output *output-file* :directory temporary-directory)
(check-output in-string)))
(new-test-suite "
%
process-info-pid")
(new-test-suite "process-info-pid")
(define-test
"basic functionality"
(let* ((process-info (%run-program "./sleeper.sh 12 1" :wait nil))
(pid (
uiop/run-program::%
process-info-pid process-info)))
(pid (process-info-pid process-info)))
(handle-result "obtainable and plausible?"
(and (numberp pid) (plusp pid)))
(wait-process process-info)))
...
...
uiop/run-program.lisp
View file @
8f9db9ed
...
...
@@ -16,6 +16,7 @@
#:close-streams
#:launch-program
#:process-alive-p
#:run-program
#:terminate-process
#:wait-process
#:process-info-error-output
#:process-info-input
#:process-info-output
#:process-info-pid
#:subprocess-error
#:subprocess-error-code
#:subprocess-error-command
#:subprocess-error-process
))
...
...
@@ -630,7 +631,7 @@ It returns a process-info object."
(
or
(
slot-value
process-info
'bidir-stream
)
(
slot-value
process-info
'output-stream
)))
(
defun
%
process-info-pid
(
process-info
)
(
defun
process-info-pid
(
process-info
)
(
let
((
process
(
slot-value
process-info
'process
)))
(
declare
(
ignorable
process
))
#+
abcl
(
symbol-call
:sys
:process-pid
process
)
...
...
@@ -643,7 +644,7 @@ It returns a process-info object."
#+
mkcl
(
mkcl:process-id
process
)
#+
sbcl
(
sb-ext:process-pid
process
)
#-
(
or
abcl
allegro
clozure
cmucl
ecl
mkcl
lispworks
sbcl
scl
)
(
not-implemented-error
'
%
process-info-pid
)))
(
not-implemented-error
'process-info-pid
)))
(
defun
%process-status
(
process-info
)
(
if-let
(
exit-code
(
slot-value
process-info
'exit-code
))
...
...
@@ -796,7 +797,7 @@ or :error-output."
#+
(
or
cmucl
scl
)
(
ext:process-kill
(
slot-value
process-info
'process
)
signal
)
#+
sbcl
(
sb-ext:process-kill
(
slot-value
process-info
'process
)
signal
)
#-
(
or
allegro
clozure
cmucl
sbcl
scl
)
(
if-let
(
pid
(
%
process-info-pid
process-info
))
(
if-let
(
pid
(
process-info-pid
process-info
))
(
%run-program
(
format
nil
"kill -~a ~a"
signal
pid
)
:wait
t
)))
(
defun
terminate-process
(
process-info
&key
urgent
)
...
...
@@ -814,7 +815,7 @@ race conditions."
#-
(
or
abcl
ecl
lispworks7+
mkcl
)
(
os-cond
((
os-unix-p
)
(
%posix-send-signal
process-info
(
if
urgent
9
15
)))
((
os-windows-p
)
(
if-let
(
pid
(
%
process-info-pid
process-info
))
((
os-windows-p
)
(
if-let
(
pid
(
process-info-pid
process-info
))
(
%run-program
(
format
nil
"taskkill ~a /pid ~a"
(
if
urgent
"/f"
""
)
pid
))))
(
t
(
not-implemented-error
'terminate-process
))))
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment