Date: Wed, 3 Feb 2010 16:57:42 -0300 From: Daniel Molina Wegener <dmw@coder.cl> To: Marc Olzheim <zlo@zlo.nu> Cc: freebsd-hackers@freebsd.org Subject: Re: Does getc(3) use the read(2) syscall? Message-ID: <201002031657.47714.dmw@coder.cl> In-Reply-To: <20100203141618.GA32485@zlo.nu> References: <e0e25d5e1002030326p5e0ef0a1q5ebc77a4e1c69b7c@mail.gmail.com> <201002031024.03835.dmw@coder.cl> <20100203141618.GA32485@zlo.nu>
next in thread | previous in thread | raw e-mail | index | archive | help
--nextPart2034385.0TTj51CVDk Content-Type: Text/Plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable On Wednesday 03 February 2010, Marc Olzheim <zlo@zlo.nu> 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 <dmw [at] coder [dot] cl> 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--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201002031657.47714.dmw>