![](https://img-blog.csdnimg.cn/20201014180756928.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
Linux编程笔记
文章平均质量分 79
杨过悔
这个作者很懒,什么都没留下…
展开
-
第二章Linux文件IO编程
#include #include #include #include #define N 64int main(int argc, char *argv[]){ int fds, fdt, nbyte; char buf[N]; if (argc < 3) { printf("Usage : %s \n", argv[0]); return -1; }原创 2014-11-08 11:37:30 · 410 阅读 · 0 评论 -
select多路复用
1.在socket的使用中我们经常用多路复用的方式来避免使用while的循环查询监听,至于如何使用详细的请看man 2 selectint select(int nfds, fd_set *readfds, fd_set *writefds, fd_set *exceptfds, struct timeval *timeout);nfds:被监原创 2016-01-24 23:09:43 · 479 阅读 · 0 评论 -
AT汇编常见命令
1.section 命令作用是定义内存段.section .text #定义文本段(代码段) .section .data #定义数据段(数据段通常是指用来存放程序中已初始化的全局变量的一块内存区域) .section .bss #定义 bss 段(通常是指用来存放程序中未初始化的全局变量的一块内存区域)2.glo原创 2016-01-20 12:25:54 · 1357 阅读 · 0 评论 -
GCC关于内联的问题
1.没有内联的情况#include void f() { printf("hello\n");}int main() { f();// void (*g)() = f;// g();} .file "inline.c" .section .rodata.LC0: .string "hello" .text.原创 2016-01-21 16:42:53 · 957 阅读 · 0 评论 -
vim 常用快捷键
http://sundful.iteye.com/blog/1767233 键盘移动 (Move)一切都从键盘的移动k -> 上 upj -> 下 downh -> 左 leftl -> 右 rightz -> 重画屏幕,当前光标变成屏幕的第一行 (redraw current line at top of window)CTRL-f -> 跳到下一页 (pag转载 2016-01-21 11:45:32 · 402 阅读 · 0 评论 -
第五章Linux消息队列
华清实验教材的demo简单易懂#include #include #include #include #include #include #include #include #define N 64#define TypeA 100#define TypeB 200#define LEN (sizeof(MSG) - sizeof(long))typed原创 2014-12-13 22:23:51 · 389 阅读 · 0 评论 -
第四章Linux多线程简单Demo
#include #include #include #include #include #include #define N 64char buf[N];sem_t sem_r;sem_t sem_w;void *thread_function(void *arg);int main(){ pthread_t a_thread; sem_ini原创 2014-12-13 16:44:36 · 385 阅读 · 0 评论 -
第一章Linux标准IO编程
一.实例一 mycp_1.c#include #include #include int main(int argc, char *argv[]){ FILE *fps, *fpd; int c; if (argc < 3) { printf("Usage : %s \n", argv[0]); return -1; } if ((fps = f原创 2014-11-08 11:35:24 · 490 阅读 · 0 评论 -
第三章Linux网络基础编程
源码来源于华清1.TCP编程客户端(同一个网段就可以通信),过程详细的得看具体的数据,在这只是个简单的模版,方便自己查阅#include #include #include #include #include #include #include #define N 64typedef struct sockaddr SA;int main(int argc, c原创 2014-12-13 16:37:37 · 455 阅读 · 0 评论 -
linux sed命令详解
http://www.cnblogs.com/ggjucheng/archive/2013/01/13/2856901.html简介sed 是一种在线编辑器,它一次处理一行内容。处理时,把当前处理的行存储在临时缓冲区中,称为“模式空间”(pattern space),接着用sed命令处理缓冲区中的内容,处理完成后,把缓冲区的内容送往屏幕。接着处理下一行,这样不断重复,直到文件末尾。文件内容转载 2016-04-09 21:10:51 · 275 阅读 · 0 评论