aix: improve AIX compatibility for Node.js use

As we work through the changes to Node required to support
PowerPC platforms, we have had to introduce a changes to the
libuv component to support the AIX operating system.

These are the initial enabling changes required.
On 07/22/2014 05:22 PM, Andrew Low wrote:
> In src/unix/aix.c:
> 
>> +    } else {
>> +      assert(*size > (strlen(symlink) + 1 + strlen(temp_buffer)));
>> +      snprintf(buffer, *size-1, "%s/%s", dirname(symlink), temp_buffer);
>> +    }
>> +    *size = strlen(buffer);
>> +    return 0;
>> +  /* Usage of absolute filename with location exported in PATH */
>> +  } else {
>> +    char clonedpath[8192];  /* assume 8k buffer will fit PATH */
>> +    char *token = NULL;
>> +    struct stat statstruct;
>> +
>> +    /* Get the paths. */
>> +    char *path = getenv("PATH");
>> +    if(8192 <= strlen(path))  /* verify we fit in 8k buffer for PATH */
>> +      return -EINVAL;
> 
> This error is when the fixed size buffer being used to store the
> environment variable PATH is not big enough to handle the path.
> 
> The asserts are indicators of programming errors - they are checking the
> size passed into this function. that value really should be PATH_MAX but
> can be any value large enough to store the fully qualified path name to
> the executable.
> 

Ok.


-- 
Saúl Ibarra Corretgé
bettercallsaghul.com