![](https://img-blog.csdnimg.cn/20201014180756919.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
linux编程
文章平均质量分 63
Hayz
没有
展开
-
Linux之GCC经典入门教程
准备工作注意:本文可能会让你失望,如果你有下列疑问的话:为什么要在终端输命令啊? GCC 是什么东西,怎么在菜单中找不到? GCC 不能有像 VC 那样的窗口吗?…… 那么你真正想要了解的可能是 anjuta,kdevelop,geany,code blocks,eclipse,netbeans 等 IDE 集成开发环境。即使在这种情况下,由于 GCC 是以上 IDE 的后台的编译器,转载 2017-10-24 21:21:47 · 1320 阅读 · 0 评论 -
list_for_each & list_entry & 对内核链表的理解
一、list_for_each1.list_for_each原型#define list_for_each(pos, head) \ for (pos = (head)->next, prefetch(pos->next); pos != (head); \ pos = pos->next, prefetch(pos->next))它实际上是一个 for 循环,转载 2017-11-26 09:45:48 · 447 阅读 · 0 评论 -
pthread_cleanup_push() & pthread_cleanup_pop()
pthread_cleanup_push() 一般用于线程结束时回调一些函数,push顾名思义向stack中压入一个函数。通过宏展开实现,展开后带有一个{pthread_cleanup_pop() 一般就设成0了,用于和push匹配,宏展开后带有},如果不一一对应,编译一定会报错,因为{}不匹配。stack内的函数只有在以下条件下会被调用线程通过pthread_e原创 2017-11-20 17:28:06 · 286 阅读 · 0 评论 -
Condition Variables 条件变量
pthread_cond_wait(pthread_cond_t *, pthread_mutex *)等待一个条件变量,并且释放传入的mutex锁标准的用法就是pthread_mutex_lock(&mutex);while(xxx)pthread_cond_wait(&cond, &mutex);pthread_mutex_unlock(&mutex);其中原创 2017-11-21 14:01:29 · 253 阅读 · 0 评论 -
next_task & current & for_each_process
next_task宏定义为:#define next_task(p) list_entry(rcu_dereference((p)->tasks.next), struct task_struct, tasks)获取下一个PCB指针-------------------------------------------------------------------原创 2017-11-26 14:02:17 · 1565 阅读 · 0 评论 -
linux /proc文件系统_seq_file
转自http://blog.csdn.net/bullbat/article/details/7407194作者:bullbat seq_file机制提供了标准的例程,使得顺序文件的处理好不费力。小的文件系统中的文件,通常用户层是从头到尾读取的,其内容可能是遍历一些数据项创建的。Seq_file机制容许用最小代价实现此类文件,无论名称如何,但顺序文件转载 2017-11-27 22:06:11 · 345 阅读 · 0 评论