📄 mount_procfs.8
字号:
.\".\" Copyright (c) 1992, 1993.\" The Regents of the University of California. All rights reserved..\" All rights reserved..\".\" This code is derived from software donated to Berkeley by.\" Jan-Simon Pendry..\".\" Redistribution and use in source and binary forms, with or without.\" modification, are permitted provided that the following conditions.\" are met:.\" 1. Redistributions of source code must retain the above copyright.\" notice, this list of conditions and the following disclaimer..\" 2. Redistributions in binary form must reproduce the above copyright.\" notice, this list of conditions and the following disclaimer in the.\" documentation and/or other materials provided with the distribution..\" 3. All advertising materials mentioning features or use of this software.\" must display the following acknowledgement:.\" This product includes software developed by the University of.\" California, Berkeley and its contributors..\" 4. Neither the name of the University nor the names of its contributors.\" may be used to endorse or promote products derived from this software.\" without specific prior written permission..\".\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION).\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF.\" SUCH DAMAGE..\".\" @(#)mount_procfs.8 8.2 (Berkeley) 3/27/94.\".\".Dd March 27, 1994.Dt MOUNT_PROCFS 8.Os BSD 4.4.Sh NAME.Nm mount_procfs.Nd mount the process file system.Sh SYNOPSIS.Nm mount_procfs.Op Fl o Ar options.Pa /proc.Pa mount_point.Sh DESCRIPTIONThe.Nm mount_procfscommand attaches an instance of the processnamespace to the global filesystem namespace.The conventional mount point is.Pa /proc .This command is normally executed by.Xr mount 8at boot time..PpThe options are as follows:.Bl -tag -width indent.It Fl oOptions are specified with a.Fl oflag followed by a comma separated string of options.See the.Xr mount 8man page for possible options and their meanings..El.PpThe root of the process filesystemcontains an entry for each active process.These processes are visible as a directory whosename is the process' pid.In addition, the special entry.Pa curprocreferences the current process..PpEach directory contains several files..Bl -tag -width status.It Pa ctla writeonly file which supports a varietyof control operations.Control commands are written as strings to the.Pa ctlfile.The control commands are:.Bl -tag -width detach -compact.It attachstops the target process and arranges for the sendingprocess to become the debug control process..It detachcontinue execution of the target process andremove it from control by the debug process (whichneed not be the sending process)..It runcontinue running the target process untila signal is delivered, a breakpoint is hit, or thetarget process exits..It stepsingle step the target process, with no signal delivery..It waitwait for the target process to come to a steadystate ready for debugging.The target process must be in this state beforeany of the other commands are allowed..El.PpThe string can also be the name of a signal, lower caseand without the.Dv SIGprefix,in which case that signal is delivered to the process(see.Xr sigaction 2 )..It Pa fileA reference to the vnode from which the process text was read.This can be used to gain access to the process' symbol table,or to start another copy of the process..It Pa memThe complete virtual memory image of the process.Only those address which exist in the process can be accessed.Reads and writes to this file modify the process.Writes to the text segment remain private to the process..It Pa noteNot implemented..It Pa notepgNot implemented..It Pa regsAllows read and write access to the process' register set.This file contains a binary data structure.Dv "struct regs"defined in.Pa <machine/reg.h> ..Pa regscan only be written when the process is stopped..It Pa fpregsThe floating point registers as defined by.Dv "struct fpregs"in.Pa <machine/reg.h> ..Pa fpregsis only implemented on machines which have distinct generalpurpose and floating point register sets..It Pa statusThe process status.This file is readonly and returns a single line containingmultiple space-separated fields as follows:.Pp.Bl -bullet -compact.Itcommand name.Itprocess id.Itparent process id.Itprocess group id.Itsession id.It.Ar major,minorof the controlling terminal, or.Dv -1,-1if there is no controlling terminal..Ita list of process flags:.Dv cttyif there is a controlling terminal,.Dv sldrif the process is a session leader,.Dv noflagsif neither of the other two flags are set..Itthe process start time in seconds and microseconds,comma separated..Itthe user time in seconds and microseconds,comma separated..Itthe system time in seconds and microseconds,comma separated..Itthe wait channel message.Itthe process credentials consisting ofthe effective user idand the list of groups (whose first memberis the effective group id)all comma separated..El.El.PpIn a normal debugging environment,where the target is fork/exec'd by the debugger,the debugger should fork and the child should stopitself (with a self-inflicted.Dv SIGSTOPfor example).The parent should issue a.Dv waitand then an.Dv attachcommand via the appropriate.Pa ctlfile.The child process will receive a.Dv SIGTRAPimmediately after the call to exec (see.Xr execve 2 )..Sh FILES.Bl -tag -width /proc/curproc -compact.It Pa /proc/#.It Pa /proc/curproc.It Pa /proc/curproc/ctl.It Pa /proc/curproc/file.It Pa /proc/curproc/mem.It Pa /proc/curproc/note.It Pa /proc/curproc/notepg.It Pa /proc/curproc/regs.It Pa /proc/curproc/fpregs.It Pa /proc/curproc/status.El.Sh SEE ALSO.Xr sigaction 2 ,.Xr mount 2 ,.Xr unmount 2 ,.Sh CAVEATSNo.Pa .and.Pa ..entries appear when listing the contents of the.Pa /procdirectory.This makes sense in the context of this filesystem, but is inconsistentwith usual filesystem conventions.However, it is still possible to refer to both.Pa .and .Pa ..in a pathname..PpThis filesystem may not be NFS-exportedsince most of the functionality of.Dv procfsrequires that state be maintained..Sh HISTORYThe.Nm mount_procfsutility first appeared in 4.4BSD.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -