intro.2

来自「<B>Digital的Unix操作系统VAX 4.2源码</B>」· 2 代码 · 共 740 行 · 第 1/2 页

2
740
字号
operation, and.I msg_ctimeis the time of the last .PN msgctl operation that changed a member of the above structure..TP 5Parent process ID.brA new process is created by a currently active process.  For furtherinformation, see .MS fork 2 .The parent process ID of a process is the process ID of its creator..TP 5Pathname.brA pathname is a null-terminated character string containing an optional slash (/), followed by zero or more directory names separatedby slashes.  This sequence can optionally be followed by another slashand a filename.The total length of a pathname must be lessthan {PATHNAME_MAX} characters..IPIf a pathname begins with a slash, the path search begins at the.PN rootdirectory.Otherwise, the search begins from the current working directory.A slash by itself names the .PN root directory.  A nullpathname refers to the current directory..TP 5Process ID.brEach active process in the system is uniquely identified by a positiveinteger called a process ID.  The range of this ID is from0 to {PROC_MAX}..TP 5Process Group ID.brEach active process is a member of a process group that is identified bya positive integer called the process group ID.  This is the processID of the group leader.  This grouping permits the signaling of relatedprocesses.  For more information, see .MS killpg 2and the job control mechanisms described in .MS csh 1 ..TP 5Real User ID and Real Group ID.brEach user on the system is identified by a positive integercalled the real user ID..IPEach user is also a member of one or more groups. One of these groups is distinguished from others andused in implementing accounting facilities.  The positiveinteger corresponding to this group is calledthe real group ID..IPAll processes have a real user ID and real group ID.These are initialized from the equivalent attributesof the parent process. .TP 5Root Directory and Current Working Directory.brEach process has associated with it a concept of a root directoryand a current working directory for the purpose of resolving pathname searches.  A process's root directory does not need to bethe root directory of the root file system..TP 5Semaphore Identifier.IPA semaphore identifier (semid) is a unique positive integercreated by a .PN semget system call.  Each semid has a set of semaphores and adata structure associated with it.  The data structureis referred to as.I semid_dsand contains the following members:.EX 0struct  ipc_perm sem_perm; /*operation permission struct*/ushort  sem_nsems;         /*number of sems in set */time_t  sem_otime;         /*last operation time*/time_t  sem_ctime;         /*last change time*/                           /*Times measured in secs since*/                           /*00:00:00 GMT, Jan. 1, 1970*/.EEThe.I sem_permis an .I ipc_perm structure that specifies the semaphoreoperation permission.  This structure includesthe following members:.EX 0ushort cuid;  /*creator user id*/ushort cgid;  /*creator group id*/ushort uid;   /*user id*/ushort gid;   /*group id*/ushort mode;  /*r/a permission*/.EEThe value of.I sem_nsemsis equal to the number of semaphores in the set.  Eachsemaphore in the set is referenced by a positive integerreferred to as a.I sem_num.The.I sem_num values run sequentially from 0 to the value ofsem_nsems minus 1.The.I sem_otimemember is the time of the last .PN semop operation, and.I sem_ctimeis the time of the last .PN semctl operation that changed a member of the above structure..IPA semaphore is a data structure that contains the followingmembers:.EX 0ushort  semval;  /*semaphore value*/short   sempid;  /*pid of last operation*/ushort  semncnt; /*# awaiting semval > cval*/ushort  semzcnt; /*# awaiting semval = 0*/.EEThe.I semvalmember is a non-negative integer.The.I sempidmember is equal to the process ID of the lastprocess that performed a semaphore operation on thissemaphore.The.I semncntmember is a count of the number of processes that are currentlysuspended awaiting this semaphore's semval to become greaterthan its current value.The.I semzcntmember is a count of the number of processes that are currently suspendedawaiting this semaphore's semval to become zero..TP 5Semaphore Operation Permissions.IPIn the .MS semop 2and.MS semctl 2system call descriptions, the permission required for an operationis specified as {token}.  The token argument is the type of permissionneeded and it is interpreted as follows:.EX00400   Read by user00200   Alter by user00060   Read, Alter by group00006   Read, Alter by others.EERead and alter permissions on a semid are granted to a processif one or more of the following are true:.RS 10.IP \(bu 5The effective user ID of the process is superuser..IP \(buThe effective user ID of the process matches.I sem_perm.[c]uidin the data structure associated withsemidand the appropriate bit of the user portion (0600) of.I sem_perm.modeis set..IP \(buThe effective user ID of the process does not match.I sem_perm.[c]uid,but the effective group ID of the process matches.I sem_perm.[c]gidand the appropriate bit of the group portion (060) of.I sem_perm.modeis set..IP \(buThe effective user ID of the process does not match.I sem_perm.[c]uidand the effective group ID of the process does not match.I sem_perm.[c]gid,but the appropriate bit of the other portion (06) of.I sem_perm.mode is set..RE.IP If none of the previous conditions are true, the read and alterpermissions are denied..TP 5Session.IPEach process group is a member of a session. A process is consideredto be a member of the session of which its process group is a member.Typically there is one session per login..TP 5Shared Memory Identifier.IPA shared memory identifier (shmid) is a unique positiveinteger created by a .PN shmget system call.  Each shmid has a segment of memory (referredto as a shared memory segment) and a data structure associatedwith it.  The data structure is referred to as.PN shmid_dsand contains the following members:.EX 0struct  ipc_perm shm_perm;  /*operation permission struct*/int     shm_segsz;          /*size of segment*/ushort  shm_cpid;           /*creator pid*/ushort  shm_lpid;           /*pid of last operation*/short   shm_nattch;         /*number of current attaches*/time_t  shm_atime;          /*last attach time*/time_t  shm_dtime;          /*last detach time*/time_t  shm_ctime;          /*last change time*/                            /*Times measured in secs since*/                            /*00:00:00 GMT, Jan. 1, 1970*/.EEThe.I shm_permmember is an .I ipc_permstructure that specifies the sharedmemory operation permission.  This structureincludes the following members:.EX 0ushort  cuid;  /*creator user id*/ushort  cgid;  /*creator group id*/ushort  uid;   /*user id*/ushort  gid;   /*group id*/ushort  mode;  /*r/w permission*/.EEThe.I shm_segzmember specifies the size of the shared memory segment.The.I shm_cpidmember is the process ID of the process that created the sharedmemory identifier.The.I shm_lpidmember is the process ID of the last process that performeda .PN shmop operation.The.I shm_nattchmember is the number of processes that currently have this segmentattached.  The.I shm_atimemember is the time of the last.PN shmatoperation,.I shm_dtimeis the time of the last.PN shmdtoperation, and.I shm_ctimeis the time of the last .PN shmctl operation that changed one of the members of the abovestructure..TP 5Shared Memory Operation Permissions.IPIn the .MS shmop 2 and.MS shmctl 2system call descriptions, the permission required for anoperation is given as {token}.  The token argument is thetype of permission needed and it is interpreted as follows:.EX00400  Read by user00200  Write by user00060  Read, Write by group00006  Read, Write by others.EERead and write permissions on a shmid are granted to aprocess if one or more of the following are true:.RS 10.IP \(bu 5The effective user ID of the process is superuser..IP \(bu 5The effective user ID of the process matches.I shm_perm.[c]uidin the data structure associated with shmidand the appropriate bit of theuser portion (0600) of.I shm_perm.mode is set..IP \(bu 5The effective user ID of the process does not match.I shm_perm.[c]uid,but the effective group ID of the process matches.I shm_perm.[c]gidand the appropriate bit of the group portion (060)of.I shm_perm.modeis set..IP \(bu 5The effective user ID of the process does not match.I shm_perm.[c]uidand the effective group ID of the process does not match.I shm_perm.[c]gid,but the appropriate bit of the other portion (06) of.I shm_perm.modeis set..RE.IPIf none of the previous conditions are true, the read and write permissions are denied..TP 5Sockets and Address Families.IPA socket is an endpoint for communication between processes.Each socket has queues for sending and receiving data..IPSockets are typed according to their communications properties.These properties determine whether messages sent and receivedat a socket require the name of the partner, if communicationis reliable, and if the format is used in naming messagerecipients..IPEach instance of the system supports somecollection of socket types.  See.MS socket 2for more information about the types available andtheir properties..IPEach instance of the system supports some number of sets ofcommunications protocols.  Each protocol set supports addressesof a certain format.  An Address Family is the set of addressesfor a specific group of protocols.  Each socket has an addresschosen from the address family in which the socket was created..TP 5Special Processes.brThose processes that have a process ID of 0, 1, and 2 are consideredspecial processes.  Process 0 is the scheduler.  Process 1 is the initialization process .IR init ,and is the ancestor of every other process in the system.It controls the process structure.Process 2 is the paging daemon..TP 5Superuser.brA process is recognized as a superuser process and is grantedspecial privileges if its effective user ID is 0..TP 5tty Group ID.brEach active process can be a member of a terminal groupthat is identified by a positive integer called the tty group ID.  This grouping is used to arbitrate between multiple jobs contending for the same terminal.  For more information, see .MS csh 1  and .MS tty 4 ..SH See Alsocc(1), csh(1), tty(4), intro(3), perror(3)

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?