4 ms·
Is there a reason none of these replacement libcs are available for Windows?
by abainbridge 7y ago
Is there a reason none of these replacement libcs are available for Windows?
- hackcasual 7y agoBecause part of what libc does is bridge the OS and user space. This is very much OS dependent. You can get a rough idea by looking at where it makes "syscalls."
- BubRoss 7y agoThat's not true for the vast majority of libc. It's usually file IO, memory mapping and command line IO that use system calls and everything else builds on those or just modifies memory.
- hackcasual 7y agoThreading as well. It means porting requires significant work.
- BubRoss 7y agoHow so? I've dug into the source of musl and allocators like jemalloc. Windows has VirtualAlloc as its analog to mmap and a simple function to print to the command line. Starting threads is similar. Most of libc is pure C. Even most of musl is optimizations for different platforms and compilers. The simple straightforward versions of functions are not anywhere near the complexity of what gets used most of the time.
- earenndil 7y agoMost libcs aren't cross-platform; there is mingw, which provides an alternate libc on windows. I'm not actually sure why the libcs aren't cross-platform; I'm currently working on one which plans to support freebsd, linux, and windows.
- anta40 7y agoWell.... there's WCRT: http://www.ibsensoftware.com/files/WCRT-1.16.104.zip http://www.ibsensoftware.com/files/WCRT-1.16.104.zip