Hello,
I have two questions regarding the SysGeterrnomsg() function:

1.  What is the purpose of the following code ??

 ..
        "State not recoverable",
        "Operation not possible due to RF-kill",
    };

    if (en > sizeof(en) / sizeof(char *)) {
        return (RexxObjectPtr)context->NewStringFromAsciiz("Unknown");
    }
    return (RexxObjectPtr)context->NewStringFromAsciiz(msgs[en]);
  ...

At least on AIX 32 bit:sizeof(en) is 4, and sizeof(char*) is also 4.
And 4 / 4 = 1; therefore if en is greater then 1 we always see "Unknown"...

2. Why do we not use strerror_r() to get the error text here ??

// Thread-safe usage of strerror_r().

void thread_safe( int err )
{
    char buff[256];
    
    if( strerror_r( err, buff, 256 ) == 0 ) {
        printf( "Error: %s\n", buff );
    }
}


This should work on Linux/OS X too.

Bye
  Rainer

------------------------------------------------------------------------------
Increase Visibility of Your 3D Game App & Earn a Chance To Win $500!
Tap into the largest installed PC base & get more eyes on your game by
optimizing for Intel(R) Graphics Technology. Get started today with the
Intel(R) Software Partner Program. Five $500 cash prizes are up for grabs.
http://p.sf.net/sfu/intelisp-dev2dev
_______________________________________________
Oorexx-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/oorexx-devel

Reply via email to