Presumably you can call chdir(2) from the C code?
Or did you mean change the directory of the calling shell (in which case, executable shell scripts written in Bash and friends can’t do that either).
Or did you mean change the directory of the calling shell (in which case, executable shell scripts written in Bash and friends can’t do that either).