Skip to content

Conversation

weissi
Copy link
Contributor

@weissi weissi commented Jul 8, 2025

  • Replaces the highest_possibly_open_fd function for Linux with one that doesn't allocate
  • Added a test to test that we're actually closing all those fds in the child
  • This revealed a long-standing off-by-one bug in the driver loop to close the fds!

@weissi weissi requested a review from MaxDesiatov as a code owner July 8, 2025 11:18
@MaxDesiatov
Copy link
Contributor

@swift-ci test

@MaxDesiatov MaxDesiatov changed the title fd close loop: improve, fix & test AsyncProcess: improve, fix & test fd close loop Jul 8, 2025
@MaxDesiatov MaxDesiatov merged commit 3f4a6a8 into swiftlang:main Jul 8, 2025
20 checks passed
MaxDesiatov added a commit that referenced this pull request Jul 15, 2025
MaxDesiatov added a commit that referenced this pull request Jul 15, 2025
Reverting #223 due to failure on Amazon Linux 2: https://ci.swift.org/job/swift-PR-toolchain-amazonlinux2/82/console

```
05:24:57  In file included from /home/build-user/swift-sdk-generator/Sources/CProcessSpawnSync/spawner.c:31:
05:24:57  /home/build-user/swift-sdk-generator/Sources/CProcessSpawnSync/internal-helpers.h:69:26: error: call to undeclared function 'getdents64'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
05:24:57      while ((bytes_read = getdents64(dir_fd, (struct dirent64 *)buffer, sizeof(buffer))) > 0) {
05:24:57                           ^
05:24:57  1 error generated.
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants