Maximum size of message for strerror_r on VxWorks

534 Views Asked by At

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

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

cURL mentions MAXERRSTR_SIZE.

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

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

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

1

There are 1 best solutions below

0
On

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).