I am using system() call to start “tail -f”.
One thing I saw was that, invocation of tail takes 2 processes (I can see in ps):
1) sh -c tail filename
2) tail filename
As man page says: system() executes a command specified in command by calling /bin/sh -c command. I guess, process 1) is inevitable, correct?
I was just wondering if I can reduce number of processes from 2 to 1.
Thanks in advance.
system always does sh -c command. If you want only one process, do system(“exec tail -f”).