readdir(3C) of /proc should list /proc/self
It appears that listing /proc doesn't include the /proc/self magic symlink. It would help discoverability if it was there.
; /bin/ls /proc 0 20741 24334 25253 25499 26003 26034 26074 26099 3 737 ; /bin/ls /proc/self/ as ctl ldt lwp path root usage auxv cwd lpsinfo map priv secflags watch contracts fd lstatus object psinfo sigact xmap cred fdinfo lusage pagedata rmap status
A given directory /proc/pid contains the following entries. A process can use the invisible alias /proc/self if it wishes to open one of its own /proc files (invisible in the sense that the name “self” does not appear in a directory listing of /proc obtained from ls(1), getdents(2), or readdir(3C)).
but not why. An attempt to be compatible with someone listing pids that way?