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

Isolate solaris event completion #20662

Conversation

arminfriedl
Copy link

The event completion framework of Solaris is in some way the Solaris alternative to kqueue and epoll [1]. It it is, however, specific to Solaris and afaik not implemented anywhere else in that way. Especially, it is not part of POSIX or some libc implementations that I am aware of.

Move symbols related to the Solaris event completeion framework (port_*) to solaris.zig and remove from posix.zig and the general c.zig.

Note that, in case of a Solaris build the respective symbols will be still available by means of usingnamespace in c.zig. This seems sufficient given that any direct use of the event completion API will anyways only work on Solaris.

Especially, in case of port_t putting this into posix.zig can be considered harmful. It is all to easy to mistake for POSIX's in_port_t [2,3], which is
semantically wrong.

resolves #20563

[1] Solaris Event Completion: https://web.archive.org/web/20120819060517/http://developers.sun.com/solaris/articles/event_completion.html
[2] Not available in posix.zig currently. Might be another issue?
[3] POSIX standard this is based on: https://pubs.opengroup.org/onlinepubs/9699919799/download/index.html

The event completion framework of Solaris is in some way the Solaris
alternative to `kqueue` and `epoll` [1]. It it is, however, specific to
Solaris and afaik not implemented anywhere else in that way. Especially,
it is not part of POSIX or some libc implementations that I am aware of.

Move symbols related to the Solaris event completeion
framework (`port_*`) to `solaris.zig` and remove from `posix.zig` and
the general `c.zig`.

Note that, in case of a Solaris build the respective symbols will be
still available by means of `usingnamespace` in `c.zig`. This seems
sufficient given that any direct use of the event completion API will
anyways only work on Solaris.

Especially, in case of `port_t` putting this into `posix.zig` can be
considered harmful. It is all to easy to mistake for POSIX's
`in_port_t` [2,3], which is
semantically wrong.

resolves ziglang#20563

[1] Solaris Event Completion: https://web.archive.org/web/20120819060517/http://developers.sun.com/solaris/articles/event_completion.html
[2] Not available in `posix.zig` currently. Might be another issue?
[3] POSIX standard this is based on: https://pubs.opengroup.org/onlinepubs/9699919799/download/index.html
@andrewrk
Copy link
Member

andrewrk commented Jul 21, 2024

Let's continue discussion on the issue. This PR cannot be merged as-is due to conflicts with #20679. Those conflicts are related; it should indicate how to proceed with this PR.

@andrewrk andrewrk closed this Jul 21, 2024
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.

std.posix defines non-posix symbols
2 participants