C (Programming) Language
不想做火影的海贼王
这个作者很懒,什么都没留下…
展开
-
Native backtrace lib so库使用汇编进行分析错误位置
(200901_13:43:21.574)[ 3.854314]<3>[E](3)DEBUG: *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***(200901_13:43:21.574)[ 3.859079]<3>[E](3)DEBUG: Revision: '0'(200901_13:43:21.574)[ 3.859791]<3>[E](3)DEBUG: ABI: 'a原创 2020-09-01 20:08:11 · 272 阅读 · 0 评论 -
linux kernel container_of 的使用,结构体成员数组的形式
#include <stdio.h>#ifdef offsetof#undef offsetof#endif#define offsetof(TYPE, MEMBER) ((size_t) &((TYPE *)0)->MEMBER) #ifdef container_of#undef container_of#endif#define container_of(ptr, type, member) ({\ const typeof( ((type *原创 2020-05-09 18:05:28 · 541 阅读 · 1 评论 -
Linux kill 进程后 ,fd 是否被释放,是否会调用 release ?
kill 进程后怎么验证 fd 确实被释放了?打开 APP,使用 lsof 命令 确定我们被使用的APP 确实被打开了xxxxxx:/ # lsof | grep video10lsof | grep video10camerahalserver 1695 cameraserv mem CHR 81,0 783...原创 2020-04-10 17:42:12 · 3790 阅读 · 0 评论 -
boolean mct_object_set_parent(mct_object_t *object, mct_object_t *parent) 有感
include include include 打印 log 如下 c stream 0x20fd010 module 0x20fd030 stream-&amp;gt;object.parentsnum=2 stream-&amp;gt;object.childrennum=2 stream-&amp;gt;object.name=stream stream 0x20fd010 modul...原创 2018-07-24 17:25:41 · 173 阅读 · 0 评论 -
C语言实现的双链表创建 、插入、删除、指定位置翻转操作的操作
以下代码都是经验证可执行,具体结果可参考 dl_print 打印信息。代码里面对过程进行了注释便于理解#include &amp;lt;stdio.h&amp;gt;#include &amp;lt;stdlib.h&amp;gt;//定义双向链表的节点结构typedef struct Node{ int value; struct Node *next; struct Node *pre...原创 2018-09-09 10:24:08 · 1334 阅读 · 0 评论 -
kernel 双向循环链表代码移植到 userspace 以及 Linux 线程同步的总结
list.h// This list structure implementation is adapted from the list implementation// on the Linux kernel.// Original source:// http://git.kernel.org/?p=linux/kernel/git/stable/linux-2.6.25.y.git;...原创 2019-06-04 17:53:12 · 160 阅读 · 0 评论