From owner-freebsd-hackers@FreeBSD.ORG Wed Feb 3 19:57:51 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 7E940106568D for ; Wed, 3 Feb 2010 19:57:51 +0000 (UTC) (envelope-from dmw@coder.cl) Received: from ey-out-2122.google.com (ey-out-2122.google.com [74.125.78.27]) by mx1.freebsd.org (Postfix) with ESMTP id 16A6F8FC18 for ; Wed, 3 Feb 2010 19:57:50 +0000 (UTC) Received: by ey-out-2122.google.com with SMTP id 22so379253eye.9 for ; Wed, 03 Feb 2010 11:57:50 -0800 (PST) Received: by 10.213.107.143 with SMTP id b15mr142556ebp.72.1265227069861; Wed, 03 Feb 2010 11:57:49 -0800 (PST) Received: from coder-cl.no-ip.org ([201.215.99.33]) by mx.google.com with ESMTPS id 15sm138546ewy.12.2010.02.03.11.57.47 (version=TLSv1/SSLv3 cipher=RC4-MD5); Wed, 03 Feb 2010 11:57:48 -0800 (PST) From: Daniel Molina Wegener Organization: http://coder.cl/ To: Marc Olzheim Date: Wed, 3 Feb 2010 16:57:42 -0300 User-Agent: KMail/1.12.4 (Linux/2.6.31-17-generic; KDE/4.3.5; i686; ; ) References: <201002031024.03835.dmw@coder.cl> <20100203141618.GA32485@zlo.nu> In-Reply-To: <20100203141618.GA32485@zlo.nu> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="nextPart2034385.0TTj51CVDk"; protocol="application/pgp-signature"; micalg=pgp-sha512 Content-Transfer-Encoding: 7bit Message-Id: <201002031657.47714.dmw@coder.cl> 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 Reply-To: dmw@coder.cl 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 19:57:51 -0000 --nextPart2034385.0TTj51CVDk Content-Type: Text/Plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable On Wednesday 03 February 2010, Marc Olzheim wrote: > 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 > > > trail seems to end at __sys_read which has a bunch of prototypes but i > > > can't find the actual function code. > > > > 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. >=20 > Works wonders in vim as well. :-) Sure, vim supports cscope since 2000 and possibly before that, indeed vim was my first programming editor in FreeBSD and Linux. Then I've learned emcas, and now I use both editors --- the first available on the machine that I'm working on --- also emacs requires a lot of configurations, but is my primary editor on my FreeBSD boxes. >=20 > > > So my question is primarily, does getc use the read system call > > > eventually? > > > > No, certainly not. Take a look on stdio.h and libc > > implementation on lib/libc/stdio/getc.c. Mainly on the > > __sgetc(f) macro. >=20 > 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. That's right, but cscope or even etags should help a lot finding those simbols, most for large source trees like the FreeBSD base system ;) >=20 > Marc >=20 Best regards, =2D-=20 Daniel Molina Wegener Software Architect, System Programmer & Web Developer Phone: +1 (510) 629-4267 | Blog: http://coder.cl/ --nextPart2034385.0TTj51CVDk Content-Type: application/pgp-signature; name=signature.asc Content-Description: This is a digitally signed message part. -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (GNU/Linux) iQIcBAABCgAGBQJLadU2AAoJEHxqfq6Y4O5N8AEQALMUMFslkAEA5vbpecAZ6yym zrkMo7LiLJqm84Q5U3pS6E3dMh/6uhjsHRZ4FH3KEvrwdUAS/6qUzbUPpIlCYS4E LISRzFcpBv+iH3jcs/ISY4XdD2K3KMfSpFzYh9fok04yWZkXWTU9R0WyYmS2aeOG vhNqYYlH2g1KIaZV7cPbJHmy0AbE1Q1W96XUdXhX/50JbX8rR0Ykav2psnVPrX/4 pf2TVUf3ykB6T327Ypia5MG/C4qlI4fXJ+jsswz49X2vpjzvv0kIGoWT7TrATDxb uSp74YTQuzk741U+Xc2DH05TwIqZmqA3iTCW7Pl111aLekt2M93VdVIqTsdSTiDY rRMVUyZ+y0LddsK1VeV5xBivRqNlOVtd8Oee2tuyXeI5kmOeXv1oVAq/S+pKqdaz h/ax+g3xW1WYeca26uObTFP/KvCh2OT88yuQndMuEM9x1h1IKU4AGnpCFf4jCKdR NJh12nxan0ZDboJL4fxCIecDCQyLFw+0C3utV81yE5lFZ0mw9ZFpYZAsus453ExY VH6PfE/YgKwOnkpIE0/VHfqw46at3mB/v1RjdvLqotSjYUJ+Zq4ZjpQMAvE4I/cU 2MQVZtpFn+dJsDoVYdCr7tN64bg35kYeoYri1cl0s3eZ1XdVIrRPKbUWVOZEmrES b6vB1EmOz7pyfwtOFNfD =Hs+N -----END PGP SIGNATURE----- --nextPart2034385.0TTj51CVDk--