In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Network Security >
Share
Shulou(Shulou.com)06/01 Report--
The poll system call, like select, polls a certain number of file descriptors within a specified period of time to test whether there are any ready-for-use.
Unlike select, which uses three bitmaps to represent three fdset, poll is implemented using a pointer to a pollfd.
Poll API
1) the fds parameter is an array of pollfd structure types that specifies the readable, writable, and abnormal events that occur on all the file descriptors we are interested in.
The definition of poll structure is as follows:
The fd member specifies the file descriptor, and the events member tells poll to listen for events on the fd, which are bitwise or bitwise for a series of events.
The revents member is modified by the kernel to inform the application of what events are actually happening on the fd.
The event types supported by poll are shown in the following figure
2) the nfds parameter specifies the size of the listening time set fds. Its type nfds_t is defined as follows:
Typedef unsigned long int nfds_t
3) the timeout parameter specifies the timeout value of poll in milliseconds. When timeout is-1, the poll call will always block until an event occurs; when timeout is 0, the poll call will return immediately.
The return value of the poll system call has the same meaning as select.
Poll returns the total number of ready (readable, writable, and exception) file descriptors when successful. If no file descriptor is ready within timeout time, select returns 0. Returns-1 when poll fails and sets errno. If the program receives a signal while poll is waiting, poll immediately returns-1 and sets errno to EINTR.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.