
c
air5005
希望能记录工作中学习到的所有知识,与大家分析、一起学习
展开
-
linux下使用libasan检测进程内存异常
软件环境CentOS Linux release 8.3.2011按照libasan包yum install libasan测试例子#include <stdio.h>#include <stdlib.h>#include <unistd.h> int my_print(){ int *a = malloc(10); printf("this is my_print, a:%p\n", a); return 0;} int原创 2021-05-19 16:43:49 · 3248 阅读 · 0 评论 -
linux c编程实用api记录
查询进程运行的cpu和numa node#include <stdio.h>#include <sys/syscall.h>void main(){ unsigned cpu = 0; unsigned node = 0; syscall (__NR_getcpu, &cpu, &node, 0); printf("cpu:%d nod...原创 2019-04-18 11:08:55 · 226 阅读 · 0 评论 -
busybox之reboot命令流程分析
busybox初始化注册reboot处理信号busybox启动的时候,会注册reboot的处理信号init_main bb_signals(0 + (1 << SIGUSR1) /* halt */ + (1 << SIGTERM) /* reboot */ + (1 << SIGUSR2) /* poweroff */ , ha...原创 2019-09-06 12:43:25 · 2652 阅读 · 0 评论