为什么atexit仅限于32个功能? [英] Why atexit is limited to 32 functions?

查看:93
本文介绍了为什么atexit仅限于32个功能?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在研究unix环境中的高级编程。

他们说我们可以使用atexit()注册最多32个函数。

为什么这仅限于32个函数?

可以告诉答案吗?

I am studying the Advanced programming in the unix environment.
There they says that we can register upto 32 functions with atexit().
Why that is limited to 32 functions?
can any one tell the answer?

推荐答案

2008年2月25日星期一20:55:39 -0800 ??? lak写道???
On Mon, 25 Feb 2008 20:55:39 -0800???lak wrote???

我正在研究unix环境中的高级编程。

他们说我们可以用atexit()注册最多32个函数。为什么

限制为32种功能?

可以告诉答案吗?
I am studying the Advanced programming in the unix environment. There
they says that we can register upto 32 functions with atexit(). Why that
is limited to 32 functions?
can any one tell the answer?



这是偏离主题的。这里我们只讨论标准C.

我想你最好把你的问题发给comp.unix.programmer。


[OT]

但我仍然在这里回答你的问题。那是因为:


" POSIX.1-2001要求实现允许至少注册ATEXIT_MAX

(32)这样的函数。


[/ OT]

It''s off-topic here. Here we only talk about standard C.
I think you''d better post your question to comp.unix.programmer.

[OT]
But I still answer your question here. That''s because:

" POSIX.1-2001 requires that an implementation allow at least ATEXIT_MAX
(32) such functions to be registered."

[/OT]


lak写道:
lak wrote:

我正在研究unix环境中的高级编程。

他们说我们可以用atexit()注册最多32个函数。

为什么限制为32个函数?

可以告诉答案吗?
I am studying the Advanced programming in the unix environment.
There they says that we can register upto 32 functions with atexit().
Why that is limited to 32 functions?
can any one tell the answer?



它应该支持* * * * * 32个函数以符合C

标准。大多数实现可能会支持更多。

It should support *at* *least* 32 functions to be conforming to the C
Standard. Most implementations will likely support more.


王聪写道:
WANG Cong wrote:

周一,25 2008年2月20:55:39 -0800?lak写道?
On Mon, 25 Feb 2008 20:55:39 -0800?lak wrote?

>我正在研究unix环境中的高级编程。他们说,我们可以使用atexit()注册最多32个函数。为什么
仅限于32种功能?
任何人都能说出答案吗?
>I am studying the Advanced programming in the unix environment. There
they says that we can register upto 32 functions with atexit(). Why
that is limited to 32 functions?
can any one tell the answer?



这是偏离主题的。这里我们只讨论标准C.

我想你最好把你的问题发给comp.unix.programmer。


It''s off-topic here. Here we only talk about standard C.
I think you''d better post your question to comp.unix.programmer.



没必要。 Atexit也是ISO C的一部分,有问题的限制是,

AFAIK,POSIX和ISO 9899:1999也是如此。


< snip>

No necessary. Atexit is also part of ISO C and the limit in question is,
AFAIK, the same for POSIX and ISO 9899:1999.

<snip>


这篇关于为什么atexit仅限于32个功能?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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