
C语言
文章平均质量分 62
zhang-guojun
这个作者很懒,什么都没留下…
展开
-
取得函数调用栈 - __builtin_frame_address
取得函数调用栈 - __builtin_frame_address (2007-08-08 13:39)分类: 库,内存,性能,系统GCC提供了两个内置函数用来在运行时取得函数调用栈中的返回地址和框架地址如果使用glibc 2.1或更新版本,可以使用bac转载 2011-10-17 20:02:50 · 9464 阅读 · 0 评论 -
netlink套接字的使用
作者: Kevin He on wed,2005-01-05 02:00原文: Kernel Korner – Why and How to Use Netlink Socket翻译: Ricky Goo (http://cn.iventor.org/people.html#ricky)网址: http://cn.iventor.org/forum/viewtopic.转载 2011-12-14 10:25:01 · 6562 阅读 · 0 评论 -
GATEWAY获取与设置(Linux C)
#include #include #include #include #include #include #include #include #include #include int set_gateway(unsigned long gw) { int skfd;转载 2012-01-02 15:47:39 · 3116 阅读 · 0 评论 -
常用控制字符ASCII码
ctrl+字母的ASCII码=字母的ASCII码&0x1f0(00) NULL 8(08) ^H 16(10) ^P 24(18) ^X1(01) ^A 9(09) ^I 17(11) ^Q 25(19) ^Y2(02) ^B 10(0A) ^J原创 2013-09-23 11:07:31 · 1987 阅读 · 1 评论 -
select,poll,epoll简介
select,poll,epoll简介selectselect本质上是通过设置或者检查存放fd标志位的数据结构来进行下一步处理。这样所带来的缺点是:1 单个进程可监视的fd数量被限制2 需要维护一个用来存放大量fd的数据结构,这样会使得用户空间和内核空间在传递该结构时复制开销大3 对socket进行扫描时是线性扫描转载 2014-01-20 16:18:19 · 771 阅读 · 0 评论 -
How to use list from sys/queue.h?
LIST_ENTRY creates fields to put into your structure that are suitable for linking the elements, so you do not have to concern yourself with the specifics of those pointers.struct foo { int a, b转载 2014-02-06 19:14:30 · 1290 阅读 · 0 评论 -
如何使用epoll?一个完整的C例子
网络服务器传统上采用每个连接使用一个进程/线程的方式实现。但是由于资源使用和上下文切换时间等因素的影响,限制了服务器的并发能力,因此这种实现方式不适合那些需要处理并发的大量客户端请求的高性能应用。一个解决办法是在单线程上使用非阻塞I/O,以及准备就绪通知方法,它在可以从套接字上读或写更多数据时通知你。本文介绍Linux的 epoll 机制,它是Linux下最好的准备就绪通知机制。我们将用C给出转载 2017-11-26 14:26:15 · 1402 阅读 · 1 评论