You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by xi...@apache.org on 2020/08/18 04:41:26 UTC

[incubator-nuttx] 02/03: sys/poll/epoll: sync the epoll_event struct layout with pollfd

This is an automated email from the ASF dual-hosted git repository.

xiaoxiang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx.git

commit 2e2ebb95ca2fad0e315dd458da59f7eb91e51d1a
Author: chao.an <an...@xiaomi.com>
AuthorDate: Thu Aug 13 17:26:34 2020 +0800

    sys/poll/epoll: sync the epoll_event struct layout with pollfd
    
    epoll(2) call broken caused by 94fe5c834904c1c2c1dfbe9e29cd5efbc7f5b284
    
    Change-Id: I0811bb7a756797651819d46236e26869559b1767
    Signed-off-by: chao.an <an...@xiaomi.com>
---
 include/sys/epoll.h | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)

diff --git a/include/sys/epoll.h b/include/sys/epoll.h
index 28771cd..b94ef0a 100644
--- a/include/sys/epoll.h
+++ b/include/sys/epoll.h
@@ -78,16 +78,22 @@ enum EPOLL_EVENTS
 
 typedef union poll_data
 {
-  FAR void    *ptr;      /* For use by drivers */
-  int          fd;       /* The descriptor being polled */
+  void        *ptr;
+  int          fd;
+  uint32_t     u32;
 } epoll_data_t;
 
 struct epoll_event
 {
   epoll_data_t data;
-  FAR sem_t   *sem;      /* Pointer to semaphore used to post output event */
   pollevent_t  events;   /* The input event flags */
   pollevent_t  revents;  /* The output event flags */
+
+  /* Non-standard fields used internally by NuttX. */
+
+  void        *reserved; /* reserved feild sync with struct pollfd */
+  FAR sem_t   *sem;      /* Pointer to semaphore used to post output event */
+  FAR void    *priv;     /* For use by drivers */
 };
 
 struct epoll_head