[PATCH v3 2/3] eal: handle sysconf(_SC_PAGESIZE) negative return value
Thomas Monjalon
thomas at monjalon.net
Fri Jun 27 19:35:16 CEST 2025
27/06/2025 18:38, Morten Brørup:
> > From: Thomas Monjalon [mailto:thomas at monjalon.net]
> > Sent: Friday, 27 June 2025 17.58
> >
> > 24/06/2025 10:03, Morten Brørup:
> > > + if ((ssize_t)page_size < 0)
> > > + rte_panic("sysconf(_SC_PAGESIZE) failed: %s",
> > > + errno == 0 ? "Indeterminate" :
> > strerror(errno));
> >
> > We don't want more rte_panic().
> > You could log the problem and return 0 here.
> > It will be a problem later, but it may allow the application to cleanup
> > instead of abrupting crashing.
>
> Disagree.
> That would be likely to cause crash with division by zero later.
> Better to fail early.
Which division by zero?
I don't think a library should take this decision on behalf of the app.
More information about the dev
mailing list