This is the mail archive of the ecos-discuss@sourceware.org mailing list for the eCos project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

A question about fileio opendir's problem


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:
liqin@sunnorth.com.cn
wanghui@sunnorth.com.cn
taiyun@sunnorth.com.cn
yxinghua@sunnorth.com.cn

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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]