os_support: use the appropriate stat functions matching the stat type