Giter VIP home page Giter VIP logo

Comments (8)

dylni avatar dylni commented on August 16, 2024 1

Unfortunately, I don't think OpenBSD can be supported. This crate makes a strong effort to not terminate the wrong process under any circumstance. To make that happen, waitid is called in careful combination with other syscalls. However, it's not implemented for this platform AFAICT.

Do you know an alternative to waitid that's OpenBSD-specific or have any other suggestions?

from process_control.

dylni avatar dylni commented on August 16, 2024 1

I'm closing this, since one of the starship maintainers indicated that they're close to merging a fix for this issue. If further use cases arise for this platform to be supported, this can be reopened.

from process_control.

AaronM04 avatar AaronM04 commented on August 16, 2024

@dylni I'm not sure what exact functionality you're looking for in a waitid equivalent, but OpenBSD does have wait3 and wait4 which might be usable: http://man.openbsd.org/wait4

from process_control.

dylni avatar dylni commented on August 16, 2024

@AaronM04 I use it to wait on processes without letting them terminate. That's the purpose of the WNOWAIT flag, which I use here:

process_control/src/unix.rs

Lines 159 to 164 in 56f388f

libc::waitid(
P_PID,
process_id,
process_info.as_mut_ptr(),
WEXITED | WNOWAIT | WSTOPPED,
)

Unfortunately, I don't see any way to do that with wait3 or wait4.

If there's nothing equivalent, one option is to make Timeout::terminating a compile error for this target and add Timeout::terminating_if_possible to only terminate for other targets. Would that work for your use case? Long-running processes would never be killed on OpenBSD with that implementation.

The best option would be to find a platform-specific syscall for this platform, but I don't think one exists.

from process_control.

AaronM04 avatar AaronM04 commented on August 16, 2024

@dylni this is the use case I'm concerned with: https://github.com/starship/starship/blob/master/src/utils.rs#L288

If I understand you correctly, this would be a compile error, so no, it wouldn't work.

from process_control.

dylni avatar dylni commented on August 16, 2024

@AaronM04 I responded at the starship repository.

from process_control.

AaronM04 avatar AaronM04 commented on August 16, 2024

Thanks for looking into this! 😀

from process_control.

dylni avatar dylni commented on August 16, 2024

No problem! 😀 I'm glad it'll have a favorable resolution.

from process_control.

Related Issues (9)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.