I need to make sure that user can run only one instance of my program at a time.
Which means, that I have to check programatically, whether the same program is already r
It is very un-unix to prohibit multiple instances of a program to run.
If the program is, say, a network daemon, it doesn't need to actively prohibit multiple instances--only the first instance gets to listen to the socket, so subsequent instances bomb out automatically. If it is, say, an RDBMS, it doesn't need to actively prohibit multiple instances--only the first instance gets to open and lock the files. etc.