1145-1147.html

来自「linux-unix130.linux.and.unix.ebooks130 l」· HTML 代码 · 共 432 行

HTML
432
字号
<HTML>

<HEAD>

<TITLE>Linux Complete Command Reference:File Formats:EarthWeb Inc.-</TITLE>

</HEAD>

<META NAME="ROBOTS" CONTENT="NOINDEX, NOFOLLOW">
<SCRIPT>
<!--
function displayWindow(url, width, height) {
        var Win = window.open(url,"displayWindow",'width=' + width +
',height=' + height + ',resizable=1,scrollbars=yes');
}
//-->
</SCRIPT>
</HEAD>

 -->




<!-- ISBN=0672311046 //-->

<!-- TITLE=Linux Complete Command Reference//-->

<!-- AUTHOR=Red Hat//-->

<!-- PUBLISHER=Macmillan Computer Publishing//-->

<!-- IMPRINT=Sams//-->

<!-- CHAPTER=05 //-->

<!-- PAGES=1103-1208 //-->

<!-- UNASSIGNED1 //-->

<!-- UNASSIGNED2 //-->



<P><CENTER>

<a href="1144-1144.html">Previous</A> | <a href="../ewtoc.html">Table of Contents</A> | <a href="1148-1149.html">Next</A></CENTER></P>







<A NAME="PAGENUM-1145"><P>Page 1145</P></A>

<P>

The mode member of the ipc_perm structure defines, with its lower nine bits, the access permissions to the resource for

a process executing an ipc system call. The permissions are interpreted as follows:

</P>



<TABLE>



<TR><TD>

0400

</TD><TD>

Read by user.

</TD></TR><TR><TD>

0200

</TD><TD>

Write by user.

</TD></TR><TR><TD>

0040

</TD><TD>

Read by group.

</TD></TR><TR><TD>

0020

</TD><TD>

Write by group.

</TD></TR><TR><TD>

0004

</TD><TD>

Read by others.

</TD></TR><TR><TD>

0002

</TD><TD>

Write by others.

</TD></TR></TABLE>



<P>Bits 0100, 0010, and 0001 (the execute bits) are unused by the system. Furthermore &quot;write&quot; effectively means &quot;alter&quot; for

a semaphore set.

</P>



<P>The same system header file defines also the following symbolic constants:

</P>



<TABLE>



<TR><TD>

IPC_CREAT

</TD><TD>

Create entry if key doesn't exists.

</TD></TR><TR><TD>

IPC_EXCL

</TD><TD>

Fail if key exists.

</TD></TR><TR><TD>

IPC_NOWAIT

</TD><TD>

Error if request must wait.

</TD></TR><TR><TD>

IPC_PRIVATE

</TD><TD>

Private key.

</TD></TR><TR><TD>

IPC_RMID

</TD><TD>

Remove resource.

</TD></TR><TR><TD>

IPC_SET

</TD><TD>

Set resource options.

</TD></TR><TR><TD>

IPC_STAT

</TD><TD>

Get resource options.

</TD></TR></TABLE>



<P>Note that IPC_PRIVATE is a key_t type, whereas all the others symbolic constants are flag fields ORable into an

int type variable.

</P>



<P><B>

MESSAGE QUEUES

</B></P>



<P>A message queue is uniquely identified by a positive integer (its

msqid) and has an associated data structure of type

struct msquid_ds, defined in &lt;sys/msg.h&gt;, containing the following members:

</P>



<!-- CODE //-->

<PRE>

struct ipc_perm msg_perm;

ushort msg_qnum; /* no of messages on queue */

ushort msg_qbytes; /* bytes max on a queue */

ushort msg_lspid; /* pid of last msgsnd call */

ushort msg_lrpid; /* pid of last msgrcv call */

time_t msg_stime; /* last msgsnd time */

time_t msg_rtime; /* last msgrcv time */

time_t msg_ctime; /* last change time */

</PRE>

<!-- END CODE //-->



<TABLE>



<TR><TD>

msg_perm

</TD><TD>

ipc_perm structure that specifies the access permissions on the message queue.

</TD></TR><TR><TD>

msg_qnum

</TD><TD>

Number of messages currently on the message queue.

</TD></TR><TR><TD>

msg_qbytes

</TD><TD>

Maximum number of bytes of message text allowed on the message queue.

</TD></TR><TR><TD>

msg_lspid

</TD><TD>

ID of the process that performed the last

msgsnd system call.

</TD></TR><TR><TD>

msg_lrpid

</TD><TD>

ID of the process that performed the last

msgrcv system call.

</TD></TR><TR><TD>

msg_stime

</TD><TD>

Time of the last msgsnd system call.

</TD></TR><TR><TD>

msg_rtime

</TD><TD>

Time of the last msgcv system call.

</TD></TR><TR><TD>

msg_ctime

</TD><TD>

Time of the last system call that changed a member of the

msqid_ds structure.

</TD></TR></TABLE>



<P><B>

SEMAPHORE SETS

</B></P>



<P>A semaphore set is uniquely identified by a positive integer (its

semid) and has an associated data structure of type

struct semid_ds, defined in &lt;sys/sem.h&gt;, containing the following members:

</P>



<!-- CODE SNIP //-->

<PRE>

struct ipc_perm sem_perm;

time_t sem_otime; /* last operation time */

</PRE>

<!-- END CODE SNIP //-->



<A NAME="PAGENUM-1146"><P>Page 1146</P></A>



<!-- CODE SNIP //-->

<PRE>

time_t sem_ctime; /* last change time */

ushort sem_nsems; /* count of sems in set */

</PRE>

<!-- END CODE SNIP //-->



<TABLE>



<TR><TD>

sem_perm

</TD><TD>

ipc_perm structure that specifies the access permissions on the semaphore set.

</TD></TR><TR><TD>

sem_otime

</TD><TD>

Time of last semop system call.

</TD></TR><TR><TD>

sem_ctime

</TD><TD>

Time of last semctl system call that changed a member of the above structure or of

one semaphore belonging to the set.

</TD></TR><TR><TD>

sem_nsems

</TD><TD>

Number of semaphores in the set. Each semaphore of the set is referenced by a

non-negative integer ranging from 0 to sem_nsems_1.

</TD></TR></TABLE>



<P>A semaphore is a data structure of type struct

sem containing the following members:

</P>



<!-- CODE //-->

<PRE>

ushort semval; /* semaphore value */

short sempid; /* pid for last operation */

ushort semncnt; /* no. of awaiting semval to increase */

ushort semzcnt; /* no. of awaiting semval = 0 */

</PRE>

<!-- END CODE //-->



<TABLE>



<TR><TD>

semval

</TD><TD>

Semaphore value: a non-negative integer.

</TD></TR><TR><TD>

sempid

</TD><TD>

ID of the last process that performed a semaphore operation on this semaphore.

</TD></TR><TR><TD>

semncnt

</TD><TD>

Number of processes suspended awaiting for

semval to increase.

</TD></TR><TR><TD>

semznt

</TD><TD>

Number of processes suspended awaiting for

semval to become zero.

</TD></TR></TABLE>



<P><B>

SHARED MEMORY SEGMENTS

</B></P>



<P>A shared memory segment is uniquely identified by a positive integer (its

shmid) and has an associated data structure of

type struct shmid_ds, defined in &lt;sys/shm.h&gt;, containing the following members:

</P>



<!-- CODE //-->

<PRE>

struct ipc_perm shm_perm;

int shm_segsz; /* size of segment */

ushort shm_cpid; /* pid of creator */

ushort shm_lpid; /* pid, last operation */

short shm_nattch; /* no. of current attaches */

time_t shm_atime; /* time of last attach */

time_t shm_dtime; /* time of last detach */

time_t shm_ctime; /* time of last change */

</PRE>

<!-- END CODE //-->



<TABLE>



<TR><TD>

shm_perm

</TD><TD>

ipc_perm structure that specifies the access permissions on the shared memory segment.

</TD></TR><TR><TD>

shm_segsz

</TD><TD>

Size in bytes of the shared memory segment.

</TD></TR><TR><TD>

shm_cpid

</TD><TD>

ID of the process that created the shared memory segment.

</TD></TR><TR><TD>

shm_lpid

</TD><TD>

ID of the last process that executed a

shmat or shmdt system call.

</TD></TR><TR><TD>

shm_nattch

</TD><TD>

Number of current alive attaches for this shared memory segment.

</TD></TR><TR><TD>

shm_atime

</TD><TD>

Time of the last shmat system call.

</TD></TR><TR><TD>

shm_dtime

</TD><TD>

Time of the last shmdt system call.

</TD></TR><TR><TD>

shm_ctime

</TD><TD>

Time of the last shmctl system call that changed

shmid_ds.

</TD></TR></TABLE>



<P><B>

SEE ALSO

</B></P>



<P>ftok(3), msgctl(2), msgget(2), msgrcv(2),

msgsnd(2), semctl(2), semget(2), semop(2), shmat(2),

shmctl(2), shmget(2), shmdt (2)

</P>



<P>Linux 0.99.13, 1 November 1993

</P>



<H3><A NAME="ch05_ 28">

issue

</A></H3>



<P>issue&#151;Issue identification file.

</P>

<A NAME="PAGENUM-1147"><P>Page 1147</P></A>







<P><B>

DESCRIPTION

</B></P>



<P>The file /etc/issue is a text file that contains a message or system identification to be printed before the login prompt.

It may contain various @char and \char sequences if supported by

getty(1).

</P>



<P><B>

FILES

</B></P>



<P>/etc/issue</P>



<P><B>

SEE ALSO

</B></P>



<P>getty(1), motd(5)

</P>



<P>Linux, 24 July 1993

</P>



<H3><A NAME="ch05_ 29">

lilo.conf

</A></H3>



<P>lilo.conf&#151;Configuration file for LILO.

</P>



<P><B>

DESCRIPTION

</B></P>



<P>This file, by default /etc/lilo.conf, is read by the boot loader installer LILO (see

lilo(8)).

</P>



<P>It might look as follows:

</P>



<!-- CODE //-->

<PRE>

boot = /dev/hda

delay = 40

compact

vga = normal

root = /dev/hda1

read-only

image = /zImage-1.5.99

        label = try

image = /zImage-1.0.9

        label = 1.0.9

image = /tamu/vmlinuz

        label = tamu

        root = /dev/hdb2

        vga = ask

other = /dev/hda3

        label = dos

        table = /dev/hda

</PRE>

<!-- END CODE //-->



<P>This configuration file specifies that LILO uses the Master Boot Record on

/dev/hda. (For a discussion of the various ways to use LILO and the interaction with other operating systems, see

user.tex from the LILO documentation.)

<P>When booting, the boot loader will wait 4 seconds (40 deciseconds) for you to press Shift. If you don't, then the first

kernel image mentioned (/zImage-1.5.99, which you probably installed just 5 minutes ago) will be booted. If you do, the

boot loader will ask you which image to boot. In case you forgot the possible choices, press Tab (or ? if you have a U.S.

keyboard), and you will be presented with a menu. You now have the choice of booting this brand new kernel, an old trusted kernel,

or a kernel on another root file system (just in case you did something stupid on your usual root) or booting a

different operating system. There can be up to 16 images mentioned in

lilo.conf.

</P>



<P>As can be seen previously, a configuration file starts with a number of global options (the top six lines in the

example), followed by descriptions of the options for the various images. An option in an image description will override a

global option.

</P>





<P><CENTER>

<a href="1144-1144.html">Previous</A> | <a href="../ewtoc.html">Table of Contents</A> | <a href="1148-1149.html">Next</A></CENTER></P>







</td>
</tr>
</table>

<!-- begin footer information -->







</body></html>

⌨️ 快捷键说明

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