I wrote a UNIX daemon (targeting Debian, but it shouldn\'t matter) and I wanted to provide some way of creating a \".pid\" file, (a file which contains the process identifie
The only way I can think of is to use system level locks. See this: C++ how to check if file is in use - multi-threaded multi-process system