
C
文章平均质量分 63
一个手艺人
喜欢底层技术,平时主要使用C语言,也对汇编,Go,Bash有一定了解。
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
libumem使用和源码分析系列文章(一)
libumem是2001年由SUN的工程师Jeff Bonwick和Jonathan Adams开发的一个对应用程序进行内存管理的动态链接库。从Solaris 9(Update 3)开始,libumem作为Solaris操作系统的一个标准库,可以供Solaris上运行的应用程序使用。现在libumem已经被移植到其它的平台上,这个网站(https://labs.omniti.com/lab原创 2014-01-04 18:33:34 · 2354 阅读 · 0 评论 -
UNIX/Linux C 程序员需要掌握的七种武器
我是一名普通的软件工程师,不是什么技术大牛。这篇文章所提到的“七种武器”只是我这些年工作经验的一点体会和感悟,如果有错误的地方,还请大家指正。(一)C语言作为一名C程序员,熟练掌握C语言是最基本的一项技能。关于如何学好C语言,以及C语言话题的讨论,网上有很多经典的文章,我就不一一列举了。在这里,我只想谈一点我个人的体会:刚毕业时,我来到一家比较大的软件公司工作,而公司的工作原创 2014-09-21 10:27:49 · 1148 阅读 · 0 评论 -
C programming tips in SPARC architecture
If you are a newbie of C programmers in SPARC architecture (For example, working on Solaris), you should pay attention to the following tips:(1) By default, SPARC is big-endian. It means for an原创 2014-05-28 18:20:54 · 925 阅读 · 0 评论 -
An experience of fixing a memory-corruption bug (3)
(7) Use ,mp原创 2014-04-26 19:20:52 · 983 阅读 · 0 评论 -
Solaris搭建64位C语言开发环境
刚来公司时,公司的C程序还是32位的。后来我阅读了一些资料,觉得64位的程序才是真正的趋势,所以就开始尝试着开发64位的程序。这篇文章介绍如何在Solaris下搭建64位C语言开发环境,希望给需要的朋友一点帮助。(1)gccSolaris的/usr/sfw/bin/gcc可以用来编译64位C程序,但是需要加-m64编译选项。此外也可以从gcc的官网下载gcc源代码,自行编译安装,但是要注意原创 2014-02-15 15:58:29 · 1763 阅读 · 0 评论 -
An experience of fixing a memory-corruption bug (2)
(4) Asking for原创 2014-04-20 16:06:42 · 1023 阅读 · 0 评论 -
An experience of fixing a memory-corruption bug (1)
During the last 4 months, I was disturbed by a memory-corruption bug, and this bug will cause program crash. Until last Monday, I found the root cause and fixed it. This debug process is a difficult b原创 2014-04-13 19:45:06 · 1227 阅读 · 0 评论 -
Socket programming tips in Solaris
I sponsored a topic in stackoverflow.com, and hoped the programmers can share the socket programming tips in different UNIX flavors. But unfortunately, the responders are few. So I can only share my原创 2014-03-08 12:41:02 · 1487 阅读 · 0 评论 -
libumem使用和源码分析系列文章(二)
在使用libumem时,大家可能都有一点好奇,为什么系统会使用libumem封装的malloc,free这些内存管理函数去替换libc中的内存管理函数?其实答案就在malloc.c中的如下代码:#ifdef __GLIBC__static void __attribute__((constructor)) umem_malloc_init_hook(void){ if (__mall原创 2014-02-01 11:50:28 · 2224 阅读 · 0 评论 -
一个变量越界导致破坏堆栈的bug
前一段时间在商用系统上出现了core dump,原因是由于一个局部变量写越界导致堆栈被破坏了。在这里,我把这个bug分享一下,希望给需要的朋友一点帮助。简化的代码如下:typedef struct{ ......} A;void func1(char *p){ ......}void main(void){ A a; A *p = &a; char b[10];原创 2014-01-25 12:31:44 · 5281 阅读 · 0 评论 -
Chinaunix论坛“Linux/UNIX系统编程,系统程序员成长的基石?”话题讨论的回复
以下是我参与Chinaunix论坛关于“Linux/UNIX系统编程,系统程序员成长的基石?”(http://bbs.chinaunix.net/forum.php?mod=viewthread&tid=4118545&fromuid=28864581)话题讨论的回复,整理出来,发到这里,给需要的人做个参考:(1) 您在Linux/UNIX系统编程行业的经历及经验我是2006年研究原创 2014-01-12 15:11:16 · 2565 阅读 · 0 评论 -
为什么gcc在64位Solaris上编译出来的程序默认是32位的?
最近发现一个问题,gcc在原创 2014-08-31 16:50:08 · 1725 阅读 · 0 评论