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:25 UTC

[incubator-nuttx] 01/03: sys/epoll: move the private handle to epoll_data_t

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 155860ad151967f7344769b2835042dfbbc4e5c1
Author: chao.an <an...@xiaomi.com>
AuthorDate: Tue Aug 11 21:44:57 2020 +0800

    sys/epoll: move the private handle to epoll_data_t
    
    sync the struct epoll_event define with linux:
    
    Linux Programmer's Manual:
    
    DESCRIPTION
    
      EPOLL_CTL_DEL
        ...
           The event argument describes the object linked to the file descriptor
           fd.  The struct epoll_event is defined as:
    
               typedef union epoll_data {
                   void        *ptr;
                   int          fd;
                   uint32_t     u32;
                   uint64_t     u64;
               } epoll_data_t;
    
               struct epoll_event {
                   uint32_t     events;      /* Epoll events */
                   epoll_data_t data;        /* User data variable */
               };
    
    https: //man7.org/linux/man-pages/man2/epoll_ctl.2.html
    
    Change-Id: I3ad447b485fd331190e461a198ef7c39301eb1bb
    Signed-off-by: chao.an <an...@xiaomi.com>
---
 include/sys/epoll.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/sys/epoll.h b/include/sys/epoll.h
index 672dc19..28771cd 100644
--- a/include/sys/epoll.h
+++ b/include/sys/epoll.h
@@ -78,6 +78,7 @@ enum EPOLL_EVENTS
 
 typedef union poll_data
 {
+  FAR void    *ptr;      /* For use by drivers */
   int          fd;       /* The descriptor being polled */
 } epoll_data_t;
 
@@ -87,7 +88,6 @@ struct epoll_event
   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 */
-  FAR void    *priv;     /* For use by drivers */
 };
 
 struct epoll_head