Handling argc==0 in the kernel
Handling argc==0 in the kernel
Posted Feb 1, 2022 18:07 UTC (Tue) by nybble41 (subscriber, #55106)In reply to: Handling argc==0 in the kernel by mathstuf
Parent article: Handling argc==0 in the kernel
> If you delete it, the symlink now "points to" `/path/to/exe (deleted)`.
Interesting fact: Even though the /proc/$PID/exe symlink is "broken" you can still open it, producing a reference to the original file. The /proc filesystem has its own special rules for resolving symlinks. However, attempting to restore the file by creating a hard-link with `ln` or `link` gives the error "Invalid cross-device link" even though the original (deleted) file and the target directory are on the same filesystem. (You can *copy* /proc/$PID/exe to a new file, though.)
