Re: C runtime library for Unix
- From: "santosh" <santosh.k83@xxxxxxxxx>
- Date: 17 Nov 2006 09:35:34 -0800
Paul Edwards wrote:
I would like to port PDPCLIB:
http://sourceforge.net/projects/pdos/
my public domain C runtime library for DOS, OS/2,
Win32, MVS to Unix now.
I am a bit perplexed as to how to do this. Unix/Posix
systems provide open() with which I can implement
fopen(). But then Posix is also required to define fopen(),
so this is not the level at which I need to implement it.
Although I don't think the CRT should be polluting the
namespace by using open() in the first place.
If the lower level is platform-dependent, then the platform
I wish to target is Linux.
Can someone get me started?
As a system library, you'll need to only rely on the APIs exported by
the OS. Linux aims towards POSIX compliance and thus implements many
APIs defined by POSIX. The system C library often also provides POSIX
interface.
In general you should try to do as much as possible within standard C
and write specific functions when they're called for. If you want the
library to port to most UNIXes, it's structure and compilation will get
more involved. If it's specifically for Linux, then it'll be much
simpler.
At a minimum you'll need to refer to the C standard, the POSIX
standards and the man 2 pages for the OS API. The tricky part will be
satisfying the OS without sacrificing too much portability.
Post Linux API related questions to one of the Linux groups. Details
within standard C portions can be discussed here or in comp.std.c, (but
I doubt that those areas would be much of a problem for you).
The Linux newsgroups will probably help you best. Also browse the
sources of C libraries like dietlibc etc.
.
- Follow-Ups:
- Re: C runtime library for Unix
- From: Paul Edwards
- Re: C runtime library for Unix
- References:
- C runtime library for Unix
- From: Paul Edwards
- C runtime library for Unix
- Prev by Date: Re: should 'float* foo = 12345' be legal?
- Next by Date: Re: C, signal, variable STOR and reentrancy
- Previous by thread: C runtime library for Unix
- Next by thread: Re: C runtime library for Unix
- Index(es):
Relevant Pages
|
|