square / okio

A modern I/O library for Android, Java, and Kotlin Multiplatform.

Home Page:https://square.github.io/okio/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Thoughts on using flag `O_CLOEXEC` for unix source sets?

05nelsonm opened this issue · comments

Wanted to pop in and ask about the possibility of always opening descriptors with the O_CLOEXEC flag, or utilizing the e flag with fopen.

EDIT: Can sling up a PR if it would be an acceptable addition to the library!

Yeah, seems quite reasonable. Do you have a specific use case? I’m curious about forking and execing in Kotlin/Native and haven’t seen many examples.

Please send a PR!

Do you have a specific use case?

Not really, just thought it'd be an easy win for everyone.

I’m curious about forking and execing in Kotlin/Native and haven’t seen many examples

https://github.com/05nelsonm/kmp-process/blob/master/library/process/src/unixMain/kotlin/io/matthewnelson/kmp/process/internal/PlatformBuilder.kt