I suggest adding an explicit timeout return code for zesDriverEventListen[Ex] calls. Right now, the user has to infer a timeout occurred when ze_result_t == ZE_SUCCESS and pNumDeviceEvents = 0. The specification isn't 100% clear that a timeout will result in the pNumDeviceEvents being cleared. An explicit error code leaves no doubt. The spec is also ambitious in stating that the timeout will only occur once the time expires. It seems like an -EINTR or similar type error could cause a timeout to occur before the time expires. Perhaps the spec should allow for a timeout to occur before the time expires?
It should be noted that ZE_RESULT_NOT_READY is mentioned as a return code for the function in the timeout parameter documentation, but does not appear as a valid return code for the function.
I suggest adding an explicit timeout return code for zesDriverEventListen[Ex] calls. Right now, the user has to infer a timeout occurred when ze_result_t == ZE_SUCCESS and pNumDeviceEvents = 0. The specification isn't 100% clear that a timeout will result in the pNumDeviceEvents being cleared. An explicit error code leaves no doubt. The spec is also ambitious in stating that the timeout will only occur once the time expires. It seems like an -EINTR or similar type error could cause a timeout to occur before the time expires. Perhaps the spec should allow for a timeout to occur before the time expires?
https://spec.oneapi.com/level-zero/latest/sysman/api.html#zesdrivereventlistenex