It's not a C topic: it's OS function. For example, MS Windows can't truncate files in so manner, but IBM MVS can do it.
Accordingly no such function(s) in C Standard library.
Portable code must do this op vith rewriting a new file then renaming.
Luckily for us, it's the most safe method too...