procfs: Add self & exe symlinks like NetBSD does

NetBSD calls "curproc" "self" and "exe" "file" for proc. Reduce
gratuitous differnces by including them as well.

Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/976
This commit is contained in:
Ricardo Branco 2024-02-02 17:17:52 -07:00 committed by Warner Losh
parent 752a340419
commit b75fa3a2de
2 changed files with 8 additions and 0 deletions

View file

@ -253,10 +253,14 @@ directory containing process information for process
.Pa pid .
.It Pa /proc/curproc
directory containing process information for the current process
.It Pa /proc/self
directory containing process information for the current process
.It Pa /proc/curproc/cmdline
the process executable name
.It Pa /proc/curproc/etype
executable type
.It Pa /proc/curproc/exe
executable image
.It Pa /proc/curproc/file
executable image
.It Pa /proc/curproc/fpregs

View file

@ -158,6 +158,8 @@ procfs_init(PFS_INIT_ARGS)
pfs_create_link(root, "curproc", procfs_docurproc,
NULL, NULL, NULL, 0);
pfs_create_link(root, "self", procfs_docurproc,
NULL, NULL, NULL, 0);
dir = pfs_create_dir(root, "pid",
procfs_attr_all_rx, NULL, NULL, PFS_PROCDEP);
@ -188,6 +190,8 @@ procfs_init(PFS_INIT_ARGS)
pfs_create_link(dir, "file", procfs_doprocfile,
NULL, procfs_notsystem, NULL, 0);
pfs_create_link(dir, "exe", procfs_doprocfile,
NULL, procfs_notsystem, NULL, 0);
return (0);
}