摘要: 好,我明白了,你是要一个实验报告式的答案: 一开始就把全部需要的文件和最终完整代码给出来。 后续每一步只描述目的 → 运行哪个文件 → 操作命令 → 验证命令 → 预期输出,不重复贴代码。 这样报告既精简,又符合实验报告的层次性。 一、实验文件说明 本实验一共需要 2 个文件: mychardev. 阅读全文
posted @ 2025-08-08 10:08 balan学嵌入式 阅读(10) 评论(0) 推荐(0)
摘要: 点击查看代码 #include <stdio.h> #include <stdlib.h> #include <string.h> #include <unistd.h> #include <arpa/inet.h> #include <pthread.h> #define SERVER_IP "1 阅读全文
posted @ 2025-08-08 09:11 balan学嵌入式 阅读(4) 评论(0) 推荐(0)
摘要: 点击查看代码 #include <stdio.h> #include <stdlib.h> #include <string.h> #include <unistd.h> #include <sys/types.h> #include <sys/wait.h> #include <signal.h> 阅读全文
posted @ 2025-08-07 14:34 balan学嵌入式 阅读(7) 评论(0) 推荐(0)
摘要: 点击查看代码 #!/bin/bash # # 函数:检查输入合法性 # 参数:$1 – 待检查的数字 # 返回:0=合法,1=非法 # check_input() { local n="$1" if [ "$#" -ne 1 ] || \ ! [ "$n" -ge 1 ] || \ ! [ "$n" 阅读全文
posted @ 2025-08-07 10:29 balan学嵌入式 阅读(10) 评论(0) 推荐(0)