Skip to content

process: only use F_DUPFD_CLOEXEC if it is defined#3512

Merged
vtjnash merged 1 commit intolibuv:v1.xfrom
vtjnash:jn/F_DUPFD_CLOEXEC
Mar 5, 2022
Merged

process: only use F_DUPFD_CLOEXEC if it is defined#3512
vtjnash merged 1 commit intolibuv:v1.xfrom
vtjnash:jn/F_DUPFD_CLOEXEC

Conversation

@vtjnash
Copy link
Copy Markdown
Member

@vtjnash vtjnash commented Mar 5, 2022

We can save a syscall on most modern systems (required by POSIX 2008),
but not on all systems.

Should resolved the complaints in #3257 (comment)

CI: https://ci.nodejs.org/view/libuv/job/libuv-test-commit/2232/

We can save a syscall on most modern systems (required by POSIX 2008),
but not on all systems.

Also handle errors from CLOEXEC. Even though fcntl does not really
define there to be any, it could theoretically be EBADF if the user
happened to pass a bad file descriptor to the same number fd (such that
no other code happened to already fail on that).
@vtjnash vtjnash force-pushed the jn/F_DUPFD_CLOEXEC branch from 32837a9 to 2b4c6e6 Compare March 5, 2022 02:34
@vtjnash vtjnash mentioned this pull request Mar 5, 2022
8 tasks
@vtjnash vtjnash merged commit 6ac063d into libuv:v1.x Mar 5, 2022
@vtjnash vtjnash deleted the jn/F_DUPFD_CLOEXEC branch March 5, 2022 17:52
JeffroMF pushed a commit to JeffroMF/libuv that referenced this pull request May 16, 2022
We can save a syscall on most modern systems (required by POSIX 2008),
but not on all systems.

Also handle errors from CLOEXEC. Even though fcntl does not really
define there to be any, it could theoretically be EBADF if the user
happened to pass a bad file descriptor to the same number fd (such that
no other code happened to already fail on that).
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.

4 participants