📄 fdwatch.h
字号:
/* fdwatch.h - header file for fdwatch package**** This package abstracts the use of the select() and/or poll() system** calls. The basic function of these calls is to watch a set of** file descriptors for activity. select() originated in the BSD world,** while poll() came from SysV land, and their interfaces are somewhat** different. fdwatch lets you write your code to a single interface,** with the portability differences hidden inside the package.**** Furthermore, if your system implements both select() and poll(),** then fdwatch will use whichever call is most advantageous. It may** actually switch back and forth at runtime, as the workload changes.**** Usage is fairly simple. Call fdwatch_get_nfiles() to initialize** the package and find out how many fine descriptors are available.** Then each time through your main loop, call fdwatch_clear(), then** fdwatch_add_fd() for each of the descriptors you want to watch,** then call fdwatch() to actually perform the watch. After it returns** you can check which descriptors are ready via fdwatch_check_fd().**** If your descriptor set hasn't changed from the last time through** the loop, you can skip calling fdwatch_clear() and fdwatch_add_fd()** to save a little CPU time.****** Copyright
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -