Unix C self-destruction process

I want to delete the executable after starting the process.

I tried to post unlinkand it works fine, but I want the executable to continue to work.

Is the approach used correctly unlink? Are there any problems using this approach?

+3
source share
1 answer

Unix should not have any problems overriding the executable file of a running process.

When you disconnect a file, the directory entry is deleted, but the inode and the underlying data are not freed until all existing file references (i.e. hard links and open descriptors) are freed.

+8
source

All Articles