arm-linux

http://armboard.taobao.com/

  博客园 :: 首页 :: 博问 :: 闪存 :: 新随笔 :: 联系 :: 订阅 订阅 :: 管理 ::

2010年12月6日

摘要: 孔令春 posted @ 2009年10月15日 20:57 in 内功修行 with tags pselect poll , 418 阅读 2、pselect函数 pselect函数是由POSIX发明的,如今许多Unix变种都支持它。?123456#include <sys/select.h> #include <signal.h> #include <time.h> int pselect(int maxfdp1, fd_set *readset, fd_set *writeset, fd_set *exceptset, const struct tim 阅读全文
posted @ 2010-12-06 14:50 arm-linux 阅读(1513) 评论(0) 推荐(0) 编辑

摘要: poll函数用于监测多个等待事件,若事件未发生,进程睡眠,放弃CPU控制权,若监测的任何一个事件发生,poll将唤醒睡眠的进程,并判断是什么等待事件发生,执行相应的操作。poll函数退出后,struct pollfd变量的所有值被清零,需要重新设置。 示例是使用poll函数来监测按键的输入----------------------------------------------------------------------------------------------------------驱动代码:#include <linux/config.h>#include < 阅读全文
posted @ 2010-12-06 09:23 arm-linux 阅读(2881) 评论(0) 推荐(0) 编辑