为VxWorks的strerror_r消息的最大大小 [英] Maximum size of message for strerror_r on VxWorks

查看:248
本文介绍了为VxWorks的strerror_r消息的最大大小的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

VxWorks提供一个版本strerror_r只需要两个参数。

VxWorks provides a version of strerror_r that only takes two parameters.

STATUS strerror_r
(
    int errcode, /* error number */
    char *buffer /* string buffer */
)

卷曲提到 MAXERRSTR_SIZE

VxWorks的风格strerror_r()确实使用我们传递给函数的缓冲区。缓冲区的大小应至少MAXERRSTR_SIZE(150)在rtsold.h定义

The vxworks-style strerror_r() does use the buffer we pass to the function. The buffer size should be at least MAXERRSTR_SIZE (150) defined in rtsold.h

但我似乎无法在任何地方分发查找文件rtsold.h。

But I can't seem to find the file rtsold.h anywhere in the distribution.

这是复制到缓冲区的消息的最大大小?有没有什么地方定义的#define或整型常量?

What is the maximum size of the message copied into the buffer? Is there a #define or integer constant defined somewhere?

推荐答案

有关备查。最大尺寸为NAME_MAX,或在写这篇文章的时间为255个字节。请记住终止字节,并通过至少256字节的缓冲区是安全的。 (看来我可能只是征询VxWorks的strerror_r源。对不起,我不知道)。

For future reference. The maximum size is NAME_MAX, or 255 bytes at the time of this writing. Keep in mind the termination byte, and pass a buffer of at least 256 bytes to be safe. (It seems I could have just consulted the source for strerror_r on VxWorks. I'm sorry, I didn't know that).

这篇关于为VxWorks的strerror_r消息的最大大小的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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