Hello, On Mon, Jun 5, 2023 at 9:25 PM Adhemerval Zanella Netto <adhemerval.zane...@linaro.org> wrote: > We currently are trying to avoid the > "#ifdef ...", so a code that does not define, where is should, would fail > at compile time.
Yes, this makes perfect sense, and it was something I was also slightly concerned about (what if the Hurd's real definition stops being brought in by include/fcntl.h for some reason? -- then we'd just silently get a 0, and nobody would notice). On the other hand I wanted to not cause any additional troubles for other potential ports (FreeBSD), but maybe it's fine to require them to just add their own little header. Do you think the Linux port should define O_IGNORE_CTTY to O_NOCTTY and not to 0? > I think it would be better to add a sysdeps/unix/sysv/linux/fcntl.h which > defines O_IGNORE_CTTY unconditionally and include the default one (either > directly or though include_next.h). Could you please clarify how this whole system of file overrides works? (I mean: a more specific sysdep file, for some unclear definition of "specific", automatically overriding a less specific file of the same basename.) I think I've seen vpath get used somewhere, so I would guess that the sysdep (and other) directories are added to vpath order by their priority, and whichever one Make finds first, it passes to the compiler. Header files, I would guess again, are simply handled by passing all the paths (once again properly sorted) with -I, and it's the compiler that looks for the first directory that contains file of the given name -- this makes it possible to #include_next, and this must also be how include/ contains headers that are used during libc compilation but not installed (include/ must not be on the vpath then?). But this brings me to the more specific question: the headers to be installed are also found using vpath during 'make install', right? How would this work, will Make somehow know to not install this sysdeps/unix/sysv/linux/fcntl.h file that you're proposing, and keep installing io/fcntl.h? Sergey