-
Notifications
You must be signed in to change notification settings - Fork 18.8k
Description
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.