Skip to content

std calls libc::killpg on VxWorks, which neither libc nor the platform provides #159969

Description

@physwkim

x86_64-wrs-vxworks has no prebuilt std, and -Zbuild-std fails on an empty
project — you don't have to touch std::process for this to bite:

cargo new vxcheck && cd vxcheck
cargo +nightly check -Zbuild-std=std,panic_abort --target x86_64-wrs-vxworks

error[E0425]: cannot find function `killpg` in crate `libc`
    --> library/std/src/sys/process/unix/vxworks.rs:179:28

libc has never declared killpg for vxworks, and declaring it wouldn't help:
VxWorks has no process groups. In wrsdk-vxworks7-qemu-1.17.0 there's no killpg
symbol anywhere, and getpgrp/setpgid are no-ops in libunix — getpgrp
returns a constant 0, setpgid stores nothing and returns 0. So kill(-pgrp, sig) is out as well.

Command::process_group is already ignored on this target too: get_pgroup is
only read by the fork/posix_spawn path in unix.rs, while vxworks.rs spawns
with rtpSpawn.

So ErrorKind::Unsupported looks right here. (rustc suggests kill, but :179
is send_process_group_signal, not Child::killsend_signal above it
already uses kill.)

Same build also fails on libc::pread/pwrite with libc 0.2.187 or later:
rust-lang/libc#5328.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions