From owner-freebsd-hackers@FreeBSD.ORG Wed Feb 3 14:27:33 2010 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7BEC0106566C for ; Wed, 3 Feb 2010 14:27:33 +0000 (UTC) (envelope-from marcolz@zlo.nu) Received: from mzh.zlo.nu (ns0.zlo.nu [85.17.141.90]) by mx1.freebsd.org (Postfix) with ESMTP id 3E3018FC18 for ; Wed, 3 Feb 2010 14:27:33 +0000 (UTC) Received: by mzh.zlo.nu (Postfix, from userid 1000) id E5D6E14125; Wed, 3 Feb 2010 15:16:18 +0100 (CET) Date: Wed, 3 Feb 2010 15:16:18 +0100 From: Marc Olzheim To: Daniel Molina Wegener Message-ID: <20100203141618.GA32485@zlo.nu> References: <201002031024.03835.dmw@coder.cl> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="LZvS9be/3tNcYl/X" Content-Disposition: inline In-Reply-To: <201002031024.03835.dmw@coder.cl> User-Agent: Mutt/1.5.20 (2009-06-14) X-Mailman-Approved-At: Wed, 03 Feb 2010 16:40:24 +0000 Cc: freebsd-hackers@freebsd.org Subject: Re: Does getc(3) use the read(2) syscall? X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Feb 2010 14:27:33 -0000 --LZvS9be/3tNcYl/X Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Feb 03, 2010 at 10:23:50AM -0300, Daniel Molina Wegener wrote: > > I'm having trouble looking this function up in the source tree, the tra= il > > seems to end at __sys_read which has a bunch of prototypes but i can't = find > > the actual function code. >=20 > Well, you can try cscope --- IMO the best option to > search for symbols in the source tree. Also you have > well done front-ends like cbrowser, codelite and emacs > plus cscope mode. Works wonders in vim as well. :-) > > So my question is primarily, does getc use the read system call eventua= lly? >=20 > No, certainly not. Take a look on stdio.h and libc > implementation on lib/libc/stdio/getc.c. Mainly on the > __sgetc(f) macro. If you follow macros long enough, you'll find that it obviously does use the read system call. read, readv, pread, preadv are basicly the system calls through which all normal reads take place. Marc --LZvS9be/3tNcYl/X Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (GNU/Linux) iEYEARECAAYFAktphTIACgkQezjnobFOgrHTuACgrl36d0iwaE7H4iV8/ja3Xyc+ EhQAoMivCxPtBHMDbi1k2HhBfVk5iwGQ =jkpJ -----END PGP SIGNATURE----- --LZvS9be/3tNcYl/X--