Does getc(3) use the read(2) syscall?
Daniel Molina Wegener
dmw at coder.cl
Wed Feb 3 13:50:14 UTC 2010
On Wednesday 03 February 2010,
Stefan Midjich <swehack at gmail.com> 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.
>
> 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.
>
> But i would also love it if someone could show me where __sys_read is
> defined.
Take a look on the architecture specific file SYS.h,
that's a kind of macro. For example at the i386 file:
lib/libc/i386/SYS.h
>
> Thanks in advance for any information!
>
Best regards,
--
| Daniel Molina <dmw [at] coder [dot] cl> |
| IT Consulting & Software Development |
| Phone: +56 2 9790277 | http://coder.cl/ |
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 835 bytes
Desc: This is a digitally signed message part.
Url : http://lists.freebsd.org/pipermail/freebsd-hackers/attachments/20100203/1efaffc5/attachment.pgp
More information about the freebsd-hackers
mailing list