Bastien ROUCARIES wrote: > Hi, > > This two patches will allow to remove a xmalloc and bail out early in > case of ENOMEM > > I plan to implement a API reusing openat_permissive() > > If openat_permissive cwd_errno is NULL use the slow but safe fork variant > else use the fchdir variant > > Program that care could therefore use the more permissive variant > (like for instance the critical fts without FTS_NOCHDIR)
Hi Bastien, Before embarking on changes to (or duplication of) infrastructure like the *at functions, please tell us about your motivation. Why do you care about whether openat may abort under unusual circumstances --- and only on systems that are old enough that they can be challenging portability targets? As I tried to explain, there does not seem to be a clean way to solve the problem, and besides, the target systems that would benefit from this portability improvement are mostly old and dying: not supporting POSIX-mandated *at functions is a good sign that they are not evolving. > I program also to implement *at_permissive function > > What do you think about that?