From 8cd2925f93aa112e8b678bf9d16949073a334b97 Mon Sep 17 00:00:00 2001 From: Eao3piq4e Date: Mon, 8 Aug 2022 17:57:55 +0800 Subject: [PATCH] Update comm_proxy.cpp --- .../communication/comm_proxy/comm_proxy.cpp | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/src/gausskernel/cbb/communication/comm_proxy/comm_proxy.cpp b/src/gausskernel/cbb/communication/comm_proxy/comm_proxy.cpp index 15d916ce3..fcee84d5c 100644 --- a/src/gausskernel/cbb/communication/comm_proxy/comm_proxy.cpp +++ b/src/gausskernel/cbb/communication/comm_proxy/comm_proxy.cpp @@ -865,7 +865,7 @@ description: This system call performs control operations on the epoll instance arguments: The first argument is a specific file descriptor for epoll generated by epoll_ create. The second argument indicates the actions to be taken, such as registering events. The third argument is associated file descriptor. - The fourth argument is a pointer of type struct epoll_event. + The fourth argument is a pointer of type struct epoll_event, used to tell the kernel what events and actions to listen for. return value: The return value is 0 if succeed, - 1 is returned for failure and error reason is stored in errno. note: none date: 2022/8/8 @@ -1110,6 +1110,23 @@ int comm_proxy_epoll_ctl(int epfd, int op, int fd, struct epoll_event* event) return result.s_ret; } +/* +function name: comm_proxy_epoll_wait +description: Wait for IO events on the specified epoll file descriptor. +arguments: The first argument is a specific file descriptor for epoll generated by epoll_ create. + The second argument is a pointer to type epoll_ event structure, but it is now used + as a container to get the collection of events from the kernel. + The third argument is used to tell how large the container is (number of event + array members), that is, the number of events that can be processed each time. + The fourth argument is the timeout value for waiting for IO events. +return value: When successful, comm_proxy_epoll_wait() returns the number of file descriptors + ready for the requested IO. Returns zero if no file descriptor is ready within the + requested timeout milliseconds. When an error occurs, comm_proxy_epoll_wait() + returns - 1 and sets errno correctly. +note: none +date: 2022/8/8 +contact tel: 18720816902 +*/ int comm_proxy_epoll_wait(int epfd, struct epoll_event* events, int maxevents, int timeout) { CommWaitEpollWaitParam param;