1. 程式人生 > >Linux網絡編程常用頭文件

Linux網絡編程常用頭文件

oba soc stdarg.h stdlib.h clu errno shm tail sig

// 網絡編程常用頭文件
#include <unistd.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <netdb.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
#include <errno.h>
#include <malloc.h>
#include <netinet/in.h>
#include 
<arpa/inet.h> #include <sys/ioctl.h> #include <stdarg.h> #include <fcntl.h> // 與用戶權限及密碼驗證相關的頭文件 // 註意增加編譯選項 -lcrypt #include <shadow.h> #include <crypt.h> #include <pwd.h> // 與文件和時間相關的頭文件 #include <sys/time.h> #include <utime.h> #include <time.h> #include
<sys/stat.h> #include <sys/file.h> // 與多進程操作相關的頭文件 #include <sys/wait.h> #include <sys/ipc.h> #include <sys/shm.h> #include <signal.h> // 與多線程相關的頭文件 // 註意,應在編譯時鏈接線程庫,增加編譯選項 -lthread #include <pthread.h> #include <sys/poll.h>

具體每個頭文件的用處,請看此處:https://blog.csdn.net/benpaobagzb/article/details/49849011

Linux網絡編程常用頭文件