Skip to content

std.posix defines non-posix symbols #20563

Closed as not planned
Closed as not planned
@arminfriedl

Description

@arminfriedl

I think there are symbols defined in std.posix that are not actually defined (as such) by POSIX. I used the standards documents available at [1] for this.

The definition that started this was

pub const port_t = system.port_t;

Should this be renamed to std.posix.in_port_t? I couldn't find any mention of port_t in the POSIX standard. The closest is in_port_t which should be defined in the arpa/inet.h and netinet/in.h headers. port_t itself seems Solaris specific, but not POSIX.

In a similar vein there are

zig/lib/std/posix.zig

Lines 135 to 136 in 854e86c

pub const port_event = system.port_event;
pub const port_notify = system.port_notify;

Both of which again seem to be exist somehow in Solaris, however they do not appear to be defined in POSIX.

There might be others too.

I dunno if this was done on purpose or something, but I guess these (and other similar ones) should be renamed/removed from std.posix? The straight-forward solution is a breaking change though, obviously.

[1] https://pubs.opengroup.org/onlinepubs/9699919799/download/index.html

Metadata

Metadata

Assignees

No one assigned

    Labels

    standard libraryThis issue involves writing Zig code for the standard library.

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions