# include & ltsys/socket . h & gt;
int accept(int sockfd,void *addr,int * addrlen);
Sockfd is very simple, it is the same socket descriptor as in listen (). Addr is a pointer to the local data structure sockaddr_in. This is the destination of the information that needs to be accessed (you can determine which address is called at which port). Before its address is passed to accept, addrlen is a local integer variable set to sizeof(struct sockaddr_in). Accepting will not give addr extra bytes. If you put less, then it will be changed.
Change the value of addrlen.
Similarly,-1 is returned when an error occurs, and the global error variable errno is set.