Handling argc==0 in the kernel
Handling argc==0 in the kernel
Posted Feb 7, 2022 18:27 UTC (Mon) by nybble41 (subscriber, #55106)In reply to: Handling argc==0 in the kernel by jwilk
Parent article: Handling argc==0 in the kernel
> You probably wanted "ln -L /proc/$PID/exe foo" to dereference the symlink...
Yes, I tried it both with and without the -L option—I suppose I should have mentioned the difference in the error message. The kernel specifically blocks the creation of a hard-link to a previously deleted (zero-refcount) inode. It does work, however, if the inode still exists in the filesystem due to hard-links, even if the original path was deleted and the /proc/$PID/fd/N symlink is broken.
