进程之fork()函数的详细介绍
内容介绍 本博文主要探讨fork函数以及execuv的用法。 头文件介绍 下面的是csapp.h头文件,后面的讨论中均只用该头文件来完成程序的编写。 /* $begin csapp.h */ #ifndef __CSAPP_H__ #define __CSAPP_H__ #include <stdio.h> #include <stdlib.h> #include <unistd.h> #include <string.h> #include <ctype.h> #include <setjmp.h> #include <signal.h> #include <sys/time.h> #include <sys/types.h> #include <sys/wait.h> #include <sys/stat.h> #include <fcntl.h> #include <sys/mman.h> #include <errno.h> #include <math.h> #include <pthread.h> #include <semaphore.h> #include <sys/socket.h> #include <netdb.h> #include <netinet/in.h> #include <arpa/inet.h> /* Default file