change os_trim() prototype not to use int fd