![](https://img-blog.csdnimg.cn/20201014180756928.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
linux
linux
spark man
crazy for coding
展开
-
linux的epoll
epollAPIepoll_createepoll_ctl select和poll差不多,原理一样,后来又出现了epoll,为什么呢?肯定做了优化。 API 首先,我们来看看epoll的api。 epoll_create int epoll_create(int size); epoll_create() creates an epoll(7) instance. Since Linux 2.6.8, the size argument is ignored, but must be greater原创 2020-05-22 13:39:11 · 164 阅读 · 0 评论 -
linux的socket(bio编程)
linux的socket创建和java很像,其实,java不管是ServerSocket还是Socket,最终都要调到linux的socket函数。今天,我们会讲linux中server与client的创建。 Socketserver server 首先来看一个结构体sockaddr_in,它存储了socket的地址: struct sockaddr_in { ...原创 2020-04-28 12:22:35 · 315 阅读 · 0 评论 -
linux的select函数
我们先来看一段阻塞的read代码: #include <stdio.h> #include <string.h> int main(int argc, char *argv[]){ int fd; char buf[11]; int ret; fd=0; while(1){ //set the buf to 0 memset((void *)buf,...原创 2020-04-22 21:45:02 · 208 阅读 · 0 评论 -
linux的fork
使用man 2 fork我们查看一下fork的指南: DESCRIPTION fork() creates a new process by duplicating the calling process. The new process, referred to as the child, is an exact duplicate of the calling process, refer...原创 2020-04-21 21:58:30 · 114 阅读 · 0 评论