Standard libraries? How?

Programming, for all ages and all languages.
Post Reply
User avatar
skwee
Member
Member
Posts: 73
Joined: Mon Jan 12, 2009 3:11 am

Standard libraries? How?

Post 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.
TCP/IP: Connecting people...
User avatar
Solar
Member
Member
Posts: 7615
Joined: Thu Nov 16, 2006 12:01 pm
Location: Germany
Contact:

Re: Standard libraries? How?

Post 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.
Every good solution is obvious once you've found it.
JohnnyTheDon
Member
Member
Posts: 524
Joined: Sun Nov 09, 2008 2:55 am
Location: Pennsylvania, USA

Re: Standard libraries? How?

Post by JohnnyTheDon »

Post Reply