Handling argc==0 in the kernel
Handling argc==0 in the kernel
Posted Feb 10, 2022 21:21 UTC (Thu) by Jandar (subscriber, #85683)In reply to: Handling argc==0 in the kernel by nybble41
Parent article: Handling argc==0 in the kernel
> The kernel specifically blocks the creation of a hard-link to a previously deleted (zero-refcount) inode.
If you an open the deleted /proc/pid/exe, why would linkat(fd, "", AT_FDCWD, "/path/for/file", AT_EMPTY_PATH); not work? A filedescriptor obtained with open( ".", , | O_RDWR ) has to have a zero st_nlink as well.
I have never done an open(,O_TMPFILE) + linkat(fd, "", AT_FDCWD,...) so this may be a misconception.
