[Subject Prev][Subject Next][Thread Prev][Thread Next][Subject Index][Thread Index]

Re: diff. bet sockaddr & sockaddr_in ?



On Sat, Mar 24, 2001 at 04:14:12AM +0000, Sunil V wrote:
> The definition of 'struct sockaddr' is in <sys/socket.h>.
> This structure has a 14-byte protocol specific address which is 
> interpreted based on type of address. For intenet family it is 
> 'struct sockaddr_in' defined in <netinet/in.h>

And this sort of a thing was used in the BSD sockets API because it was
designed before the void * generic pointer was introduced into C. The
interface would have been much cleaner had the bind() syscall were
prototyped like:

int bind (int fd, void *addr, socklen_t *len);

Binand