导航

2021年6月17日 #

32位ipv4转字符串

摘要: 反正短时间内我这段代码查了2回,写了三回,而且我自己都有实现的 struct in_addr ad; char p[30] = "1.2.3.4"; char q[30]; ad.s_addr = inet_addr(p); snprintf(q, 30, "%s", inet_ntoa(ad)); 阅读全文

posted @ 2021-06-17 17:49 toughcactus 阅读(97) 评论(0) 推荐(0) 编辑

shell字符串拼接

摘要: #! /bin/bash TEST_PATH="/tmp/testFile" touch ${TEST_PATH}_bak /tmp目录下有文件testFile_bak 阅读全文

posted @ 2021-06-17 17:46 toughcactus 阅读(286) 评论(0) 推荐(0) 编辑

system函数

摘要: 今天因为日志大小限制的原因,需要使用system函数,但是system执行完shell命令后,产生SIGCHLD,我对该信号进行捕捉但没有相应pid记录,此时不能进行wait操作。 阅读全文

posted @ 2021-06-17 14:34 toughcactus 阅读(45) 评论(0) 推荐(0) 编辑