According to the man page getaddrinfo(3)I need
getaddrinfo(3)
#include <sys/types.h> #include <sys/socket.h> #include <netdb.h>
use function getaddrinfo. Or, according to the standard :
getaddrinfo
#include <sys/socket.h> #include <netdb.h>
I understand, I need things like AF_INETand SOCK_STEAMfrom <sys/socket.h>. But I still have the following questions.
AF_INET
SOCK_STEAM
<sys/socket.h>
Suppose I will only use a function getaddrinfo, should I have a #include <sys/socket.h>standard match? If so, why <netdb.h>not include it yourself? If not, why does this man page contain a summary of it?
#include <sys/socket.h>
<netdb.h>
, getaddrinfo , netdb.h. getnameinfo NI_NUMERICHOST, (), . - netdb.h.
netdb.h
getnameinfo
NI_NUMERICHOST
, , , (sys/socket.h). , sys/socket.h. , , , , ( ) getaddrinfo.
sys/socket.h
sys/types.h, , Linux. sys/types.h , , , .
sys/types.h
Source: https://habr.com/ru/post/1650107/More articles:express: how to send html along with css using sendFile? - htmlRuby rubocop: how to freeze an array constant generated by splat - ruby | fooobar.comМне нужна обратная связь по этому частично безсерверному дизайну архитектуры - amazon-s3Is the event awaiting fake awakenings? - multithreadingMake a dynamic chess panel responsive to jQuery user input - jqueryРазница в компиляторах: расширение x3:: variant требует определенного экземпляра copy constrctor, оператора присваивания копий и конструктора по умолчанию с gcc, но не clang - c++Android error in textbook cannot find symbol variable activity_display_message - javaI get a lot of these errors: Copy error :. If this helps, I create an application with more than 200 activities - androidA collection of multiple columns based on a specific date range per month - sqlMySQL - selective deletion of duplicate records - phpAll Articles