DIGIT-ARC read-only archive · snapshot: July 23, 2026

socket: can't find where is sockaddr

4 posts · originally from https://geek.digit.in/community/threads/socket-cant-find-where-is-sockaddr.82995/

R
ravi.xolve Original post #1
Mar 19, 2008 at 1:26 AM
*pastebin.com/m42b627b9
here when I compile it gcc gives the error "cannot convert to a pointer type" for line 24. I tried to find where struct sockaddr is defined but can't find. man pages say no thing about it.

Please help.
M
Mar 19, 2008 at 1:59 AM
Try sys/socket.h file. It should have your struct socketaddr defined, line 218 as per the libraries I have got.
It looks something like
Code:
struct sockaddr {
	unsigned char	sa_len;		/* total length */
	sa_family_t	sa_family;	/* address family */
	char		sa_data[14];	/* actually longer; address value */
};
R
Mar 19, 2008 at 2:34 AM
If You see my source here *pastebin.com/m42b627b9 I have already included it
M
Mar 19, 2008 at 3:09 AM
Try *pastebin.com/m752c6b86
You forgot & before servaddr.