I want to get from any Unix-like system (if this is possible) a unique id that will be persistent every time my application runs in the same machine. If it is possible, I wa
You can use a lockfile in places like:
When your program is run, it shall do something like:
lock = open(filename, O_CREAT | O_EXCL);
dprintf(lock, "%u", getpid());
If the open fails, check if the process is still running and if not: delete the file and try again.