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
fix/eventfd: O_NONBLOCK #903
Conversation
3181c78
to
13a6204
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Both eventfd
with EFD_NONBLOCK
and fcntl
with O_NONBLOCK
now work, without any assertion fails.
Reviewed-by: Ioan-Teodor Teugea ioan_teodor.teugea@stud.acs.upb.ro
@skuenzer Thank you for this PR. There is a typo in the first commit message |
61e6126
to
3acb51f
Compare
Sure, I updated it. I was seeing it more relaxed that |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good! @razvand please have another look when you can.
Reviewed-by: Florin Postolache florin.postolache.of@gmail.com
Introduces the parameter type `PT_DEC` as format for signed decimal arguments. Signed-off-by: Simon Kuenzer <simon@unikraft.io>
Adds the format definitions for the system calls`eventfd` and `eventfd2` for decoding with `uk_prsyscall()`. Signed-off-by: Simon Kuenzer <simon@unikraft.io>
Introduces a configuration option to enable debug messages for `lib/posix-event`. Signed-off-by: Simon Kuenzer <simon@unikraft.io>
The eventfd constructor system call `eventfd2` uses the the `fcntl` system call to setup the file descriptor flag `O_NONBLOCK` during creation. This commit makes sure that the low-level implementation is directly called so that there is no dependency to `errno`. Checkpatch-Ignore: AVOID_EXTERNS Checkpatch-Ignore: FUNCTION_ARGUMENTS Signed-off-by: Simon Kuenzer <simon@unikraft.io>
Commit fc96850 - lib/vfscore: Enable FIONBIO in fcntl(F_SETFL) introduced a complete implementation of handling `FNONBLOCK` and `FASYNC` with `fcntl`, including forwarding of error codes to the caller. Because a standard `EINVAL` handler for `ioctl` was used for `eventfd` file descriptors, setting `O_NONBLOCK` caused a failing assertion. Checkpatch-Ignore: USE_NEGATIVE_ERRNO Signed-off-by: Simon Kuenzer <simon@unikraft.io>
3acb51f
to
737a7eb
Compare
✅ Checkpatch passed Beep boop! I ran Unikraft's
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Approved-by: Razvan Deaconescu razvand@unikraft.io
Adds the format definitions for the system calls`eventfd` and `eventfd2` for decoding with `uk_prsyscall()`. Signed-off-by: Simon Kuenzer <simon@unikraft.io> Reviewed-by: Florin Postolache <florin.postolache.of@gmail.com> Approved-by: Razvan Deaconescu <razvand@unikraft.io> Tested-by: Unikraft CI <monkey@unikraft.io> GitHub-Closes: #903
Introduces a configuration option to enable debug messages for `lib/posix-event`. Signed-off-by: Simon Kuenzer <simon@unikraft.io> Reviewed-by: Florin Postolache <florin.postolache.of@gmail.com> Approved-by: Razvan Deaconescu <razvand@unikraft.io> Tested-by: Unikraft CI <monkey@unikraft.io> GitHub-Closes: #903
The eventfd constructor system call `eventfd2` uses the the `fcntl` system call to setup the file descriptor flag `O_NONBLOCK` during creation. This commit makes sure that the low-level implementation is directly called so that there is no dependency to `errno`. Checkpatch-Ignore: AVOID_EXTERNS Checkpatch-Ignore: FUNCTION_ARGUMENTS Signed-off-by: Simon Kuenzer <simon@unikraft.io> Reviewed-by: Florin Postolache <florin.postolache.of@gmail.com> Approved-by: Razvan Deaconescu <razvand@unikraft.io> Tested-by: Unikraft CI <monkey@unikraft.io> GitHub-Closes: #903
Commit fc96850 - lib/vfscore: Enable FIONBIO in fcntl(F_SETFL) introduced a complete implementation of handling `FNONBLOCK` and `FASYNC` with `fcntl`, including forwarding of error codes to the caller. Because a standard `EINVAL` handler for `ioctl` was used for `eventfd` file descriptors, setting `O_NONBLOCK` caused a failing assertion. Checkpatch-Ignore: USE_NEGATIVE_ERRNO Signed-off-by: Simon Kuenzer <simon@unikraft.io> Reviewed-by: Florin Postolache <florin.postolache.of@gmail.com> Approved-by: Razvan Deaconescu <razvand@unikraft.io> Tested-by: Unikraft CI <monkey@unikraft.io> GitHub-Closes: #903
Introduces the parameter type `PT_DEC` as format for signed decimal arguments. Signed-off-by: Simon Kuenzer <simon@unikraft.io> Reviewed-by: Florin Postolache <florin.postolache.of@gmail.com> Approved-by: Razvan Deaconescu <razvand@unikraft.io> Tested-by: Unikraft CI <monkey@unikraft.io> GitHub-Closes: unikraft#903
Adds the format definitions for the system calls`eventfd` and `eventfd2` for decoding with `uk_prsyscall()`. Signed-off-by: Simon Kuenzer <simon@unikraft.io> Reviewed-by: Florin Postolache <florin.postolache.of@gmail.com> Approved-by: Razvan Deaconescu <razvand@unikraft.io> Tested-by: Unikraft CI <monkey@unikraft.io> GitHub-Closes: unikraft#903
Introduces a configuration option to enable debug messages for `lib/posix-event`. Signed-off-by: Simon Kuenzer <simon@unikraft.io> Reviewed-by: Florin Postolache <florin.postolache.of@gmail.com> Approved-by: Razvan Deaconescu <razvand@unikraft.io> Tested-by: Unikraft CI <monkey@unikraft.io> GitHub-Closes: unikraft#903
The eventfd constructor system call `eventfd2` uses the the `fcntl` system call to setup the file descriptor flag `O_NONBLOCK` during creation. This commit makes sure that the low-level implementation is directly called so that there is no dependency to `errno`. Checkpatch-Ignore: AVOID_EXTERNS Checkpatch-Ignore: FUNCTION_ARGUMENTS Signed-off-by: Simon Kuenzer <simon@unikraft.io> Reviewed-by: Florin Postolache <florin.postolache.of@gmail.com> Approved-by: Razvan Deaconescu <razvand@unikraft.io> Tested-by: Unikraft CI <monkey@unikraft.io> GitHub-Closes: unikraft#903
Commit fc96850 - lib/vfscore: Enable FIONBIO in fcntl(F_SETFL) introduced a complete implementation of handling `FNONBLOCK` and `FASYNC` with `fcntl`, including forwarding of error codes to the caller. Because a standard `EINVAL` handler for `ioctl` was used for `eventfd` file descriptors, setting `O_NONBLOCK` caused a failing assertion. Checkpatch-Ignore: USE_NEGATIVE_ERRNO Signed-off-by: Simon Kuenzer <simon@unikraft.io> Reviewed-by: Florin Postolache <florin.postolache.of@gmail.com> Approved-by: Razvan Deaconescu <razvand@unikraft.io> Tested-by: Unikraft CI <monkey@unikraft.io> GitHub-Closes: unikraft#903
Base target
Additional configuration
CONFIG_LIBPOSIX_EVENT=y
Description of changes
Commit fc96850 introduced an complete implementation of handling
FNONBLOCK
andFASYNC
withfcntl
, including forwarding of error codes to the caller. Because a standardEINVAL
handler forioctl
was used foreventfd
file descriptors, settingO_NONBLOCK
caused a failing assertion.