Page 1 of 1
Standard libraries? How?
Posted: Wed Jan 21, 2009 7:49 am
by skwee
Hello all!
I wanted to ask how to develop standard C library.
I mean I know how to do function like printf, memcpy, strtok and etc but I never seen for example stdio.c file that have the realization of sdtio.h therefor I don't know how it works? Is all those libraries are dynamic libraries that loaded by the OS?
Thanks.
Re: Standard libraries? How?
Posted: Wed Jan 21, 2009 8:16 am
by Solar
skwo wrote:I wanted to ask how to develop standard C library.
With lots of time, the ISO/IEC standard document on your knees, and an
extremly pedantic mindset.
I mean I know how to do function like printf, memcpy, strtok and etc but I never seen for example stdio.c file that have the realization of sdtio.h therefor I don't know how it works?
I am not sure what's unclear about it... feel welcome to browse the
PDCLib repository. I'm currently (well, for over two years actually as life has been a *****) in the midst of (re-) implementing stdio.h, so please take everything you find in trunk/functions/stdio/ with a grain of salt, but it should give you an idea.
Is all those libraries are dynamic libraries that loaded by the OS?
Can be. You can also link your C library statically (as I would prefer). Also note that, while you might actually have a full-blown C library available in both kernel and user space, they will likely differ in the backend (or "OS glue" as I call it): The user-space C lib will use system calls, while the kernel-space lib will likely make its calls directly.
Hope that helps.
Re: Standard libraries? How?
Posted: Wed Jan 21, 2009 1:52 pm
by JohnnyTheDon