Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Support OpenBSD. #559
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
Support OpenBSD. #559
Changes from all commits
1483bf0
99fce10
d37d2fa
fff4945
413ed24
3d7728e
05e05e9
18ffbd6
c4814ec
ce4ef87
937f309
207ed9e
f0f7799
04ab2a4
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
This feels a bit ... worrisome to me. If this ever gets re-ordered, we will have a subtle way to change the semantics. Currently
__linux__
will definedispatch_runloop_handle_t
toint
rather thanuint64_t
. Is there a reason to prefer the__unix__
spelling here over__OpenBSD__
?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.
The runloop implementation is POSIX-portable, it just uses pipe2; it is not OpenBSD-specific, hence the
__unix__
spelling.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.
Adding the conditional twice here is a little kludgy but I don't know if we want to refactor that further right now.
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.
Do we need to worry about truncation? IIRC, a timer on Windows would be a
HANDLE
which would be truncated byuint32_t
as it should beuintptr_t
.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.
du_ident
on Windows is indeed auintptr_t
, as it is on OpenBSD. The timer index here is auint32_t
, so as written there is already a truncation occurring.du_ident
is already initialized in various places from_dispatch_timer_unote_idx
which returns anunsigned int
, but here we accessdu_ident
directly, which is not guaranteed to be 32-bit wide.Casting here just suppresses the error. I don't think there is actually a problem here on looking how du_ident is used in this module; the 32-bit assumption is baked a little hard in the timer code and disentangling that should be handled separately.
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.
This won't be defined on all platforms (e.g. Windows).
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.
Right, but Windows is using src/event/event_windows.c. This entire file gets #ifdef'd out on Windows.
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.
But, you can use the kevent backend on Windows with libkqueue.
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.
Okay, I've just changed this to
!defined
instead.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.
Actually -- that is wrong. NOTE_ABSOLUTE is defined in event_kevent.h, and is set to 0 if it is undefined. I'm going to go back to
!NOTE_ABSOLUTE
, since the change caused problems.