Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Because 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."


That'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.


Threading as well. It means porting requires significant work.


How 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.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: