Make the core code a bit more generic to be able to compile without glibc.