From owner-freebsd-questions@FreeBSD.ORG Tue Feb 26 03:48:19 2008 Return-Path: Delivered-To: FreeBSD-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0B49D16A401 for ; Tue, 26 Feb 2008 03:48:19 +0000 (UTC) (envelope-from keramida@ceid.upatras.gr) Received: from igloo.linux.gr (igloo.linux.gr [62.1.205.36]) by mx1.freebsd.org (Postfix) with ESMTP id 656CB13C44B for ; Tue, 26 Feb 2008 03:48:18 +0000 (UTC) (envelope-from keramida@ceid.upatras.gr) Received: from kobe.laptop (adsl92-189.kln.forthnet.gr [77.49.59.189]) (authenticated bits=0) by igloo.linux.gr (8.14.1/8.14.1/Debian-9) with ESMTP id m1Q3Yvcc014272; Tue, 26 Feb 2008 05:35:02 +0200 Received: by kobe.laptop (Postfix, from userid 1000) id EAB3A22802; Tue, 26 Feb 2008 05:34:56 +0200 (EET) Date: Tue, 26 Feb 2008 05:34:56 +0200 From: Giorgos Keramidas To: aora57@gmail.com Message-ID: <20080226033456.GC2154@kobe.laptop> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Hellug-MailScanner: Found to be clean X-Hellug-MailScanner-SpamCheck: not spam, SpamAssassin (not cached, score=-3.924, required 5, autolearn=not spam, ALL_TRUSTED -1.80, AWL 0.47, BAYES_00 -2.60) X-Hellug-MailScanner-From: keramida@ceid.upatras.gr X-Spam-Status: No Cc: FreeBSD-questions@freebsd.org Subject: Re: Where is connect? X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Feb 2008 03:48:19 -0000 On 2008-02-25 21:23, a arcadia wrote: > This is likely a silly question but where exactly is the source for > connect? Under /usr/src/lib/libc/sys there is connect.2 but no > connect.c, or any other socket functions for that matter. It is a system call. The userlevel part of system calls is, traditionally, only a very thin wrapper around their kernel counterparts. If you look at `/usr/src/sys/kern/syscalls.master' you can see a line which maps the connect(2) system call to the connect() kernel function: % 98 AUE_CONNECT STD { int connect(int s, caddr_t name, \ % int namelen); } The connect() function itself is easy to locate in src/sys/kern: % keramida@kobe:/usr/src/sys/kern$ grep -n '^connect' *.c % uipc_syscalls.c:501:connect(td, uap) % keramida@kobe:/usr/src/sys/kern$ This is the entry point of the connect(2) system call. Things go on from this point into the network stack & protocol support code.