mirror of
https://github.com/yuzu-emu/mbedtls.git
synced 2024-12-01 19:04:16 +01:00
Clarify how a file descriptor could still be more than the limit
It can happen if the file descriptor was opened before lowering the limit. Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
This commit is contained in:
parent
97c57fe439
commit
574cf7b59f
@ -94,6 +94,10 @@ void poll_beyond_fd_setsize( )
|
|||||||
* If the limit can't be raised, a file descriptor opened by the
|
* If the limit can't be raised, a file descriptor opened by the
|
||||||
* net_sockets module will be less than FD_SETSIZE, so the test
|
* net_sockets module will be less than FD_SETSIZE, so the test
|
||||||
* is not necessary and we mark it as skipped.
|
* is not necessary and we mark it as skipped.
|
||||||
|
* A file descriptor could still be higher than FD_SETSIZE if it was
|
||||||
|
* opened before the limit was lowered (which is something an application
|
||||||
|
* might do); but we don't do such things in our test code, so the unit
|
||||||
|
* test will run if it can.
|
||||||
*/
|
*/
|
||||||
TEST_ASSERT( getrlimit( RLIMIT_NOFILE, &rlim_nofile ) == 0 );
|
TEST_ASSERT( getrlimit( RLIMIT_NOFILE, &rlim_nofile ) == 0 );
|
||||||
if( rlim_nofile.rlim_cur < FD_SETSIZE + 1 )
|
if( rlim_nofile.rlim_cur < FD_SETSIZE + 1 )
|
||||||
|
Loading…
Reference in New Issue
Block a user