The following code
```
#include <unistd.h>
#include <errno.h>
#include <stdlib.h>
#include <string.h>
#include <fcntl.h>
#include <stdio.h>


void format(char *str, int size)
{
        char temp[128];
        char *ptr = temp;
        int i = 0;
        for(i=0;i<size-1;)
        {
                while(*str == 0) {++str; i++;}
                ++str; ++str; i++; i++;
                while(*str != 0) { *ptr++ = *str++; i++;}
                *ptr = '\0';
                fprintf(stderr, "%s\n", temp);
                ptr = temp;
        }
}

int main()
{
        char buffer[128];
        int fd = open(".", O_RDONLY);
        if(fd == 0){fprintf(stderr, "Error opening directory: %d\n", errno); exit(1);}
        memset(buffer, 0, 128);
        int size = read(fd, buffer, 128);
        if(size < 0) {fprintf(stderr, "Error reading directory : %d.\n", errno); exit(1);}
        format(buffer, 128);
}
```

Will print the contents of the current working directory on AIX, and produce "Error reading directory : 21." on Linux Intel.