Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 3 Feb 2010 15:16:18 +0100
From:      Marc Olzheim <zlo@zlo.nu>
To:        Daniel Molina Wegener <dmw@coder.cl>
Cc:        freebsd-hackers@freebsd.org
Subject:   Re: Does getc(3) use the read(2) syscall?
Message-ID:  <20100203141618.GA32485@zlo.nu>
In-Reply-To: <201002031024.03835.dmw@coder.cl>
References:  <e0e25d5e1002030326p5e0ef0a1q5ebc77a4e1c69b7c@mail.gmail.com> <201002031024.03835.dmw@coder.cl>

next in thread | previous in thread | raw e-mail | index | archive | help

--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--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20100203141618.GA32485>