Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Perl 6 doesn't have kill #1277

Closed
briandfoy opened this issue Apr 9, 2017 · 2 comments
Closed

Perl 6 doesn't have kill #1277

briandfoy opened this issue Apr 9, 2017 · 2 comments
Labels
docs Documentation issue (primary issue type)

Comments

@briandfoy
Copy link
Contributor

The p5-p6 perlfunc for kill says

Now part of the LProc::Async class, but looks to work as in Perl 5.

As far as I can tell, this only lets you send a signal to a process you started and there's no (documented) way to provide a PID.

method kill(Proc::Async:D: $signal = "HUP") {
    X::Proc::Async::MustBeStarted.new(:method<kill>, proc => self).throw if !$!started;
    nqp::killprocasync($!process_handle, $*KERNEL.signal($signal));
}

That killprocasync is really in MoarVM as far as I can tell, but even at the NQP level I lose all my bearings.

As such, it seems this doesn't work at all like the Perl 5 version. It might be too late to change the name of the method so it doesn't carry the baggage of the expectations of the real thing called kill, but it doesn't work as it does in Perl 5. I'd probably document this as "not in Perl 6, so shell out".

I wasn't so much interested in the termination aspects of kill as the "is the process still running" abilities, especially for processes not started by the one I'm currently in.

@briandfoy briandfoy added the docs Documentation issue (primary issue type) label Apr 9, 2017
@Leont
Copy link
Contributor

Leont commented Apr 18, 2017

I wasn't so much interested in the termination aspects of kill as the "is the process still running" abilities, especially for processes not started by the one I'm currently in.

This is a rather POSIX specific expectation. perl5 puts effort into emulating it on Windows; it's not necessarily a sensible expectation or a sensible interface.

@zoffixznet
Copy link
Contributor

Thanks. Fixed in 3bb170f

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs Documentation issue (primary issue type)
Projects
None yet
Development

No branches or pull requests

3 participants