On Fri, Aug 9, 2019 at 12:15 AM Martin Liška <mli...@suse.cz> wrote: > > As Jakub correctly noted, I used a piggy backing to put the new function > to a file that is supposed to contain different functions. So that > I'm suggesting a new file. Moreover, I'm also adding dup2 fallback. > > Patch can bootstrap on x86_64-linux-gnu and survives regression tests. > > Ready to be installed? > Thanks, > Martin > > libiberty/ChangeLog: > > 2019-08-08 Martin Liska <mli...@suse.cz> > > * Makefile.in: Add filedescriptor.c. > * filedescriptor.c: New file. > * lrealpath.c (is_valid_fd): Remove.
I don't understand the dup2 fallback. It looks backward: if dup2(fd, fd) will return -1 if fd does not exist. I also don't think it's needed. fcntl(fd, F_GETFD) should work on all Unix systems. It should certainly work on all Unix systems that have dup2. What systems are you concerned about? Ian