34.html
来自「linux 0.11中文版 有注释」· HTML 代码 · 共 57 行
HTML
57 行
<html>
<head>
<title>include/linux/kernel.h</title>
<meta name='robots' content='noindex,nofollow'>
<meta name='generator' content='GLOBAL-5.4.1'>
</head>
<body text='#191970' bgcolor='#f5f5dc' vlink='gray'>
<a name='TOP'><h2><a href='../mains.html'>root</a>/<a href='../files/99.html'>include</a>/<a href='../files/101.html'>linux</a>/kernel.h</h2>
<i><font color='green'>/* [<][>][^][v][top]<a href='#BOTTOM'>[bottom]</a><a href='../mains.html'>[index]</a><a href='../help.html'>[help]</a> */</font></i>
<hr>
<h2><a href='../J/34.html' title='Multiple included from 29 places.'>INCLUDED FROM</a></h2>
<hr>
<pre>
<a name='L1'><i><font color='green'>/*</font></i>
<a name='L2'><i><font color='green'>* 'kernel.h' contains some often-used function prototypes etc</font></i>
<a name='L3'><i><font color='green'>*/</font></i>
<a name='L4'><i><font color='green'>/*</font></i>
<a name='L5'><i><font color='green'>* 'kernel.h'定义了一些常用函数的原型等。</font></i>
<a name='L6'><i><font color='green'>*/</font></i>
<a name='L7'><i><font color='green'>// 验证给定地址开始的内存块是否超限。若超限则追加内存。( kernel/fork.c, 24 )。</font></i>
<a name='L8'><b>void</b> <a href='../S/68.html#L34' title='Defined at 34 in kernel/fork.c.'>verify_area</a> (<b>void</b> *addr, <b>int</b> count);
<a name='L9'><i><font color='green'>// 显示内核出错信息,然后进入死循环。( kernel/panic.c, 16 )。</font></i>
<a name='L10'><b>volatile</b> <b>void</b> <a href='../S/72.html#L24' title='Defined at 24 in kernel/panic.c.'>panic</a> (<b>const</b> <b>char</b> *str);
<a name='L11'><i><font color='green'>// 标准打印(显示)函数。( init/main.c, 151)。</font></i>
<a name='L12'><b>int</b> <a href='../S/52.html#L203' title='Defined at 203 in init/main.c.'>printf</a> (<b>const</b> <b>char</b> *fmt, ...);
<a name='L13'><i><font color='green'>// 内核专用的打印信息函数,功能与printf()相同。( kernel/printk.c, 21 )。</font></i>
<a name='L14'><b>int</b> <a href='../S/73.html#L30' title='Defined at 30 in kernel/printk.c.'>printk</a> (<b>const</b> <b>char</b> *fmt, ...);
<a name='L15'><i><font color='green'>// 往tty 上写指定长度的字符串。( kernel/chr_drv/tty_io.c, 290 )。</font></i>
<a name='L16'><b>int</b> <a href='../D/1093.html' title='Multiple defined in 2 places.'>tty_write</a> (<b>unsigned</b> ch, <b>char</b> *buf, <b>int</b> count);
<a name='L17'><i><font color='green'>// 通用内核内存分配函数。( lib/malloc.c, 117)。</font></i>
<a name='L18'><b>void</b> *<a href='../S/86.html#L187' title='Defined at 187 in lib/malloc.c.'>malloc</a> (<b>unsigned</b> <b>int</b> size);
<a name='L19'><i><font color='green'>// 释放指定对象占用的内存。( lib/malloc.c, 182)。</font></i>
<a name='L20'><b>void</b> <a href='../S/86.html#L295' title='Defined at 295 in lib/malloc.c.'>free_s</a> (<b>void</b> *obj, <b>int</b> size);
<a name='L21'>
<a name='L22'><font color='darkred'>#define</font> <a href='../R/463.html' title='Multiple refered from 10 places.'>free</a>(x) <a href='../S/86.html#L295' title='Defined at 295 in lib/malloc.c.'>free_s</a>((x), 0)
<a name='L23'>
<a name='L24'><i><font color='green'>/*</font></i>
<a name='L25'><i><font color='green'>* This is defined as a macro, but at some point this might become a</font></i>
<a name='L26'><i><font color='green'>* real subroutine that sets a flag if it returns true (to do</font></i>
<a name='L27'><i><font color='green'>* BSD-style accounting where the process is flagged if it uses root</font></i>
<a name='L28'><i><font color='green'>* privs). The implication of this is that you should do normal</font></i>
<a name='L29'><i><font color='green'>* permissions checks first, and check suser() last.</font></i>
<a name='L30'><i><font color='green'>*/</font></i>
<a name='L31'><i><font color='green'>/*</font></i>
<a name='L32'><i><font color='green'>* 下面函数是以宏的形式定义的,但是在某方面来看它可以成为一个真正的子程序,</font></i>
<a name='L33'><i><font color='green'>* 如果返回是true 时它将设置标志(如果使用root 用户权限的进程设置了标志,则用</font></i>
<a name='L34'><i><font color='green'>* 于执行BSD 方式的计帐处理)。这意味着你应该首先执行常规权限检查,最后再</font></i>
<a name='L35'><i><font color='green'>* 检测suser()。</font></i>
<a name='L36'><i><font color='green'>*/</font></i>
<a name='L37'><font color='darkred'>#define</font> <a href='../R/624.html' title='Multiple refered from 15 places.'>suser</a>() (current->euid == 0) <i><font color='green'>// 检测是否是超级用户。</font></i>
</pre>
<hr>
<a name='BOTTOM'>
<i><font color='green'>/* [<][>][^][v]<a href='#TOP'>[top]</a>[bottom]<a href='../mains.html'>[index]</a><a href='../help.html'>[help]</a> */</font></i>
</body>
</html>
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?