Quick question. Is it possible to create directory in /proc that starts with number but isn't process directory (where name is PID)? I write software that searches for process directories and I wonder what conditions should I check.
No part of the official kernel currently does that, nor any third-party kernel module that I've seen. Only a kernel component could do that.
I think that
/proc/[0-9]* is common enough in shell scripts that no official kernel component will ever do that.
It is not possible to create manually (in the usual way) a directory in
/proc because it is not really a filesystem: it's a way for the kernel to show system and process information in a hierarchical, filesystem-like structure.
The only way someone could create a directory under
proc is by writing a kernel module that does so, but that would mess up things quite a bit. So I think it's safe for you to assume
/proc/[0-9]* always relate to processes.