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

Wenjie Xu xuwenjie04@baidu.com
Thu Mar 7 03:55:07 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

This may come from the modification of the kernel and image 
we maintain ourselves. The basic image is from CentOS 7.6.1810,
and the kernel based on version 5.10.

Regards,
Xu Wenjie


More information about the ltp mailing list