(This is something I've been running successfully since 2006 with FreeBSD
6.2-PRERELEASE (RELENG_6) but kept to myself out of fear that purists will
feel offended ;)
This patch extends the FreeBSD /proc filesystem (procfs) by adding support
for some entries that are present on other systems: Linux, Solaris and even
NetBSD (/proc/self & /proc/<pid>/exe)
The entries in question are:
/proc/self -- Pointer to /proc/<pid> (FreeBSD uses /proc/curproc)
/proc/<pid>/exe -- FreeBSD uses /proc/<pid>/file
/proc/<pid>/cwd -- Pointer to the current working directory.
/proc/<pid>/root -- Pointer to the root directory.
I think it's convenient to add those because a lot of software originally
developed in the above systems above will integrate more easily, including
software in ports as you will see:
Fix: The attached patch is against -CURRENT.
The patch to RELENG_6 is available to anyone on demand.
This patch is a trivial one...
/proc/self & /proc/<pid>/exe exist in FreeBSD but with different names.
The code for /proc/<pid>/cwd & /proc/<pid>/root was copied verbatim from
src/sys/compat/linprocfs/linprocfs.c,v 1.119 2008/03/31 12:01:18 kib.
Patch attached with submission follows:
How-To-Repeat: I did a strings-scan on /usr/local that yielded the following (edited):
/usr/local/bin/supertux: Couldn't read /proc/self/exe, using default path: /usr/local/share/supertux
The above files were installed by the following ports:
For bugs matching the following criteria:
Status: In Progress Changed: (is less than) 2014-06-01
Reset to default assignee and clear in-progress tags.
Mail being skipped