代码改变世界

automake,autoconf使用详解

2015-09-17 09:35 by TLLED, 390 阅读, 0 推荐, 收藏,
摘要:作为Linux下的程序开发人员,大家一定都遇到过Makefile,用make命令来编译自己写的程序确实是很方便.一般情况下,大家都是手工写一个简单Makefile,如果要想写出一个符合自由软件惯例的Makefile就不那么容易了.在本文中,将给大家介绍如何使用autoconf和automake两个工... 阅读全文

嵌入式linux驱动程序 -- LED驱动

2013-09-24 22:00 by TLLED, 250 阅读, 0 推荐, 收藏,
摘要:LED--linux驱动程序 1 //zhui_led.c 2 #include 3 #include 4 #include 5 #include 6 #include 7 #include 8 #include 9 #include 10 #include 11 #include 12 #include 13 14 #include 15 16 #define DEVICE_NAME "ZHUI_LED" 17 #define LED_MAJOR 230 18 19 int major = 0;... 阅读全文

文件I/O口编程 -- fcntl使用实例

2013-09-24 21:03 by TLLED, 261 阅读, 0 推荐, 收藏,
摘要://lock_set.c#include #include #include void lock_set(int fd, int type){ struct flock lock; lock.l_whence = SEEK_SET; lock.l_start = 0; lock.l_len = 0; while(1) { lock.l_type = type; if( (fcntl(fd, F_SETLK, &lock))==0) { if(lock.l_type == F_RDLCK) { ... 阅读全文