随笔分类 -  linux_program

linux program
摘要:http://www.cnblogs.com/hjslovewcl/archive/2011/03/16/2314330.html http://blog.csdn.net/lingfengtengfei/article/details/12392449 http://blog.csdn.net/t 阅读全文
posted @ 2017-05-28 13:32 soul.stone 阅读(235) 评论(0) 推荐(0)
摘要:#include union { int number; char s; } test; int SYS_IS_BIGENDIAN() { test.number = 0x01000002; return (test.s == 0x01); } int main(int argc, char **argv) { if (SYS_IS_BI... 阅读全文
posted @ 2017-05-28 13:31 soul.stone 阅读(138) 评论(0) 推荐(0)
摘要:#include #include #include #include #include #include #include #include #include #include #if 1 int msg_qid; pthread_t recv_thread; typedef struct msgbuf { long msgtype; char ... 阅读全文
posted @ 2017-05-20 23:22 soul.stone 阅读(443) 评论(0) 推荐(0)
摘要:thread_2: pid=0x741 tid=0x743 self=0x85254700thread_2: my_var=9 addr=0x852546fc thread_1: pid=0x741 tid=0x742 self=0x85a55700thread_1: my_var=8 addr=0 阅读全文
posted @ 2017-05-20 23:09 soul.stone 阅读(202) 评论(0) 推荐(0)
摘要:http://blog.csdn.net/ljianhui/article/details/10253345 1、shmget函数 该函数用来创建共享内存,它的原型为: [cpp] view plain copy print? int shmget(key_t key, size_t size, i 阅读全文
posted @ 2017-04-21 23:11 soul.stone 阅读(308) 评论(0) 推荐(0)
摘要:其中,参数 fd 表示文件描述符;参数 operation 指定要进行的锁操作,该参数的取值有如下几种:LOCK_SH, LOCK_EX, LOCK_UN 和 LOCK_MAND LOCK_SH:表示要创建一个共享锁,在任意时间内,一个文件的共享锁可以被多个进程拥有 LOCK_EX:表示创建一个排他 阅读全文
posted @ 2017-04-21 22:44 soul.stone 阅读(1465) 评论(0) 推荐(0)
摘要:一、命名管道(FIFO) 匿名管道应用的一个限制就是只能在具有共同祖先(具有亲缘关系)的进程间通信。如果我们想在不相关的进程之间交换数据,可以使用FIFO文件来做这项工作,它经常被称为命名管道。 命名管道可以从命令行上创建,命令行方法是使用下面这个命令:$ mkfifo filename命名管道也可 阅读全文
posted @ 2017-04-21 21:51 soul.stone 阅读(417) 评论(0) 推荐(0)
摘要:int pthread_cond_wait(pthread_cond_t *cond, pthread_mutex_t *mutex)int pthread_cond_timedwait(pthread_cond_t *cond, pthread_mutex_t *mutex, const stru 阅读全文
posted @ 2017-04-19 21:55 soul.stone 阅读(151) 评论(0) 推荐(0)
摘要:http://blog.csdn.net/gdujian0119/article/details/6911620 阅读全文
posted @ 2017-04-19 12:01 soul.stone 阅读(127) 评论(0) 推荐(0)
摘要:1、内核态struct uio_info irq_info ={ .name = "fpga_irq2", .version = "0.1", .irq = 155, .irq_flags = IRQ_TYPE_LEVEL_HIGH | IRQF_SHARED | IRQF_DISABLED, .h 阅读全文
posted @ 2017-04-17 09:31 soul.stone 阅读(1407) 评论(0) 推荐(0)
摘要:1,内核代码 2,测试代码 阅读全文
posted @ 2017-04-16 20:41 soul.stone 阅读(1273) 评论(0) 推荐(0)
摘要:1,内核代码 2,用户代码 3,测试脚本 阅读全文
posted @ 2017-04-16 14:20 soul.stone 阅读(1175) 评论(0) 推荐(0)
摘要:内核态: 用户态: 测试结果: 阅读全文
posted @ 2017-04-15 22:30 soul.stone 阅读(2860) 评论(0) 推荐(0)
摘要:参考代码: 测试: 阅读全文
posted @ 2017-04-15 21:35 soul.stone 阅读(293) 评论(0) 推荐(0)
摘要:http://blog.chinaunix.net/uid-20543672-id-3211832.html http://smilejay.com/2011/12/linux_loglevel/ 阅读全文
posted @ 2017-04-12 11:21 soul.stone 阅读(134) 评论(0) 推荐(0)
摘要:初始化:1、open文件2、write 1M空数据到文件3、mmap文件,ptr作为写指针4、关闭文件 阅读全文
posted @ 2017-04-10 14:01 soul.stone 阅读(640) 评论(0) 推荐(0)
摘要:http://pubs.opengroup.org/onlinepubs/009695399/functions/sigaction.html 阅读全文
posted @ 2017-04-08 21:44 soul.stone 阅读(137) 评论(0) 推荐(0)
摘要:#include <pthread.h> pthread_mutex_t mutex = PTHREAD_MUTEX_INITIALIZER;int pthread_mutex_init (pthread_mutex_t *mutex , pthread_mutexattr_t * attr );i 阅读全文
posted @ 2017-04-08 21:34 soul.stone 阅读(318) 评论(0) 推荐(0)
摘要:http://www.cnblogs.com/hoys/archive/2012/08/19/2646377.html #include <signal.h> typedef void (*sighandler_t)(int);sighandler_t signal(int signum, sigh 阅读全文
posted @ 2017-04-08 21:33 soul.stone 阅读(222) 评论(0) 推荐(0)
摘要:http://blog.csdn.net/ljianhui/article/details/10287879 #include <sys/type.h>#include <sys/ipc.h>#include <sys/msg.h>int msgget(key_t key, int flag);in 阅读全文
posted @ 2017-04-08 20:59 soul.stone 阅读(267) 评论(0) 推荐(0)