Skip to content

x/sys/unix: standardize Kevent_t Udata as integer, not pointer #32153

@wI2L

Description

@wI2L

unix.SetKevent only takes mode(eg. Filter field) and flags parameter.

Other fields also have different types depending on the ach/platform, say Udata which is either a *byte or a int32.

Since Go1 compat promise prevent us from changing the SetKevent function, perhaps it could be feasible to add new methods to the Kevent_t type to set the others fields, similar to *Iovec.SetLen for example.

Fflags and Data methods looks straightforward to implement, on the model of SetKevent, since types are integers on all platforms/archs.

However, so far, I am unsure about the type of the Udata parameter for the eponym method. I typically would do kev.Udata = (*byte)(unsafe.Pointer(&foobar)) on my own currently for darwin/amd64, but I guess that exposing unsafe.Pointer as a parameter type is not a good solution.

Metadata

Metadata

Assignees

No one assigned

    Labels

    NeedsFixThe path to resolution is known, but the work has not been done.help wanted

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions