always use our basename, dirname as glibc is stupid and threading