摘要: 1、定义 #include <linux/prctl.h> /* Definition of PR_* constants */ #include <sys/prctl.h> int prctl(int op, ...); 基本的线程、进程管理函数。第一个参数决定了进行什么样的操作。 2、具体操作 阅读全文
posted @ 2024-07-25 16:07 NotReferenced 阅读(7) 评论(0) 推荐(0) 编辑
摘要: gpointer g_malloc0 ( gsize n_bytes ) 分配n_bytes字节的内存,并初始化为0。如果n_bytes为0,则返回NULL。 阅读全文
posted @ 2024-07-25 14:36 NotReferenced 阅读(15) 评论(0) 推荐(0) 编辑
摘要: void g_free ( gpointer mem ) 释放mem指向的内存,如果知道内存大小,建议使用g_free_sized,速度更快。 如果mem为NULL,则跳过不做任何操作,所以无需担心释放空指针。 阅读全文
posted @ 2024-07-25 14:33 NotReferenced 阅读(8) 评论(0) 推荐(0) 编辑
摘要: 1、定义 struct GHashTable { /* No available fields */ } 2、方法 2.1 new GHashTable* g_hash_table_new ( GHashFunc hash_func, GEqualFunc key_equal_func ) 创建一个 阅读全文
posted @ 2024-07-25 10:59 NotReferenced 阅读(10) 评论(0) 推荐(0) 编辑