From 21823ec3f86860088808338133f86fe37014be23 Mon Sep 17 00:00:00 2001 From: des Date: Sat, 8 Dec 2001 22:34:14 +0000 Subject: Fix a KSEfication brain-o in procfs_doprocfile(): return the path of the target process, not the calling process. While we're here, also unstaticize procfs_doprocfile() and procfs_docurproc() so linprocfs can call them directly instead of duplicating them. Submitted by: Dominic Mitchell --- sys/fs/procfs/procfs.c | 6 +++--- sys/fs/procfs/procfs.h | 2 ++ 2 files changed, 5 insertions(+), 3 deletions(-) (limited to 'sys') diff --git a/sys/fs/procfs/procfs.c b/sys/fs/procfs/procfs.c index e4883d4..18544d0 100644 --- a/sys/fs/procfs/procfs.c +++ b/sys/fs/procfs/procfs.c @@ -64,13 +64,13 @@ /* * Filler function for proc/pid/self */ -static int +int procfs_doprocfile(PFS_FILL_ARGS) { char *fullpath = "unknown"; char *freepath = NULL; - vn_fullpath(td, td->td_proc->p_textvp, &fullpath, &freepath); + vn_fullpath(td, p->p_textvp, &fullpath, &freepath); sbuf_printf(sb, "%s", fullpath); if (freepath) free(freepath, M_TEMP); @@ -80,7 +80,7 @@ procfs_doprocfile(PFS_FILL_ARGS) /* * Filler function for proc/curproc */ -static int +int procfs_docurproc(PFS_FILL_ARGS) { sbuf_printf(sb, "%ld", (long)td->td_proc->p_pid); diff --git a/sys/fs/procfs/procfs.h b/sys/fs/procfs/procfs.h index 059cab8..bf5b756 100644 --- a/sys/fs/procfs/procfs.h +++ b/sys/fs/procfs/procfs.h @@ -42,9 +42,11 @@ #ifdef _KERNEL +int procfs_docurproc(PFS_FILL_ARGS); int procfs_doproccmdline(PFS_FILL_ARGS); int procfs_doprocctl(PFS_FILL_ARGS); int procfs_doprocdbregs(PFS_FILL_ARGS); +int procfs_doprocfile(PFS_FILL_ARGS); int procfs_doprocfpregs(PFS_FILL_ARGS); int procfs_doprocmap(PFS_FILL_ARGS); int procfs_doprocmem(PFS_FILL_ARGS); -- cgit v1.1