Match dup2 and fcntl error values to POSIX.
* dtable.h (OPEN_MAX_MAX): New macro. * resource.cc (getrlimit) [RLIMIT_NOFILE]: Use it. * dtable.cc (dtable::extend): Likewise. * fcntl.cc (fcntl64): Obey POSIX rule with too-large F_DUPFD. * syscalls.cc (dup2): Likewise.
This commit is contained in:
@@ -80,7 +80,7 @@ dtable::extend (int howmuch)
|
||||
if (howmuch <= 0)
|
||||
return 0;
|
||||
|
||||
if (new_size > (100 * NOFILE_INCR))
|
||||
if (new_size > OPEN_MAX_MAX)
|
||||
{
|
||||
set_errno (EMFILE);
|
||||
return 0;
|
||||
|
Reference in New Issue
Block a user