Skip to content

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
Co-authored-by: 王宇逸 <Strawberry_Str@hotmail.com>
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: 王宇逸 <Strawberry_Str@hotmail.com>

---------

Co-authored-by: 王宇逸 <Strawberry_Str@hotmail.com>
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: 王宇逸 <Strawberry_Str@hotmail.com>

---------

Co-authored-by: 王宇逸 <Strawberry_Str@hotmail.com>
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.

3 participants