[共享空间] 记录一下自己第一个成功的linux代码

[复制链接]
3232|1
 楼主| kyzb001 发表于 2011-12-29 17:20 | 显示全部楼层 |阅读模式
本帖最后由 kyzb001 于 2011-12-29 17:32 编辑

非常感谢二个同事! 哈哈 记录一下,第一个linux代码...

  1. #include <sys/stat.h>
  2. #include <fcntl.h>
  3. #include <termios.h>
  4. #include <errno.h>
  5. #include <ctype.h>
  6. #include <stdio.h>
  7. #include <stdlib.h>
  8. #include <string.h>
  9. #include <time.h>
  10. #include <unistd.h>
  11. #include"pthread.h"
  12. int main()
  13. {
  14.         static serial_fd;
  15.         serial_fd=open("/dev/tq2440_serial0",O_RDWR,0);
  16.         write(serial_fd,"hello world.\n",13);
  17.         close(serial_fd);
  18. }




万恶的天嵌,同志们别买TQ了!!!!
毅如靳往 发表于 2012-1-2 13:52 | 显示全部楼层
恭喜楼主的成长  再接再厉
您需要登录后才可以回帖 登录 | 注册

本版积分规则

个人签名:Is this my life

15

主题

624

帖子

1

粉丝
快速回复 在线客服 返回列表 返回顶部