I call execv in my C code to run the executable, but I want to set its working directory to something normal.
For example, in one case, I run ls , but it lists the files in my program source directory. But I want to set the working directory to something ordinary. How will I reach it, so I will put it on /usr/bin , and ls list the files in this directory. And do not give me a specific solution for ls , it was just an example.
source share