Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions .github/workflows/pull_request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ jobs:
name: Test
uses: swiftlang/github-workflows/.github/workflows/swift_package_test.yml@main
with:
linux_os_versions: '["noble", "jammy", "focal", "rhel-ubi9", "bookworm"]'
linux_os_versions: '["amazonlinux2", "bookworm", "noble", "jammy", "focal", "rhel-ubi9"]'
linux_swift_versions: '["6.1", "nightly-main"]'
linux_pre_build_command: |
if command -v apt-get >/dev/null 2>&1 ; then # noble, jammy, focal, or bookworm
if command -v apt-get >/dev/null 2>&1 ; then # bookworm, noble, jammy, focal
apt-get update -y

# Test dependencies
Expand All @@ -22,6 +22,11 @@ jobs:

# Test dependencies
dnf install -y procps
elif command -v yum >/dev/null 2>&1 ; then # amazonlinux2
yum update -y

# Test dependencies
yum install -y procps
fi
windows_swift_versions: '["6.1", "nightly-main"]'
enable_macos_checks: true
Expand Down
26 changes: 14 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -222,18 +222,20 @@ Use it by setting`.bytes(limit:)` for `output` or `error`.

The table below describes the current level of support that Subprocess has for various platforms:

| **Platform** | **Support Status** |
|---|---|
| **macOS** | Supported |
| **iOS** | Not supported |
| **watchOS** | Not supported |
| **tvOS** | Not supported |
| **visionOS** | Not supported |
| **Ubuntu 22.04** | Supported |
| **Ubuntu 24.04** | Supported |
| **Red Hat Universal Base Image 9** | Supported |
| **Debian 12** | Supported |
| **Windows** | Supported |
| **Platform** | **Support Status** |
| ---------------------------------- | ------------------ |
| **macOS** | Supported |
| **iOS** | Not supported |
| **watchOS** | Not supported |
| **tvOS** | Not supported |
| **visionOS** | Not supported |
| **Ubuntu 20.04** | Supported |
| **Ubuntu 22.04** | Supported |
| **Ubuntu 24.04** | Supported |
| **Red Hat Universal Base Image 9** | Supported |
| **Debian 12** | Supported |
| **Amazon Linux 2** | Supported |
| **Windows** | Supported |

<p align="right">(<a href="#readme-top">back to top</a>)</p>

Expand Down
12 changes: 12 additions & 0 deletions Sources/_SubprocessCShims/process_shims.c
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,10 @@ int _was_process_suspended(int status) {
#if TARGET_OS_LINUX
#include <stdio.h>

#ifndef SYS_pidfd_send_signal
#define SYS_pidfd_send_signal 424
#endif

int _shims_snprintf(
char * _Nonnull str,
int len,
Expand Down Expand Up @@ -322,6 +326,10 @@ int _subprocess_spawn(
#define __GLIBC_PREREQ(maj, min) 0
#endif

#ifndef SYS_pidfd_open
#define SYS_pidfd_open 434
#endif

int _pidfd_open(pid_t pid) {
return syscall(SYS_pidfd_open, pid, 0);
}
Expand All @@ -332,6 +340,10 @@ int _pidfd_open(pid_t pid) {
#define SYS_clone3 435
#endif

#ifndef CLONE_PIDFD
#define CLONE_PIDFD 0x00001000
#endif

// Can't use clone_args from sched.h because only Glibc defines it; Musl does not (and there's no macro to detect Musl)
struct _subprocess_clone_args {
uint64_t flags;
Expand Down