Lines Matching refs:epHead
131 * @param epHead: epoll control head, find by epoll id .
135 static int CheckFdExist(struct epoll_head *epHead, int fd)
138 for (i = 0; i < epHead->nodeCount; i++) {
139 if (epHead->evs[i].data.fd == fd) {
150 * @param epHead: epoll control head.
153 static VOID DoEpollClose(struct epoll_head *epHead)
155 if (epHead != NULL) {
156 if (epHead->evs != NULL) {
157 free(epHead->evs);
160 free(epHead);
184 struct epoll_head *epHead = (struct epoll_head *)malloc(sizeof(struct epoll_head));
185 if (epHead == NULL) {
191 epHead->size = EPOLL_DEFAULT_SIZE;
192 epHead->nodeCount = 0;
193 epHead->evs = malloc(sizeof(struct epoll_event) * EPOLL_DEFAULT_SIZE);
194 if (epHead->evs == NULL) {
195 free(epHead);
202 fd = EpollAllocSysFd(MAX_EPOLL_FD, epHead);
205 DoEpollClose(epHead);
221 struct epoll_head *epHead = NULL;
224 epHead = EpollGetDataBuff(epfd);
225 if (epHead == NULL) {
231 DoEpollClose(epHead);
239 struct epoll_head *epHead = NULL;
244 epHead = EpollGetDataBuff(epfd);
245 if (epHead == NULL) {
257 ret = CheckFdExist(epHead, fd);
263 if (epHead->nodeCount == EPOLL_DEFAULT_SIZE) {
268 epHead->evs[epHead->nodeCount].events = ev->events | POLLERR | POLLHUP;
269 epHead->evs[epHead->nodeCount].data.fd = fd;
270 epHead->nodeCount++;
274 for (i = 0; i < epHead->nodeCount; i++) {
275 if (epHead->evs[i].data.fd != fd) {
279 if (i != epHead->nodeCount - 1) {
280 memmove_s(&epHead->evs[i], epHead->nodeCount - i, &epHead->evs[i + 1],
281 epHead->nodeCount - i);
283 epHead->nodeCount--;
290 for (i = 0; i < epHead->nodeCount; i++) {
291 if (epHead->evs[i].data.fd == fd) {
292 epHead->evs[i].events = ev->events | POLLERR | POLLHUP;
311 struct epoll_head *epHead = NULL;
318 epHead = EpollGetDataBuff(epfd);
319 if (epHead == NULL) {
329 if (maxevents > epHead->nodeCount) {
330 pollSize = epHead->nodeCount;
342 pFd[i].fd = epHead->evs[i].data.fd;
343 pFd[i].events = (short)epHead->evs[i].events;