查找树,俄罗斯方块,系统编程开始

This commit is contained in:
lzy
2024-04-25 21:56:26 +08:00
parent 71fdab3f9f
commit eba0cbb4c4
8 changed files with 305 additions and 2 deletions

View File

@@ -0,0 +1,36 @@
# I/O操作
输入输出是一切实现的基础。
标准IO`stdio`
系统调用IO文件IO`sysio`
优先使用标准IO兼容性更好还有合并系统调用的优势。
```c
/* stdio */
/* FILE类型贯穿始终 */
FILE *fopen(const c);
fclose();
fgetc();
fputc();
fgets();
fputs();
fread();
fwrite();
printf();
scanf();
fseek();
ftell();
rewind();
fflush();
```

View File

@@ -0,0 +1,52 @@
# 项目前瞻
基于IPV4的流媒体广播系统。
## 项目需求
需要基于客户机和服务器模型的网络音频广播/点播系统。
用于语音教室和公共广播。
分为服务器和客户机服务器在PC上运行客户机在PC机或者嵌入式设备。
服务器可以向局域网内以多播的方式给所有客户机发送数据,客户机自己选择接收数据。
## 简要框图
<img src="https://s2.loli.net/2024/04/25/kpolhzmgBEcSYxM.png"/>
## 参考书目
1. UNIX环境高级编程第一版经典第二版有错误
2. UNIX网络编程
3. TCP/IP详解卷一
4. 深入理解计算机系统
## 知识网络
- I/O操作参考书目135章14章非阻塞IO
- 文件系统参考书目1467章
- 并发信号10章多线程1011章
- IPC进程间通信8章进程基础13章守护进程
- 进程间通信1516章
## 注意事项
1. 弃用root用户
2. 重构
3. 课堂重点:项目,课堂代码,面试题,实验性题目,推荐书籍的课后题

View File

@@ -0,0 +1,29 @@
#include <errno.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
int main()
{
FILE *fp;
fp = fopen("tmp", "r");
if (NULL == fp)
{
// fprintf(stderr, "fopen() failed! errno = %d\n", errno);
// out: fopen() failed! errno = 2
/* errno:定义路径 /usr/include/asm-generic/errno-base.h */
// perror("fopen()");
// out: fopen(): No such file or directory
fprintf(stderr, "fopen(): %s\n", strerror(errno));
// out: fopen(): No such file or directory
exit(1);
}
puts("OK!");
exit(0);
}