modified getarch.c