But I want to directly use the gnu C + + (standard C, C + + library), and how to prevent second run?
There are many online introduction write a tag file, check the file whether there is a starting (abort, kill?) , with the process name, process name, path instead?) Don't feel too good,
CodePudding user response:
I am the doProgram start for the first time to obtain the pid
The pid written to the file
Program for the second time when start to determine the first time you start the pid is running state