[LTP] [PATCH] pipe/pipe15.c: Adjust fd check for pipe creation

Petr Vorel pvorel@suse.cz
Wed Mar 6 13:46:38 CET 2024


> > HI Wenjie, Marius,

> > > A pipe occupies 2 fds, and considering 3 standard fds,
> > > we should compare rlim_max with such *2+3 calculated value
> > > to verify whether the maximum file descriptor configuration
> > > of the current machine is sufficient.

> > Indeed, 1024*2+3 is the lowest number which passes with non-default ulimit:

> > ulimit -n $((1024*2+3)) && ./pipe15

> > Therefore I merged, thank you!

> > BTW I wonder how did you encounter this?

> In my test case, the system ulimit is set to 10240,
> and the calculated pipe_count is also 10240, causing
> the EMFILE failure when creating the pipe below.

+1, thanks for info.
Is it some embedded distro or a regular widely used distro?
I'm just curious what kernels are tested by LTP and whether where the
non-default setup comes from.

Kind regards,
Petr


More information about the ltp mailing list