replace rt.qsort with libc wrapper