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

rm at mamma.varadinet.de rm at mamma.varadinet.de
Wed Apr 18 11:25:51 MDT 2001

On Wed, Apr 18, 2001 at 09:49:52AM -0600, Matt McIllece (1-3762) wrote:
> >A socket is never 'bound' to a name.
> I'm just using the description from the manpage.  Is it incorrect?

Sorry, it was a bit unclear to me whether you used this colloquial

> >The application 'bind' whose code you downloaded is a name server
> Got it...
> >> I also looked under /usr/src/linux, but didn't find bind() implemented there 
> >> either.
> >Oh, that's just the kernel. The functions you need to look at are in
> >the C library (or libc as it's commonly called ;-) 
> >
> Should the source code for bind() be included with KRUD?  I searched everywhere 
> under /usr and couldn't find it.  Does anyone have a more specific path to where 
> it should be?

Hmm, the action of 'binding' is partly done by the c lib (so you need
the source code for libc (don't know how the rpm is called, i'm a Debian
guy) and partly done by the kernel -- the c library call to 'bind' is
a wrapper for the 'sys_bind' call whose code you'll find in 
$LINUX/net/socket.c .


P.S.: sorry for the missunderstanding - i hope my non-native-english-speakerness
counts as an excuse ;-)

More information about the LUG mailing list