Is there a libc implementation contained in a single C file?

145 Views Asked by At

I'm looking for a libc implementation in a single C source file.

Previously, I tried decompiling musl's libc.so with Ghidra but the result contained too many errors. Even after manually fixing these errors the result is too far removed from the original source code for my needs.

I found this but I was hoping to find something more complete. For example, including some of the math.h functions and printf.

Then today I found a mention of the VAX/VMS C compiler in a comment on this answer which states:

The VAX/VMS C compiler kept all the C runtime library headers in a single textual library file (similar to a unix archive), and used the string between the < and > as the key to index into the library. – Adrian McCarthy Feb 15, 2017 at 23:14

This might fit my needs, if the "textual library file" contains C source code.

So primarily I'm looking for a single-file libc.c implementation. But if someone has a link to this VAX/VMS C compiler archive file, I'd be interested in that too.

0

There are 0 best solutions below