fix file api issue when compile using gcc toolchain