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

Add a port_getn_query function. #1216

Merged
merged 3 commits into from
Nov 18, 2024
Merged

Add a port_getn_query function. #1216

merged 3 commits into from
Nov 18, 2024

Conversation

sunfishcode
Copy link
Member

The solarish port_getn function special-cases a max argument value of 0 to be a query of the number of events available. #1215 added a special-case to protect the code from doing a resize in that case. And in case users actually do want to do a query, this PR adds a new port_getn_query function that passes a zero.

The solarish [`port_getn` function] special-cases a `max` argument value
of 0 to be a query of the number of events available. #1215 added a
special-case to protect the code from doing a resize in that case. And
in case users actually do want to do a query, this PR adds a new
`port_getn_query` function that passes a zero.

[`port_getn` function]: https://illumos.org/man/3C/port_getn
src/event/port.rs Outdated Show resolved Hide resolved
Co-authored-by: 王宇逸 <[email protected]>
Copy link
Contributor

@Berrysoft Berrysoft left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm expecting a new publish for the fixes to port_getn.

@sunfishcode sunfishcode merged commit 41b26db into main Nov 18, 2024
45 checks passed
@sunfishcode sunfishcode deleted the sunfishcode/port-getn branch November 18, 2024 18:30
sunfishcode added a commit that referenced this pull request Nov 18, 2024
* Add a `port_getn_query` function.

The solarish [`port_getn` function] special-cases a `max` argument value
of 0 to be a query of the number of events available. #1215 added a
special-case to protect the code from doing a resize in that case. And
in case users actually do want to do a query, this PR adds a new
`port_getn_query` function that passes a zero.

[`port_getn` function]: https://illumos.org/man/3C/port_getn

* Fix errors.

* Update src/event/port.rs

Co-authored-by: 王宇逸 <[email protected]>

---------

Co-authored-by: 王宇逸 <[email protected]>
sunfishcode added a commit that referenced this pull request Nov 18, 2024
* Add a `port_getn_query` function.

The solarish [`port_getn` function] special-cases a `max` argument value
of 0 to be a query of the number of events available. #1215 added a
special-case to protect the code from doing a resize in that case. And
in case users actually do want to do a query, this PR adds a new
`port_getn_query` function that passes a zero.

[`port_getn` function]: https://illumos.org/man/3C/port_getn

* Fix errors.

* Update src/event/port.rs

Co-authored-by: 王宇逸 <[email protected]>

---------

Co-authored-by: 王宇逸 <[email protected]>
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.

2 participants