随笔分类 -  linux编程

linux编程
摘要:单例宏: 一个实例: 应用: 阅读全文
posted @ 2016-11-14 21:15 oucaijun 阅读(258) 评论(0) 推荐(0) 编辑
摘要:#include <QCoreApplication>#include <QDebug>#include <QTextStream>#include <QDir>#include <QFile>#include <QList>#include <QThread>#include <QtNetwork 阅读全文
posted @ 2016-11-14 11:34 oucaijun 阅读(480) 评论(0) 推荐(0) 编辑
摘要:#include <QCoreApplication>#include <QDebug>#include <QTextStream>#include <QDir>#include <QFile>#include <QList>#include <QThread>#include <QtNetwork 阅读全文
posted @ 2016-11-14 11:33 oucaijun 阅读(4336) 评论(0) 推荐(0) 编辑
摘要:场景: main函数需要两个接口,一个求和函数,一个打印函数. int sum(int i, int j); 求两个int数字的和. void show(int i, char* name); 打印i的值和它的名称. 现在,需要制作: 一个静态库libcalc.a,提供sum的接口; 一个动态库li 阅读全文
posted @ 2016-09-12 23:06 oucaijun 阅读(4573) 评论(0) 推荐(0) 编辑
摘要:如何查看程序被哪个版本编译器编译的linux-gcc http://bbs.csdn.net/topics/380000949 那是不可能的,除非你加入了调试信息,也就是编译的时候加入了-g参数,然后用gdb调试就可以显示。最大程度上查看一个elf文件信息。 { readelf -Wa a.out 阅读全文
posted @ 2016-09-03 12:53 oucaijun 阅读(9292) 评论(0) 推荐(0) 编辑
摘要://linux c: 串口设置//串口操作无非以下几个://1 打开 //2 设置串口属性//3 read write//struct termios能够表明一切串口属性,这里不详细说明.//详见 【Linux公开课】串口属性设置 http://mp.weixin.qq.com/s?src=3&ti 阅读全文
posted @ 2016-07-01 11:02 oucaijun 阅读(5398) 评论(0) 推荐(1) 编辑
摘要:那么MD5校验是什么? 一般软件或者说文件都有自己的固定文件格式或者架构信息,说简单一点就是。”世界上没有完全相同的2片叶子” ,因为MD5是一种不可逆的加密算法。 那么对于某些网上公开下载的软件,视频,尤其是镜像文件。如果被修改了可能会导致用不了或者其他的问题,发布者镜像MD5算法计算一组数值。让 阅读全文
posted @ 2016-06-07 15:56 oucaijun 阅读(2194) 评论(0) 推荐(0) 编辑
摘要://# cat treecmd.c #include #include #include #include #include #define MAXNAME 200 void s_printf(char *filename,int depth); void s_dirwalk(char *dirname,int depth,void (*fcn)(char *,int)); void ... 阅读全文
posted @ 2016-03-29 18:37 oucaijun 阅读(851) 评论(0) 推荐(0) 编辑
摘要:#include #include #include void main(void) { printf("O_ACCMODE %08x\n", O_ACCMODE ) ; printf("O_RDONLY %08x\n", O_RDONLY ) ; ... 阅读全文
posted @ 2016-03-21 14:06 oucaijun 阅读(8930) 评论(0) 推荐(0) 编辑
摘要:pthread_detach(pthread_self()) 将状态改为unjoinable状态,确保资源的释放。其实简单的说就是在线程函数头加上 pthread_detach(pthread_self())的话,线程状态改变,在函数尾部直接 pthread_exit线程就会自动退出。省去了给线程擦 阅读全文
posted @ 2016-03-04 15:36 oucaijun 阅读(959) 评论(0) 推荐(0) 编辑
摘要:分析一个socket通信: server/client1 server 1. 创建一个server_socket文件,并绑定端口,然后监听端口 (socket, bind, listen) 2. 查询该端口是否有客户端的连接: while(1) { 查询这个端口是否有来自client的消息;(acc 阅读全文
posted @ 2016-02-18 15:36 oucaijun 阅读(1430) 评论(0) 推荐(0) 编辑
摘要:1. windows下编译及使用libevent http://www.cnblogs.com/luxiaoxun/p/3603399.html 2. <<libevent学习资料>> http://blog.csdn.net/tge7618291/article/details/7698813 3 阅读全文
posted @ 2016-02-17 14:38 oucaijun 阅读(1198) 评论(0) 推荐(0) 编辑
摘要:poll调用深入解析http://blog.csdn.net/zmxiangde_88/article/details/8099049poll调用和select调用实现的功能一样,都是网络IO利用的一种机制。先看一下poll的调用形式poll调用#include int poll(struct po... 阅读全文
posted @ 2015-12-30 22:40 oucaijun 阅读(1063) 评论(0) 推荐(0) 编辑
摘要:1. core dump文件系统设置http://www.cnblogs.com/no7dw/archive/2013/02/18/2915819.html编译时需要输入-g才会生成coredump文件:gcc -g -o test test.ccore文件的生成开关和大小限制:1)使用ulimit... 阅读全文
posted @ 2015-11-12 16:09 oucaijun 阅读(793) 评论(0) 推荐(0) 编辑
摘要:1. 可重入函数与线程安全 摘自 多线程和多进程的区别(小结) http://blog.csdn.net/hairetz/article/details/4281931 要确保函数线程安全,主要需要考虑的是线程之间的共享变量。 属于同一进程的不同线程会共享进程内存空间中的全局区和堆,而私有的线程空间 阅读全文
posted @ 2015-11-11 18:19 oucaijun 阅读(3506) 评论(0) 推荐(0) 编辑

下载TeamViewer完整版 下载TeamViewer
点击右上角即可分享
微信分享提示