See here
This PR fixes a bug introduced by the merge of #2184.
The bug was introduced by an unintentional change in the behaviour of the SysFsDriver, that utilizes the native epoll_wait function to discard not needed events.
Originally the binding of epoll_wait was implemented as
public static extern int epoll_wait(int epfd, out epoll_event events, int maxevents, int timeout);
which does not fully match the native function
int epoll_wait(int epfd, struct epoll_event *events, int maxevents, int timeout);
because events is a pointer to an array.
Some new functionality in #2184 relies on epoll_wait, what prompted me to correct the binding.
As a consequence I had to update calls in the SysFsDriver, but mistakenly passed IntPtr.Zero to epoll_wait, which does not seem to result in the same behaviour. The fix is to pass an actual buffer instead.
This PR also includes some additional "using" statements in the GpioControllerTestBase because during testing, some sporadic occurrences of PermissionDeniedException occured. It complained about not having root permission for changing GPIO mode of used GPIOs. I'm pretty sure that was because of not yet disposed SysFsDriver instance/s.
See here This PR fixes a bug introduced by the merge of #2184. The bug was introduced by an unintentional change in the behaviour of the SysFsDriver, that utilizes the native epoll_wait function to discard not needed events. Originally the binding of
epoll_wait
was implemented aspublic static extern int epoll_wait(int epfd, out epoll_event events, int maxevents, int timeout);
which does not fully match the native functionint epoll_wait(int epfd, struct epoll_event *events, int maxevents, int timeout);
becauseevents
is a pointer to an array.Some new functionality in #2184 relies on epoll_wait, what prompted me to correct the binding. As a consequence I had to update calls in the SysFsDriver, but mistakenly passed IntPtr.Zero to epoll_wait, which does not seem to result in the same behaviour. The fix is to pass an actual buffer instead.
This PR also includes some additional "using" statements in the GpioControllerTestBase because during testing, some sporadic occurrences of PermissionDeniedException occured. It complained about not having root permission for changing GPIO mode of used GPIOs. I'm pretty sure that was because of not yet disposed SysFsDriver instance/s.
Microsoft Reviewers: Open in CodeFlow