[PATCH] D33171: Fix DynamicLibraryTest.cpp on FreeBSD

Kamil Rytarowski via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun May 14 07:19:23 PDT 2017


krytarowski added inline comments.


================
Comment at: lib/Support/Unix/Path.inc:187
+  int mib[4];
+  mib[0] = CTL_KERN;
+  mib[1] = KERN_PROC;
----------------
dim wrote:
> krytarowski wrote:
> > ```
> > #if defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
> >  mib[0] = CTL_KERN;
> >   mib[1] = KERN_PROC;
> >   mib[2] = KERN_PROC_PATHNAME;
> >   mib[3] = -1;
> > #else
> >  mib[0] = CTL_KERN;
> >   mib[1] = KERN_PROC_ARGS;
> >   mib[2] = -1;
> >   mib[3] = KERN_PROC_PATHNAME;
> > #endif
> > ```
> Ah, I wasn't aware that NetBSD already supported `KERN_PROC_PATHNAME`.  I downloaded NetBSD 7.1, and couldn't find the define in sys/sysctl.h, but I see it has been added recently.
It was added after the `-7` branch a year ago or so. In my opinion no point to support here in upstream sources fallback, better to handle it downstream. By the time of 5.0.0 release we might have 8.0 out (and almost surely branched).


https://reviews.llvm.org/D33171





More information about the llvm-commits mailing list