随笔分类 - linux
摘要:GCC(GNU Compiler Collection,GNU编译器套件),是由 GNU 开发的编程语言编译器。它是以GPL许可证所发行的自由软件,也是 GNU计划的关键部分。GCC原本作为GNU操作系统的官方编译器,现已被大多数类Unix操作系统(如Linux、BSD、Mac OS X等)采纳为标
阅读全文
摘要:参考链接:https://blog.csdn.net/m15511023218/article/details/87920263 参考的主要代码: auto eth0iface eth0 inet staticaddress 192.168.3.90gateway 192.168.3.1netmas
阅读全文
摘要:/* 来发送单播消息 */ extern int netlink_unicast(struct sock *ssk, structsk_buff *skb, __u32 portid, int nonblock); /* ssk: netlink socket skb:skb buff 指针 por
阅读全文
摘要:netlink_kernel_create内核函数用于创建 内核socket用用户态通信 static inline struct sock * netlink_kernel_create(struct net *net, intunit, struct netlink_kernel_cfg *cf
阅读全文
摘要:struct msghdr 结构体 struct iovec { /* Scatter/gather arrayitems */ void *iov_base; /*Starting address */ size_t iov_len; /* Number of bytes to transfer*
阅读全文
摘要:参考链接:https://baike.baidu.com/item/pthread_join 函数pthread_join用来等待一个线程的结束,线程间同步的操作。 头文件 : #include <pthread.h> 函数定义: int pthread_join(pthread_t thread,
阅读全文
摘要:获取进程ID: 原型: #include <unistd.h>pid_t getpid(void); 返回调用进程的进程ID。 获取线程ID: 原型: #include <pthread.h>pthread_t pthread_self(void); 返回调用线程的线程ID。
阅读全文
摘要:pthread_create是类Unix操作系统(Unix、Linux、Mac OS X等)的创建线程的函数。它的功能是创建线程(实际上就是确定调用该线程函数的入口点),在线程创建以后,就开始运行相关的线程函数。 头文件: #include<pthread.h> 函数原型: int pthread_
阅读全文
摘要:简单的说这些函数就是: 将一个数的高低位互换 主机字节顺序成为小端,网路字节顺序成为大端。 原型: #include <arpa/inet.h> uint32_t htonl(uint32_t hostlong); uint16_t htons(uint16_t hostshort); uint32
阅读全文

浙公网安备 33010602011771号