use memset instead of bzero, for compatibilty with Linux and memcpy