linux内核c代码 [英] linux kernel c code

查看:85
本文介绍了linux内核c代码的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我经常遇到这样的linux源代码签名:


static void __init do_initcalls(void)

{

定义(无论如何)

}


" __ init" endo_initcalls是两个不同的词。怎么一个人解释这个?b $ b?我不理解一个带有两个单独单词的函数定义。

任何人都可以解释一下这个吗?

i encounter regularly in the linux source code signatures like this:

static void __init do_initcalls(void)
{
definition(whatever)
}

"__init" en "do_initcalls" are two different words. how must one interpret
this? i don''t understand a function definition with two separate words.
anybody can explain me this?

推荐答案

slurper< sl ********* @ skynet.be>写道:
slurper <sl*********@skynet.be> wrote:
我经常在linux源代码中遇到这样的签名:
static void __init do_initcalls(void)
{
定义(无论如何)
}
" __ init" endo_initcalls是两个不同的词。怎么一个人解读这个?我不明白一个函数定义有两个单独的单词。
任何人都可以解释我这个吗?
i encounter regularly in the linux source code signatures like this: static void __init do_initcalls(void)
{
definition(whatever)
} "__init" en "do_initcalls" are two different words. how must one interpret
this? i don''t understand a function definition with two separate words.
anybody can explain me this?




你不应该期待像内核这样的东西干净,标准

符合C - 批次和许多非便携式,编译器依赖的

扩展通常使用。这类问题

就是主题的地方,例如comp.os.linux.development.system,这里是clc

他们非常不满意,因为他们是编译器和平台

dependend。在清洁中C我目前唯一可以看到

使__init的东西至少中途合法将是

a定义之前的某个地方


#define __init


即将其隐藏或使用


#define __init *


(但在这种情况下,您还必须更改功能以使

返回无效指针;-)


< OT>

为了满足您的好奇心,请查看内核源代码中的init.h头文件

- 您会发现__init被定义为

一些gcc提供的扩展,一个函数属性,给编译器一些关于函数如何使用的额外提示

将被使用 - 没什么你可以用标准的C.

< / OT>

问候,Jens

-

\\ \\ Jens Thoms Toerring ___ Je***********@physik.fu -berlin.d e

\ __________________________ http://www.toerring。 de


slurper写道:
slurper wrote:

我经常在linux源代码中遇到这样的签名:

static void __init do_initcalls(void)
{
定义(无论如何)
}

" __ init" endo_initcalls是两个不同的词。怎么一个人解读这个?我不明白一个函数定义有两个单独的单词。
任何人都可以解释我这个吗?

i encounter regularly in the linux source code signatures like this:

static void __init do_initcalls(void)
{
definition(whatever)
}

"__init" en "do_initcalls" are two different words. how must one interpret
this? i don''t understand a function definition with two separate words.
anybody can explain me this?




这个新闻组真的是关于ISO标准C和以上不是ISO

标准C.


然而,__init解释了一点这个方式的3/4这个

页面(通过搜索谷歌找到):

http://www.faqs.org/docs/kernel_2_4/lki-1.html


Erik

-

+ ------------------------------------------ ----------------- +

Erik de Castro Lopo no****@mega-nerd.com (是的,这是有效的)

+ ------------------ ----------------------------------------- +

这不是perl程序员是白痴,而是

语言以一种其他没有其他语言或工具的方式奖励愚蠢行为曾经做过。 - Erik Naggum



This newsgroups is really about ISO standard C and the above is not ISO
standard C.

However, __init is explained a little about 3/4 of the way doen this
page (found by searching google):

http://www.faqs.org/docs/kernel_2_4/lki-1.html

Erik
--
+-----------------------------------------------------------+
Erik de Castro Lopo no****@mega-nerd.com (Yes it''s valid)
+-----------------------------------------------------------+
"It''s not that perl programmers are idiots, it''s that the
language rewards idiotic behavior in a way that no other
language or tool has ever done." -- Erik Naggum


Je * **********@physik.fu-berlin.de 写道:

.... snip ...
< OT>
为了满足您的好奇心,请查看内核源代码中的init.h头文件 - 您会发现__init被定义为
.... snip ...
<OT>
To satisfy you''re curiosity have a look at the init.h header file
in the kernel sources - you will find that __init is defined as




虽然你的英语一般很好,但这种用法是错误的。

你是是你是的缩写,而你的是你的的缩写。

占有欲。如果你不想听,我道歉并且我会告诉你不要再这样做了。


-

Chuck F(cb********@yahoo.com)(cb********@worldnet.att.net)

可供咨询/临时嵌入式和系统。

< http://cbfalconer.home.att.net>使用worldnet地址!



While your English is generally excellent, this usage is wrong.
"you''re" is an abbreviation for "you are", while "your" is the
possessive. If you don''t want to hear it, my apologies and I will
try to remember not to do it again.

--
Chuck F (cb********@yahoo.com) (cb********@worldnet.att.net)
Available for consulting/temporary embedded and systems.
<http://cbfalconer.home.att.net> USE worldnet address!


这篇关于linux内核c代码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆