[sys] Make getCwd() consistent between targets
#10461
Merged
getCwd() consistent between targets
#10461