[LTP] [PATCH v2 10/13] getdtablesize01: Handle ENFILE errno

Cyril Hrubis chrubis@suse.cz
Thu Nov 30 14:12:59 CET 2017


Hi!
>  //Now the max files opened should be RLIMIT_NOFILE - 1 , why ? read getdtablesize man page
>  
> -	if (count > 0)
> -		close(count);
>  	if (count == (max_val_opfiles - 1))
>  		tst_resm(TPASS, "%d = %d", count, (max_val_opfiles - 1));

We may also check for EMFILE here.

> +	else if (fd < 0 && errno == ENFILE)
> +		tst_brkm(TBROK, cleanup, "Reached maximum number of open files for the system");
                           ^
			   This should rather be TCONF i.e. skipped.

>  	else
>  		tst_resm(TFAIL, "%d != %d", count, (max_val_opfiles - 1));
>  
> +	if (count > 0)
> +		close(count);
> +
>  	cleanup();
>  	tst_exit();
>  }
> -- 
> 2.14.2
> 

-- 
Cyril Hrubis
chrubis@suse.cz


More information about the ltp mailing list