summaryrefslogtreecommitdiffstats
path: root/Documentation/translations/zh_CN/process/magic-number.rst
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2024-01-11 19:46:52 -0800
committerLinus Torvalds <torvalds@linux-foundation.org>2024-01-11 19:46:52 -0800
commit5b9b41617bf3e1282cc60f07d3d52e62399aa4ba (patch)
treecff3bb6bac83d19a7afd9e6d637ec4d6480e5d0f /Documentation/translations/zh_CN/process/magic-number.rst
parent22d29f1112c85c1ad519a8c0403f7f7289cf060c (diff)
parent2d179e8ac02e33c82c1a314961254353eb5028b3 (diff)
downloadlinux-stable-5b9b41617bf3e1282cc60f07d3d52e62399aa4ba.tar.gz
linux-stable-5b9b41617bf3e1282cc60f07d3d52e62399aa4ba.tar.bz2
linux-stable-5b9b41617bf3e1282cc60f07d3d52e62399aa4ba.zip
Merge tag 'docs-6.8' of git://git.lwn.net/linux
Pull documentation update from Jonathan Corbet: "Another moderately busy cycle for documentation, including: - The minimum Sphinx requirement has been raised to 2.4.4, following a warning that was added in 6.2 - Some reworking of the Documentation/process front page to, hopefully, make it more useful - Various kernel-doc tweaks to, for example, make it deal properly with __counted_by annotations - We have also restored a warning for documentation of nonexistent structure members that disappeared a while back. That had the delightful consequence of adding some 600 warnings to the docs build. A sustained effort by Randy, Vegard, and myself has addressed almost all of those, bringing the documentation back into sync with the code. The fixes are going through the appropriate maintainer trees - Various improvements to the HTML rendered docs, including automatic links to Git revisions and a nice new pulldown to make translations easy to access - Speaking of translations, more of those for Spanish and Chinese ... plus the usual stream of documentation updates and typo fixes" * tag 'docs-6.8' of git://git.lwn.net/linux: (57 commits) MAINTAINERS: use tabs for indent of CONFIDENTIAL COMPUTING THREAT MODEL A reworked process/index.rst ring-buffer/Documentation: Add documentation on buffer_percent file Translated the RISC-V architecture boot documentation. Docs: remove mentions of fdformat from util-linux Docs/zh_CN: Fix the meaning of DEBUG to pr_debug() Documentation: move driver-api/dcdbas to userspace-api/ Documentation: move driver-api/isapnp to userspace-api/ Documentation/core-api : fix typo in workqueue Documentation/trace: Fixed typos in the ftrace FLAGS section kernel-doc: handle a void function without producing a warning scripts/get_abi.pl: ignore some temp files docs: kernel_abi.py: fix command injection scripts/get_abi: fix source path leak CREDITS, MAINTAINERS, docs/process/howto: Update man-pages' maintainer docs: translations: add translations links when they exist kernel-doc: Align quick help and the code MAINTAINERS: add reviewer for Spanish translations docs: ignore __counted_by attribute in structure definitions scripts: kernel-doc: Clarify missing struct member description ..
Diffstat (limited to 'Documentation/translations/zh_CN/process/magic-number.rst')
-rw-r--r--Documentation/translations/zh_CN/process/magic-number.rst69
1 files changed, 39 insertions, 30 deletions
diff --git a/Documentation/translations/zh_CN/process/magic-number.rst b/Documentation/translations/zh_CN/process/magic-number.rst
index 4a92ebb619ee..4e4aeaca796c 100644
--- a/Documentation/translations/zh_CN/process/magic-number.rst
+++ b/Documentation/translations/zh_CN/process/magic-number.rst
@@ -1,58 +1,67 @@
-.. _cn_magicnumbers:
-
.. include:: ../disclaimer-zh_CN.rst
-:Original: :ref:`Documentation/process/magic-number.rst <magicnumbers>`
+:Original: Documentation/process/magic-number.rst
+
+:翻译:
-如果想评论或更新本文的内容,请直接发信到LKML。如果你使用英文交流有困难的话,也可
-以向中文版维护者求助。如果本翻译更新不及时或者翻译存在问题,请联系中文版维护者::
+ 贾威威 Jia Wei Wei <harryxiyou@gmail.com>
- 中文版维护者: 贾威威 Jia Wei Wei <harryxiyou@gmail.com>
- 中文版翻译者: 贾威威 Jia Wei Wei <harryxiyou@gmail.com>
- 中文版校译者: 贾威威 Jia Wei Wei <harryxiyou@gmail.com>
+:校译:
+
+ 司延腾 Yanteng Si <siyanteng@loongson.cn>
Linux 魔术数
============
-这个文件是有关当前使用的魔术值注册表。当你给一个结构添加了一个魔术值,你也应该把这个魔术值添加到这个文件,因为我们最好把用于各种结构的魔术值统一起来。
+这个文件是有关当前使用的魔术值注册表。当你给一个结构体添加了一个魔术值,你也
+应该把这个魔术值添加到这个文件,因为我们最好把用于各种结构体的魔术值统一起来。
-使用魔术值来保护内核数据结构是一个非常好的主意。这就允许你在运行期检查(a)一个结构是否已经被攻击,或者(b)你已经给一个例行程序通过了一个错误的结构。后一种情况特别地有用---特别是当你通过一个空指针指向结构体的时候。tty源码,例如,经常通过特定驱动使用这种方法并且反复地排列特定方面的结构。
+使用魔术值来保护内核数据结构是一个 **非常好的主意** 。这就允许你在运行时检
+查一个结构体(a)是否已经被攻击,或者(b)你已经给一个例程传递了一个错误的结构
+体。最后一种情况特别地有用---特别是当你通过一个空指针指向结构体的时候。例如,
+tty源码经常通过特定驱动使用这种方法用来反复地排列特定方面的结构体。
-使用魔术值的方法是在结构的开始处声明的,如下::
+使用魔术值的方法是在结构体的开头声明它们,如下::
struct tty_ldisc {
int magic;
...
};
-当你以后给内核添加增强功能的时候,请遵守这条规则!这样就会节省数不清的调试时间,特别是一些古怪的情况,例如,数组超出范围并且重新写了超出部分。遵守这个规则,这些情况可以被快速地,安全地避免。
+当你以后给内核添加增强功能的时候,请遵守这条规则!这样就会节省数不清的调试
+时间,特别是一些古怪的情况,例如,数组超出范围并且覆盖写了超出部分。利用这
+个规则,这些情况可以被快速地,安全地检测到这些案例。
+
+变更日志::
- Theodore Ts'o
- 31 Mar 94
+ Theodore Ts'o
+ 31 Mar 94
-给当前的Linux 2.1.55添加魔术表。
+ 给当前的Linux 2.1.55添加魔术表。
- Michael Chastain
- <mailto:mec@shout.net>
- 22 Sep 1997
+ Michael Chastain
+ <mailto:mec@shout.net>
+ 22 Sep 1997
-现在应该最新的Linux 2.1.112.因为在特性冻结期间,不能在2.2.x前改变任何东西。这些条目被数域所排序。
+ 现在应该最新的Linux 2.1.112.因为在特性冻结期间,不能在2.2.x前改变任
+ 何东西。这些条目被数域所排序。
- Krzysztof G.Baranowski
- <mailto: kgb@knm.org.pl>
- 29 Jul 1998
+ Krzysztof G.Baranowski
+ <mailto: kgb@knm.org.pl>
+ 29 Jul 1998
-更新魔术表到Linux 2.5.45。刚好越过特性冻结,但是有可能还会有一些新的魔术值在2.6.x之前融入到内核中。
+ 更新魔术表到Linux 2.5.45。刚好越过特性冻结,但是有可能还会有一些新的魔
+ 术值在2.6.x之前融入到内核中。
- Petr Baudis
- <pasky@ucw.cz>
- 03 Nov 2002
+ Petr Baudis
+ <pasky@ucw.cz>
+ 03 Nov 2002
-更新魔术表到Linux 2.5.74。
+ 更新魔术表到Linux 2.5.74。
- Fabian Frederick
- <ffrederick@users.sourceforge.net>
- 09 Jul 2003
+ Fabian Frederick
+ <ffrederick@users.sourceforge.net>
+ 09 Jul 2003
===================== ================ ======================== ==========================================
魔术数名 数字 结构 文件