Skip to content

os: pass O_CLOEXEC in unixFilesystem.OpenFile - #6288

Merged
davecheney merged 1 commit into
tinygo-org:devfrom
brho:pr-os-openfile-cloexec
Nov 13, 2026
Merged

davecheney merged 1 commit into
tinygo-org:devfrom
brho:pr-os-openfile-cloexec

Conversation

@brho

@brho brho commented Nov 12, 2026

Copy link
Copy Markdown

Open files with syscall.O_CLOEXEC so file descriptors opened by os.Open and os.OpenFile are not leaked across fork and exec.

davecheney
davecheney previously approved these changes Nov 12, 2026

@davecheney davecheney left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems reasonable

@davecheney
davecheney dismissed their stale review November 12, 2026 23:42

let me run the tests first

@davecheney

Copy link
Copy Markdown
Contributor

@brho could you please look at the macOS failures. Thank you

@brho
brho force-pushed the pr-os-openfile-cloexec branch from 2e652a2 to d4e62c4 Compare November 13, 2026 16:42
@brho

brho commented Nov 13, 2026

Copy link
Copy Markdown
Author

Fixed TestOpenFileCloexec on macOS by linking syscall.fcntl instead of calling syscall.Syscall.

Open files with syscall.O_CLOEXEC so file descriptors opened by os.Open and os.OpenFile are not leaked across fork and exec.
@davecheney
davecheney force-pushed the pr-os-openfile-cloexec branch from d4e62c4 to dfe582b Compare November 13, 2026 21:11
@davecheney
davecheney marked this pull request as ready for review November 13, 2026 21:11
@davecheney
davecheney merged commit e50e96c into tinygo-org:dev Nov 13, 2026
30 checks passed
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