Use pthread_seteuid_np instead of seteuid.