Those fixes look right to me. Also about this new exit code, I think that since __exit_thread is declared in a generic header and called from generic code, it should not be in the sysdeps makefile.