diff options
author | peter <peter@FreeBSD.org> | 1996-01-24 18:41:41 +0000 |
---|---|---|
committer | peter <peter@FreeBSD.org> | 1996-01-24 18:41:41 +0000 |
commit | 7ce797073148356c22020f07dadba1e726b4f807 (patch) | |
tree | 8145e3cd1e1aac0b3dde9729abaeda8149c107ae /sys/miscfs/procfs/procfs_ctl.c | |
parent | 372aa68f42770d9c66509d34f90c593eadc9069c (diff) | |
download | FreeBSD-src-7ce797073148356c22020f07dadba1e726b4f807.zip FreeBSD-src-7ce797073148356c22020f07dadba1e726b4f807.tar.gz |
Major fixes for procfs..
Implement a "variable" directory structure. Files that do not make
sense for the given process do not "appear" and cannot be opened.
For example, "system" processes do not have "file", "regs" or "fpregs",
because they do not have a user area.
"attempt" to fill in the user area of a given process when it is being
accessed via /proc/pid/mem (the user struct is just after
VM_MAXUSER_ADDRESS in the process address space.)
Dont do IO to the U area while it's swapped, hold it in place if possible.
Lock off access to the "ctl" file if it's done a setuid like the other
pseudo-files in there.
Diffstat (limited to 'sys/miscfs/procfs/procfs_ctl.c')
-rw-r--r-- | sys/miscfs/procfs/procfs_ctl.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/sys/miscfs/procfs/procfs_ctl.c b/sys/miscfs/procfs/procfs_ctl.c index d11a296..78d4ac2 100644 --- a/sys/miscfs/procfs/procfs_ctl.c +++ b/sys/miscfs/procfs/procfs_ctl.c @@ -36,7 +36,7 @@ * * @(#)procfs_ctl.c 8.3 (Berkeley) 1/21/94 * - * $Id: procfs_ctl.c,v 1.7 1995/12/03 14:54:34 bde Exp $ + * $Id: procfs_ctl.c,v 1.8 1995/12/07 12:47:14 davidg Exp $ */ #include <sys/param.h> @@ -72,8 +72,6 @@ procfs_fix_sstep(p); \ } \ } -#else -#define FIX_SSTEP(p) #endif #define PROCFS_CTL_ATTACH 1 @@ -171,10 +169,13 @@ procfs_control(curp, p, op) return (EBUSY); } + +#ifdef FIX_SSTEP /* * do single-step fixup if needed */ FIX_SSTEP(p); +#endif /* * Don't deliver any signal by default. @@ -218,7 +219,9 @@ procfs_control(curp, p, op) * Step. Let the target process execute a single instruction. */ case PROCFS_CTL_STEP: + PHOLD(p); procfs_sstep(p); + PRELE(p); break; /* @@ -301,7 +304,9 @@ procfs_doctl(curp, p, pfs, uio) if (nm) { if (TRACE_WAIT_P(curp, p)) { p->p_xstat = nm->nm_val; +#ifdef FIX_SSTEP FIX_SSTEP(p); +#endif setrunnable(p); } else { psignal(p, nm->nm_val); |