Handling argc==0 in the kernel
Handling argc==0 in the kernel
Posted Jan 28, 2022 19:16 UTC (Fri) by NYKevin (subscriber, #129325)In reply to: Handling argc==0 in the kernel by flussence
Parent article: Handling argc==0 in the kernel
* /proc might not be mounted at all, or it might be mounted somewhere other than /proc.
* / might not be / (e.g. chroot, containers, etc.), and so /proc might be inaccessible.
* The callee might try to pass the argv[0] string on to some other process, but then /proc/self will be interpreted as that process.
* If you try to fix the above using an absolute PID instead of "self," then you run into PID namespaces.
* There are a variety of situations where the called process's binary is not directly accessible to the called process as a regular file, and /proc/self/exe appears to be a broken symlink. The only way to fix this problem is for the caller to provide a suitable alternative path, if a functional argv[0] is desired at all.
