tech-userlevel archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: [PATCH 6/6] fdopen() opens successfully more descriptiors than STREAM_MAX



"Andy Shevchenko" wrote:

> On Thu, Aug 21, 2008 at 6:30 PM, Joerg Sonnenberger
> <joerg%britannica.bec.de@localhost> wrote:
> >> fdopen() should return EMFILE if amount of file descriptors exceeds
> >> STREAM_MAX or FOPEN_MAX limit.
> >
> > This patch is wrong. FOPEN_MAX and STREAM_MAX are soft limits.
> > They are the minimum support number of open stream and exceeding this
> > limit is allowed.
> May be you are true. But I don't see the similar sentence in the SUSv3.
> What I used is following:
> http://www.opengroup.org/onlinepubs/009695399/functions/fdopen.html
> 
> ...
> ERRORS
> 
>     The fdopen() function may fail if:
> ...
>     [EMFILE]
>         {FOPEN_MAX} streams are currently open in the calling process.
>     [EMFILE]
>         {STREAM_MAX} streams are currently open in the calling process.
> ...

The key words there are "may fail", not "shall fail".

Simon.


Home | Main Index | Thread Index | Old Index