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/fs/procfs/procfs_fpregs.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/fs/procfs/procfs_fpregs.c')
-rw-r--r-- | sys/fs/procfs/procfs_fpregs.c | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/sys/fs/procfs/procfs_fpregs.c b/sys/fs/procfs/procfs_fpregs.c index 331a671..3f233bd 100644 --- a/sys/fs/procfs/procfs_fpregs.c +++ b/sys/fs/procfs/procfs_fpregs.c @@ -36,7 +36,7 @@ * * @(#)procfs_fpregs.c 8.1 (Berkeley) 1/27/94 * - * $Id: procfs_fpregs.c,v 1.1.1.1 1994/05/24 10:05:09 rgrimes Exp $ + * $Id: procfs_fpregs.c,v 1.2 1994/08/02 07:45:12 davidg Exp $ */ #include <sys/param.h> @@ -47,6 +47,8 @@ #include <sys/vnode.h> #include <machine/reg.h> #include <miscfs/procfs/procfs.h> +#include <vm/vm.h> +#include <vm/vm_extern.h> int procfs_dofpregs(curp, p, pfs, uio) @@ -68,6 +70,8 @@ procfs_dofpregs(curp, p, pfs, uio) if (kl > uio->uio_resid) kl = uio->uio_resid; + PHOLD(p); + if (kl < 0) error = EINVAL; else @@ -80,7 +84,15 @@ procfs_dofpregs(curp, p, pfs, uio) else error = procfs_write_fpregs(p, &r); } + PRELE(p); uio->uio_offset = 0; return (error); } + +int +procfs_validfpregs(p) + struct proc *p; +{ + return ((p->p_flag & P_SYSTEM) == 0); +} |