how to make the file executable by code?

for example,I transfer one prog to my target,it is not executable,how can I make it executable by code,not by command?which function?

qnx.com/developers/docs/mome … chmod.html