[lug] source for bind(int sockfd, struct sockaddr *my_addr, int addrlen)

Matt McIllece (1-3762) mcillece at elbonia.ast.lmco.com
Wed Apr 18 11:33:30 MDT 2001


OK, I guess my post is getting off-topic, but I thought I'd share what I've 
found so far.

I haven't actually found the implementation of bind(), but I think I'm onto it 
now.

The signature of bind() is defined in /usr/src/linux-2.2.12/include/net/sock.h.  

bind() is really defined as a pointer to a function that takes those (int 
sockfd, struct sockaddr *my_addr, int addrlen) arguments (as in

(*bind) (struct socket *sock, struct sockaddr *umyaddr, int sockaddr_len)

).

In /usr/src/linux-2.2.12/include/linux/net.h, it's included as one of the 
pointers in a structure called proto_ops{}

Somewhere else there's probably some assignment of the proto_ops{} structure to 
something else that eventually implements the function under another name...




More information about the LUG mailing list