<< 44/55 >>
First Last

Incompatible functions - readdir

On Linux:

  struct dirent {
    ino_t          d_ino;
    off_t          d_off;
    unsigned short d_reclen;
    unsigned char  d_type;
    char           d_name[256];
  };

On Mac:

  struct dirent {
    ino_t d_ino;
    uint16_t d_reclen;
    uint8_t d_type;
    uint8_t d_namlen;
    char d_name[__DARWIN_MAXNAMLEN + 1];
  };

On the other hand, DIR* is OK because users don't touch its members directly

Another example: stat