Dear all: Still We have another question about fileio's opendir We have checked eCos' source code ---------------------------------------------------- DIR * opendir(const char *path) { ... fd = cyg_fd_alloc(1); // Never return fd 0 ...
DIR *dirp = (DIR *)fd; FILEIO_RETURN_VALUE(dirp); } ---------------------------------------------------- here opendir function will never be 0, therefore max dirs can be opened will be 1, 2, ..., OPEN_MAX, the value of max dirs can be opened is OPEN_MAX-1. However, POSIX standard requires the value to be OPEN_MAX from POSIX document The opendir() function shall open a directory stream corresponding to the directory named by the dirname argument. The directory stream is positioned at the first entry. If the type DIR is implemented using a file descriptor, applications shall only be able to open up to a total of {OPEN_MAX} files and directories. But we are not sure whether our opinion is correct, so we send this mail. Thank you! Sincerely Yours *********************************************** Beijing Sunnorth eCos Maintainer Group Maintainers: [EMAIL PROTECTED] [EMAIL PROTECTED] [EMAIL PROTECTED] [EMAIL PROTECTED] Bejing Sunnorth Electronic Technology Co.,LTD *********************************************** -- Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss