procfs.h (84637) | procfs.h (87321) |
---|---|
1/* 2 * Copyright (c) 1993 Jan-Simon Pendry 3 * Copyright (c) 1993 4 * The Regents of the University of California. All rights reserved. 5 * 6 * This code is derived from software contributed to Berkeley by 7 * Jan-Simon Pendry. 8 * --- 23 unchanged lines hidden (view full) --- 32 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 33 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 34 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 35 * SUCH DAMAGE. 36 * 37 * @(#)procfs.h 8.9 (Berkeley) 5/14/95 38 * 39 * From: | 1/* 2 * Copyright (c) 1993 Jan-Simon Pendry 3 * Copyright (c) 1993 4 * The Regents of the University of California. All rights reserved. 5 * 6 * This code is derived from software contributed to Berkeley by 7 * Jan-Simon Pendry. 8 * --- 23 unchanged lines hidden (view full) --- 32 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 33 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 34 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 35 * SUCH DAMAGE. 36 * 37 * @(#)procfs.h 8.9 (Berkeley) 5/14/95 38 * 39 * From: |
40 * $FreeBSD: head/sys/fs/procfs/procfs.h 84637 2001-10-07 20:08:42Z des $ | 40 * $FreeBSD: head/sys/fs/procfs/procfs.h 87321 2001-12-04 01:35:06Z des $ |
41 */ 42 | 41 */ 42 |
43/* 44 * The different types of node in a procfs filesystem 45 */ 46typedef enum { 47 Proot, /* the filesystem root */ 48 Pcurproc, /* symbolic link for curproc */ 49 Pproc, /* a process-specific sub-directory */ 50 Pfile, /* the executable file */ 51 Pmem, /* the process's memory image */ 52 Pregs, /* the process's register set */ 53 Pfpregs, /* the process's FP register set */ 54 Pdbregs, /* the process's debug register set */ 55 Pctl, /* process control */ 56 Pstatus, /* process status */ 57 Pnote, /* process notifier */ 58 Pnotepg, /* process group notifier */ 59 Pmap, /* memory map */ 60 Ptype, /* executable type */ 61 Pcmdline, /* command line */ 62 Prlimit /* resource limits */ 63} pfstype; 64 65/* 66 * control data for the proc file system. 67 */ 68struct pfsnode { 69 struct pfsnode *pfs_next; /* next on list */ 70 struct vnode *pfs_vnode; /* vnode associated with this pfsnode */ 71 pfstype pfs_type; /* type of procfs node */ 72 pid_t pfs_pid; /* associated process */ 73 u_short pfs_mode; /* mode bits for stat() */ 74 u_long pfs_flags; /* open flags */ 75 u_long pfs_fileno; /* unique file id */ 76 pid_t pfs_lockowner; /* pfs lock owner */ 77}; 78 79#define PROCFS_NOTELEN 64 /* max length of a note (/proc/$pid/note) */ 80#define PROCFS_CTLLEN 8 /* max length of a ctl msg (/proc/$pid/ctl */ 81#define PROCFS_NAMELEN 8 /* max length of a filename component */ 82 83/* 84 * Kernel stuff follows 85 */ | |
86#ifdef _KERNEL | 43#ifdef _KERNEL |
87#define CNEQ(cnp, s, len) \ 88 ((cnp)->cn_namelen == (len) && \ 89 (bcmp((s), (cnp)->cn_nameptr, (len)) == 0)) | |
90 | 44 |
91#define PROCFS_FILENO(pid, type) \ 92 (((type) < Pproc) ? \ 93 ((type) + 2) : \ 94 ((((pid)+1) << 4) + ((int) (type)))) | 45int procfs_doproccmdline(PFS_FILL_ARGS); 46int procfs_doprocctl(PFS_FILL_ARGS); 47int procfs_doprocdbregs(PFS_FILL_ARGS); 48int procfs_doprocfpregs(PFS_FILL_ARGS); 49int procfs_doprocmap(PFS_FILL_ARGS); 50int procfs_doprocmem(PFS_FILL_ARGS); 51int procfs_doprocnote(PFS_FILL_ARGS); 52int procfs_doprocregs(PFS_FILL_ARGS); 53int procfs_doprocrlimit(PFS_FILL_ARGS); 54int procfs_doprocstatus(PFS_FILL_ARGS); 55int procfs_doproctype(PFS_FILL_ARGS); 56int procfs_ioctl(PFS_IOCTL_ARGS); 57int procfs_close(PFS_CLOSE_ARGS); |
95 | 58 |
96/* 97 * Convert between pfsnode vnode 98 */ 99#define VTOPFS(vp) ((struct pfsnode *)(vp)->v_data) 100#define PFSTOV(pfs) ((pfs)->pfs_vnode) | 59/* Return 1 if process has special kernel digging privileges */ 60int procfs_kmemaccess(struct proc *); |
101 | 61 |
102typedef struct vfs_namemap vfs_namemap_t; 103struct vfs_namemap { 104 const char *nm_name; 105 int nm_val; 106}; | 62/* Attributes */ 63int procfs_attr(PFS_ATTR_ARGS); |
107 | 64 |
108int vfs_getuserstr __P((struct uio *, char *, int *)); 109vfs_namemap_t *vfs_findname __P((vfs_namemap_t *, char *, int)); | 65/* Visbility */ 66int procfs_notsystem(PFS_VIS_ARGS); 67int procfs_candebug(PFS_VIS_ARGS); |
110 | 68 |
111/* <machine/reg.h> */ 112struct reg; 113struct fpreg; 114struct dbreg; 115 116#define PFIND(pid) (pfind(pid)) 117 118void procfs_exit __P((struct proc *)); 119int procfs_freevp __P((struct vnode *)); 120int procfs_allocvp __P((struct mount *, struct vnode **, long, pfstype)); 121int procfs_donote __P((struct proc *, struct proc *, struct pfsnode *pfsp, struct uio *uio)); 122int procfs_doregs __P((struct proc *, struct proc *, struct pfsnode *pfsp, struct uio *uio)); 123int procfs_dofpregs __P((struct proc *, struct proc *, struct pfsnode *pfsp, struct uio *uio)); 124int procfs_dodbregs __P((struct proc *, struct proc *, struct pfsnode *pfsp, struct uio *uio)); 125int procfs_domem __P((struct proc *, struct proc *, struct pfsnode *pfsp, struct uio *uio)); 126int procfs_doctl __P((struct proc *, struct proc *, struct pfsnode *pfsp, struct uio *uio)); 127int procfs_dostatus __P((struct proc *, struct proc *, struct pfsnode *pfsp, struct uio *uio)); 128int procfs_domap __P((struct proc *, struct proc *, struct pfsnode *pfsp, struct uio *uio)); 129int procfs_dotype __P((struct proc *, struct proc *, struct pfsnode *pfsp, struct uio *uio)); 130int procfs_docmdline __P((struct proc *, struct proc *, struct pfsnode *pfsp, struct uio *uio)); 131int procfs_dorlimit __P((struct proc *, struct proc *, struct pfsnode *pfsp, struct uio *uio)); 132 133/* functions to check whether or not files should be displayed */ 134int procfs_validfile __P((struct thread *)); 135int procfs_validfpregs __P((struct thread *)); 136int procfs_validregs __P((struct thread *)); 137int procfs_validdbregs __P((struct thread *)); 138int procfs_validmap __P((struct thread *)); 139int procfs_validtype __P((struct thread *)); 140 141#define PROCFS_LOCKED 0x01 142#define PROCFS_WANT 0x02 143 144extern vop_t **procfs_vnodeop_p; 145 146int procfs_root __P((struct mount *, struct vnode **)); 147int procfs_rw __P((struct vop_read_args *)); | |
148#endif /* _KERNEL */ | 69#endif /* _KERNEL */ |