<div dir="ltr"><div dir="ltr"><br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, Dec 3, 2021 at 9:26 AM Huw Davies <<a href="mailto:huw@codeweavers.com">huw@codeweavers.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">On Fri, Dec 03, 2021 at 06:05:50AM +0200, Damjan Jovanovic wrote:<br>
> The inotify code uses the Linux-specific /proc/self/fd/<FD> symlinks<br>
> to translate<br>
> file descriptors to filesystem paths. On FreeBSD, do this translation using<br>
> its own sysctl instead.<br>
> <br>
> Signed-off-by: Damjan Jovanovic <<a href="mailto:damjan.jov@gmail.com" target="_blank">damjan.jov@gmail.com</a>><br>
> ---<br>
>  server/change.c | 132 ++++++++++++++++++++++++++++++++++++++++--------<br>
>  1 file changed, 111 insertions(+), 21 deletions(-)<br>
<br>
This is causing a build failure on macOS:<br>
<br>
gcc -m32 -c -o server/change.o server/change.c -Iserver -Iinclude -D__WINESRC__ -Wall -pipe -fno-stack-protector \<br>
  -fno-strict-aliasing -Wdeclaration-after-statement -Wempty-body -Wignored-qualifiers -Winit-self \<br>
  -Wno-pragma-pack -Wstrict-prototypes -Wtype-limits -Wvla -Wwrite-strings -Wpointer-arith -gdwarf-4 \<br>
  -fno-omit-frame-pointer -O2 -g -Wno-deprecated-declarations -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=0<br>
server/change.c:236:2: error: No fd_path() function for this platform<br>
#error No fd_path() function for this platform<br>
<br>
The fd_path() stuff probably needs to be inside the #ifdef HAVE_SYS_INOTIFY_H block.<br>
<br>
Huw.<br></blockquote><div><br></div><div><div class="gmail_quote"><div>No, that sysctl really is FreeBSD-only. 
MacOS, NetBSD and OpenBSD all implement fd->path translation in 
different, incompatible ways. MacOS's KERN_FILE sysctl doesn't appear to
 filter by pid (<a href="https://developer.apple.com/library/archive/documentation/System/Conceptual/ManPages_iPhoneOS/man3/sysctl.3.html">https://developer.apple.com/library/archive/documentation/System/Conceptual/ManPages_iPhoneOS/man3/sysctl.3.html</a>),
 I think you are supposed to use the proc_pidinfo() function, see 
<a href="http://blog.palominolabs.com/2012/06/19/getting-the-files-being-used-by-a-process-on-mac-os-x/index.html">http://blog.palominolabs.com/2012/06/19/getting-the-files-being-used-by-a-process-on-mac-os-x/index.html</a></div><div><br></div><div>I'll submit a new version with some fixes, but someone with a Mac will have to develop the Apple implementation.<br></div><div><br></div>Damjan</div><div class="gmail_quote"><br></div></div></div></div>