| | 103 | |
| | 104 | * [http://stackoverflow.com/questions/14028401/how-to-use-epoll-with-data-ptr-instead-of-data-fd how to use epoll with data->ptr, instead of data.fd? - Stack Overflow] |
| | 105 | > You can put whatever you want in data. It's not used by epoll itself, it just returns it when the event occurs on the fd specified in the argument list. |
| | 106 | * epoll_event構造体は以下のように定義されていた |
| | 107 | > {{{#!c |
| | 108 | > typedef union epoll_data { |
| | 109 | > void *ptr; |
| | 110 | > int fd; |
| | 111 | > uint32_t u32; |
| | 112 | > uint64_t u64; |
| | 113 | > } epoll_data_t; |
| | 114 | > |
| | 115 | > struct epoll_event { |
| | 116 | > uint32_t events; /* epoll イベント */ |
| | 117 | > epoll_data_t data; /* ユーザデータ変数 */ |
| | 118 | > }; |
| | 119 | > }}} |