Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

io_uring_prep_multishot_accept_direct variant doesn't work with SOCK_CLOEXEC flag #1330

Closed
nikneym opened this issue Jan 17, 2025 · 3 comments

Comments

@nikneym
Copy link

nikneym commented Jan 17, 2025

Hi, when I try to use io_uring_prep_multishot_accept_direct on a listener socket (which is also a direct descriptor) with SOCK_CLOEXEC flag specified, I get errno -22 (EINVAL) on cqe.res field. Is this the expected behaviour? The non-direct variant io_uring_prep_multishot_accept works as expected.

@axboe
Copy link
Owner

axboe commented Jan 17, 2025

Yes that's expected, CLOEXEC is only available on regular / non-direct file descriptors. It could be supported, but it's currently not.

@nikneym
Copy link
Author

nikneym commented Jan 17, 2025

I'll omit this flag on direct descriptors then, thank you.

axboe added a commit that referenced this issue Jan 17, 2025
…files

SOCK_CLOEXEC is only supported with regular file descriptors, the
direct descriptors currently do not support automatic closing on exec.

Link: #1330
Signed-off-by: Jens Axboe <[email protected]>
@axboe
Copy link
Owner

axboe commented Jan 17, 2025

Added a comment about that in the man page.

@axboe axboe closed this as completed Jan 17, 2025
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

No branches or pull requests

2 participants