[PATCH v2] Use execveat syscall in fexecve

Joseph Myers joseph@codesourcery.com
Mon Sep 11 20:38:00 GMT 2017


On Mon, 11 Sep 2017, Adhemerval Zanella wrote:

> > +# ifndef __ASSUME_EXECVEAT
> > +  if (errno != ENOSYS)
> > +    return -1;
> > +# endif
> > +#endif
> 
> Do we really need to add another __ASSUME_* that eventually we will need to
> cleanup? Can't we just check fo __NR_execvat, call it and if it fails with
> ENOSYS use the current code as fallback?  The drawback would be that the
> fallback code would be mainly dead code for newer kernels.

We have the ENOSYS code there and the subsequent fallback that will 
eventually need cleaning up *anyway*.  Having the __ASSUME_* macro makes 
it obvious in future exactly what changes should be made for the cleanup 
and exactly when it is possible to do that cleanup.  I think having such 
macros for any case with fallback code that can be cleaned up in future is 
a good idea for that reason.

-- 
Joseph S. Myers
joseph@codesourcery.com



More information about the Libc-alpha mailing list