Block same instance of a program for running again
Three calls to memcpy seem to emulate sprintf(program_path, "%s/%s", dir, buffer);
my_strtok is a not very clean substitute for dirname.
The lock file is always created in the home directory, and only accounts for the base name of the executable. It means that /usr/foo would block /opt/foo.
The locker does not account for the links (again, it only cares about the base name of the executable). Different names may refer to the physically same file; invocations via links would not lock each other out.
A callback registered with atexit is only guaranteed to be called if the program exits normally. If the program is terminated by the signal, the lock file would not be removed.