modifications for compiling with glibc 2.4