导航

上一页 1 ··· 7 8 9 10 11 12 13 下一页

2021年4月20日 #

inotify

摘要: 现在的使用是用于程序和脚本的通信。 头文件 #include <sys/inotify.h> 初始化函数 int inotify_init1(int flags) 支持flag,可设置为IN_NONBLOCK,代码简化 返回为fd 监听使能,监听的文件必须存在 int inotify_add_wat 阅读全文

posted @ 2021-04-20 09:19 toughcactus 阅读(129) 评论(0) 推荐(0) 编辑

2021年4月19日 #

exec

摘要: 执行脚本程序的时候遇见两个问题 1.执行脚本start.sh 大家的写法应该都是 char *argv[] = {NULL}; execv("/root/Projects/wind/start.sh", argv); 脑抽的写法是 char *argv[] = {"/root/Projects/wi 阅读全文

posted @ 2021-04-19 16:42 toughcactus 阅读(86) 评论(0) 推荐(0) 编辑

clock skew detected

摘要: apt install ntpdate ntpdate 0.asia.pool.ntp.org hwclock --systohc 阅读全文

posted @ 2021-04-19 11:48 toughcactus 阅读(54) 评论(0) 推荐(0) 编辑

cmake使能gdb

摘要: SET(CMAKE_BUILD_TYPE "Debug") SET(CMAKE_CXX_FLAGS_DEBUG "$ENV{CXXFLAGS} -O0 -Wall -g3 -ggdb")#网上找的参数g3。gdb时提示无行号信息。改为g3就好了。其实这个问题之前遇到过... SET(CMAKE_CX 阅读全文

posted @ 2021-04-19 10:20 toughcactus 阅读(71) 评论(0) 推荐(0) 编辑

shell 时间

摘要: #不要加空格 time1=$(date) echo $time1 > /tmp/output.txt 阅读全文

posted @ 2021-04-19 10:15 toughcactus 阅读(38) 评论(0) 推荐(0) 编辑

gcc

摘要: gcc main.c -o main -g 将源文件main.c编译为文件main,允许gdb调试 阅读全文

posted @ 2021-04-19 10:05 toughcactus 阅读(36) 评论(0) 推荐(0) 编辑

时间处理函数

摘要: #include <time.h> time_t t; time(&t); //获取秒数 struct tm *lt = localtime(&t); //将秒数转换为当地时间 char *p = asctime(lt); //将当地时间转换为字符串 阅读全文

posted @ 2021-04-19 10:04 toughcactus 阅读(46) 评论(0) 推荐(0) 编辑

2021年4月14日 #

文件操作

摘要: FILE *fopen( const char * filename, const char * mode ); int fclose( FILE *fp ); https://www.runoob.com/cprogramming/c-file-io.html mode a+ 打开一个文本文件,允 阅读全文

posted @ 2021-04-14 16:25 toughcactus 阅读(31) 评论(0) 推荐(0) 编辑

2021年4月12日 #

cmakelist

摘要: 终于,又得自己写cmakelist了。 一句题外话,clion默认识别cmakelist。 之前跟着练手的博文是这个。 https://www.hahack.com/codes/cmake/ Demo 1 0 文件结构 main.c | CMakeLists.txt 1.1 文件名 CMakeLis 阅读全文

posted @ 2021-04-12 17:59 toughcactus 阅读(713) 评论(0) 推荐(0) 编辑

2021年4月11日 #

rfc

摘要: 793 : TCP 1928 : socks5 2131 : DHCP 3376 : IGMPv3 7761 : PIM-SM 阅读全文

posted @ 2021-04-11 23:35 toughcactus 阅读(45) 评论(0) 推荐(0) 编辑

上一页 1 ··· 7 8 9 10 11 12 13 下一页